This branch introduces significant improvements to the Monte Carlo plotting capabilities in Basilisk, focusing on enhancing the AnalysisBaseClass.py file and related example scenarios. The key changes include:
The MonteCarloPlotter class:
Improved data loading and management
Dynamic plot creation with support for multiple variables and components
Interactive plot updates based on user input
Efficient handling of large datasets through downsampling and streaming
Bokeh Integration:
Added support for Bokeh, enabling interactive HTML-based visualizations
Implemented a Bokeh server option for real-time plot updates
Created a fallback to matplotlib when Bokeh is unavailable
User Interface Improvements:
Added dropdown menus for variable and component selection
Implemented a search functionality to highlight specific run numbers
Created a status indicator to show plot loading/updating status
Documentation and File Management:
Improved plot saving functionality, including HTML and RST file generation
Enhanced documentation generation for saved plots
Example Scenario Updates:
Modified scenarioMonteCarloAttRW.py to showcase the new plotting capabilities
Added command-line options for data deletion and Bokeh server usage
Implemented a new scenarioRerunMonteCarlo.py for demonstrating how to rerun specific Monte Carlo simulations
Removed "This is a hack..." line from the repo and added objects directly to 'sim' parent object to remain in scope for MC runs
Testing and Compatibility:
Updated test_bskMcTestScript.py to accommodate the new features
Ensured backward compatibility with existing Monte Carlo simulations
These changes significantly improve the visualization and analysis capabilities for Monte Carlo simulations in Basilisk, providing users with more interactive and informative tools to explore simulation results.
Verification
The changes were validated through the following methods:
Manual Testing:
Extensive testing of the new MonteCarloPlotter class functionality
Verification of Bokeh integration and fallback to matplotlib
Testing of user interface improvements, including dropdown menus and run number search functionality
Automated Tests:
Updated test_bskMcTestScript.py to cover new features and ensure backward compatibility
Added new unit tests for the MonteCarloPlotter class to verify data loading, plot creation, and interactive updates
Example Scenario Testing:
Ran and verified the modified scenarioMonteCarloAttRW.py to showcase new plotting capabilities
Tested the new scenarioRerunMonteCarlo.py to ensure proper functionality for rerunning specific Monte Carlo simulations
Performance Testing:
Conducted manual performance tests with large datasets up to 1 GB in size to verify efficient data handling and display
Documentation Review:
Verified that the updated documentation accurately reflects the new features and usage instructions in sphinx documentation
No tests were removed or re-baselined. The addition and update of tests were necessary to cover the new functionality and ensure the reliability of the Monte Carlo plotting capabilities.
Documentation
The following documentation has been affected by these changes and should be reviewed for accuracy and completeness:
Docstrings in modified files:
scenarioVisualizeMonteCarlo.py: Revised docstrings to reflect new command-line options and usage of updated plotting capabilities (bokeh) and this along with the other files was renamed from scenarioAnalyzeMonteCarlo.py
scenarioMonteCarloAttRW.py: Revised docstrings to reflect new command-line options and usage of updated plotting capabilities
scenarioRerunMonteCarlo.py: New file with comprehensive docstrings explaining the purpose and usage of rerunning specific Monte Carlo simulations
optional-requirements.txt:
Added Bokeh and Dask to the list of optional requirements
Reviewers should verify these optional packages are sufficient for the new plotting capabilities introduced in this branch/pr.
Reviewers should pay particular attention to:
Accuracy and completeness of docstrings in the modified files
Clarity of explanations for new features and methods
Consistency between code behavior and documented functionality
General difficulties for the target user (researchers interacting with plots and making the plots from MC's)
Additionally, reviewers should ensure that the addition of Bokeh and Dask to the optional requirements is properly documented in any relevant README files or user guides.
Future work
Further optimization of performance for large datasets:
Investigate and implement data compression techniques to improve handling of very large Monte Carlo datasets
Explore more efficient data streaming methods for real-time plot updates
Refinement of Bokeh plotting tools:
Gather user feedback on the new Monte Carlo plotting capabilities
Based on feedback, potentially simplify or customize Bokeh plotting tools specifically for Monte Carlo simulations
Consider adding more advanced interactive features or visualization types if requested by users/devs/researchers
Expansion of rerun capabilities:
Enhance the scenarioRerunMonteCarlo.py to support more complex rerun scenarios
Implement a user-friendly interface for selecting specific Monte Carlo runs to rerun
Integration with other Basilisk modules:
Explore opportunities to integrate the improved Monte Carlo plotting capabilities with any other relevant Basilisk analysis and visualization tools
Documentation and tutorials???:
Develop more comprehensive tutorials and examples showcasing the new Monte Carlo plotting features
Perhaps create a video tutorial to help users quickly adopt and leverage the new capabilities
Note: These future work items are based on anticipated needs and potential improvements. Priorities may be adjusted based on actual user feedback and project requirements.
Description
This branch introduces significant improvements to the Monte Carlo plotting capabilities in Basilisk, focusing on enhancing the
AnalysisBaseClass.py
file and related example scenarios. The key changes include:The
MonteCarloPlotter
class:Bokeh Integration:
User Interface Improvements:
Documentation and File Management:
Example Scenario Updates:
scenarioMonteCarloAttRW.py
to showcase the new plotting capabilitiesscenarioRerunMonteCarlo.py
for demonstrating how to rerun specific Monte Carlo simulationsTesting and Compatibility:
test_bskMcTestScript.py
to accommodate the new featuresThese changes significantly improve the visualization and analysis capabilities for Monte Carlo simulations in Basilisk, providing users with more interactive and informative tools to explore simulation results.
Verification
The changes were validated through the following methods:
Manual Testing:
MonteCarloPlotter
class functionalityAutomated Tests:
test_bskMcTestScript.py
to cover new features and ensure backward compatibilityMonteCarloPlotter
class to verify data loading, plot creation, and interactive updatesExample Scenario Testing:
scenarioMonteCarloAttRW.py
to showcase new plotting capabilitiesscenarioRerunMonteCarlo.py
to ensure proper functionality for rerunning specific Monte Carlo simulationsPerformance Testing:
Documentation Review:
No tests were removed or re-baselined. The addition and update of tests were necessary to cover the new functionality and ensure the reliability of the Monte Carlo plotting capabilities.
Documentation
The following documentation has been affected by these changes and should be reviewed for accuracy and completeness:
Docstrings in modified files:
scenarioVisualizeMonteCarlo.py
: Revised docstrings to reflect new command-line options and usage of updated plotting capabilities (bokeh) and this along with the other files was renamed from scenarioAnalyzeMonteCarlo.pyscenarioMonteCarloAttRW.py
: Revised docstrings to reflect new command-line options and usage of updated plotting capabilitiesscenarioRerunMonteCarlo.py
: New file with comprehensive docstrings explaining the purpose and usage of rerunning specific Monte Carlo simulationsoptional-requirements.txt
:Reviewers should pay particular attention to:
Additionally, reviewers should ensure that the addition of Bokeh and Dask to the optional requirements is properly documented in any relevant README files or user guides.
Future work
Further optimization of performance for large datasets:
Refinement of Bokeh plotting tools:
Expansion of rerun capabilities:
scenarioRerunMonteCarlo.py
to support more complex rerun scenariosIntegration with other Basilisk modules:
Documentation and tutorials???:
Note: These future work items are based on anticipated needs and potential improvements. Priorities may be adjusted based on actual user feedback and project requirements.