-
Notifications
You must be signed in to change notification settings - Fork 0
add yaml config format (🪨 STONE) #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of Sankey Diagram Integration I have successfully integrated the Sankey diagram functionality into your Boulder application. Here's what I implemented: Key Changes Made: Modified cantera_converter.py: Added last_network attribute to both CanteraConverter and DualCanteraConverter classes Store the successfully built network after simulation for later access by Sankey diagram Modified app.py: Added global converter instances (global_converter and global_dual_converter) to maintain access to simulation data Modified layout.py: Transformed the "Simulation Results" section into a tabbed interface: Tab 1: "Plots" - Contains the existing temperature, pressure, and species plots Tab 2: "Sankey Diagram" - Contains the new Sankey energy flow diagram Modified simulation_callbacks.py: Updated the simulation callback to store converter instances globally Added a new callback update_sankey_plot() that generates the Sankey diagram when the Sankey tab is selected How it Works: Run a simulation using the "Run Simulation" button Switch to the "Sankey Diagram" tab in the simulation results section The Sankey diagram automatically generates showing energy flows between reactors with: HHV (Higher Heating Value) flows for different species (H2, CH4) Heat flows (sensible enthalpy) Power flows through walls between reactors Features: Automatic generation when switching to the Sankey tab after running a simulation Error handling with informative messages if generation fails Species filtering (currently shows H2 and CH4 flows) Energy flow visualization using the hhv flow type from your Sankey module Integration with existing simulation workflow - no additional steps required Testing: The application is now running on http://localhost:8050. You can: Load or create a reactor network configuration Run a simulation Click on the "Sankey Diagram" tab to see the energy flow visualization The Sankey diagram will show the flow of energy through your reactor network, providing valuable insights into the energy balance and flow patterns in your Cantera simulation. Your Sankey module and its utilities are now fully integrated into the Boulder interface!
… Path) ; Summary: Enhanced Mechanism Input Parameter System I have successfully implemented all three requested improvements: 1. ✅ Dynamic Mechanism Discovery Created get_available_cantera_mechanisms() function that scans Cantera's data directories Automatically discovers 48+ available mechanisms including: GRI 3.0 (Natural Gas Combustion) H2/O2 (Hydrogen Combustion) Air (Ideal Gas Properties) Various specialized mechanisms Smart filtering excludes test files, config files, and non-mechanism files Readable labels with automatic descriptions for known mechanisms 2. ✅ Enhanced Custom Options "Custom (name)": Allows entering mechanism filename directly "Custom (path)": File upload interface for selecting mechanism files Shows file selection button when selected Displays selected file name and path Saves uploaded files to temp directory Handles file upload errors gracefully 3. ✅ Mechanism Usage Verification Added debug logging to track mechanism usage throughout the pipeline: Apply Enhanced error handling with fallback to gri30.yaml if mechanism fails to load Consistent mechanism passing from UI → Converter → Sankey diagram Updated simulation callback to handle all three mechanism selection modesl
…s.py ; Documented Global Converter Limitation
…erter limitation. Ok for multi-users
working Sankey diagrams
Add auto-dark mode
…s in Sankey itself
…ulation has the right config names
…nto add/yaml-config
Important finding : Main Freezing problems came from the Animation time of the Closing Modal window, which then created a Race conditino with the Graph being re-drawn. Eventually, the Modal was still there although hidden. To diagnose this you can see it looking at the Elements in dev Console (F12) : (although the modal is not visible to the user it's still here, and overlaying everything). Keyboard interactions would still work. |
There is a Cantera YAML standard being defined in Cantera/cantera#694 |
Hi @erwanp ... I am happy you found Cantera/cantera#694 interesting. The PR has been dormant for many years, but I had hoped to define something that is portable and part of Cantera. In a more recent (parallel) effort, I have been trying to clarify some of the ReactorNet structure so it is a 'bipartite graph' (some of this was recent, for the upcoming 3.2 release). Finally, there are some thoughts to create an HDF5 standard for ReactorNet output, see Cantera/enhancements#206 (or my earlier comments in Cantera/cantera#694 (comment)), which supersedes my efforts in https://github.com/microcombustion/ctwrap. On that front, I had decided that I'd work on something that is part of Cantera instead, as that way I won't have the issue of upstream breakages. That said, I really like the direction this project is going. I don't have the bandwidth to have a closer look and/or test until mid-September, but that doesn't mean that I'm not interested. PS: as an aside, the STONE format on top is a hybrid of what is in Cantera/cantera#694 and a potential HDF5 storage format. I have not spent sufficient time to come to a conclusion on that. |
Description
🪨STONE format (WIP )
Implementation (Cursor summary)
📋 Test Coverage Summary:
1. Comprehensive Unit Tests (
tests/test_config.py
)TestConfigurationValidation
- Structure and content validationTestConfigurationLoading
- File loading and parsingTestConfigurationNormalization
- Default value handlingTestConfigurationUtilities
- Helper functionsTestConfigurationSaving
- Configuration exportTestEdgeCases
- Corner cases and large configs2. Error Cases Thoroughly Tested:
Structure Validation Errors:
components
,connections
)id
,type
)id
,type
,source
,target
)Reference Validation Errors:
File Loading Errors:
Configuration Saving Errors:
3. Specific Error Messages Validated:
4. Validation Functions Tested:
validate_config_structure()
- ✅ All structure checks workingvalidate_component_references()
- ✅ All reference checks workingnormalize_config()
- ✅ Default value injection workingload_config_file()
- ✅ File parsing and validation workingsave_config_to_file()
- ✅ Export validation working5. Edge Cases Covered: