NCAR / music-box-interactive-api

User interface for the MusicBox box/column model
https://musicbox.acom.ucar.edu
Apache License 2.0
3 stars 2 forks source link

Add TS1 mechanism configuration and initial condtions to the examples #421

Closed carl-drews closed 1 month ago

carl-drews commented 1 month ago

Added the following files to examples: Directory of C:\2024\MusicBox\music-box-interactive-api\interactive\api\static\examples\TS1

08/01/2024 05:19 PM

. 08/01/2024 05:19 PM .. 08/01/2024 05:02 PM 67 config.json 08/01/2024 05:02 PM 7,627 initial_conditions.csv 08/01/2024 05:02 PM 160,424 reactions.json 08/01/2024 05:02 PM 33,014 species.json 4 File(s) 201,132 bytes 2 Dir(s) 198,050,938,880 bytes free

Use Docker to verify that the JSON files are retrievable, for example: http://localhost:8000/api/load-example?example=TS1

mattldawson commented 1 month ago

Just noticed the tests are failing - is this something unrelated to this PR?

carl-drews commented 1 month ago

I don't know why the checks are failing; it looks like the docker-compose command is not found.

TS1 and CHAPMAN run to completion and produce output. FLOWTUBE does not run because of differences among FLOW* macros. See Slack. FULL_GAS_PHASE does not run because of "description". See Slack.

carl-drews commented 1 month ago

Ready for another round of reviews after addressing requests. Note that TS1 will not run without this python change in music_box.py on about line 721. The addresses a gap in the ordered sequencing:


        rate_constants = {}
        for rate in curr_conditions.reaction_rates:

            if (rate.reaction.reaction_type == "PHOTOLYSIS"):
                key = "PHOTO." + rate.reaction.name
            elif (rate.reaction.reaction_type == "LOSS"):
                key = "LOSS." + rate.reaction.name
            elif (rate.reaction.reaction_type == "EMISSION"):
                key = "EMIS." + rate.reaction.name
            rate_constants[key] = rate.rate

        **ordered_rate_constants = (len(rate_constants.keys()) + 1) * [0.0]   # bogus + 1**
K20shores commented 1 month ago

The test failure is nothing to do with the code added here, and something with the action. I fixed it in #422

carl-drews commented 1 month ago

Formatted with indent = 2 spaces.

carl-drews commented 1 month ago

TS1 is ready for further development (restore initial conditions).