Skip to content
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

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

Merged
merged 9 commits into from
Aug 14, 2024

Conversation

carl-drews
Copy link
Contributor

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

Copy link
Collaborator

@K20shores K20shores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is almost correct. The top level folder needs to have a my_config.json, like the other three examples have. You should (I hope) be able to run your command line music box client on any of the examples by pointing them to the top level folder of any of the examples

@mattldawson
Copy link
Collaborator

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

@carl-drews
Copy link
Contributor Author

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.
FLOW_TUBE does not run because of differences among FLOW_* macros. See Slack.
FULL_GAS_PHASE does not run because of "description". See Slack.

@carl-drews
Copy link
Contributor Author

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
Copy link
Collaborator

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

Copy link

@boulderdaze boulderdaze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you for addressing them!

@carl-drews
Copy link
Contributor Author

Formatted with indent = 2 spaces.

@carl-drews
Copy link
Contributor Author

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

@carl-drews carl-drews merged commit d9a9644 into main Aug 14, 2024
1 check failed
@carl-drews carl-drews deleted the add-TS1 branch August 14, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants