Skip to content

Conversation

@boulderdaze
Copy link
Collaborator

@boulderdaze boulderdaze commented Jun 25, 2025

This PR

  • Adds a models struct and enables model parsing
  • Implements gas model and modal model
  • Moves reactions into separate directory for better organization, anticipating they can grow larger as we add more models and reactions
  • Reorganize the reactions parsers to match the order of the list of reactions in the Reactions struct

Note:
While this PR is large, most of part is restructuring the reactions code to accommodate the new model configuration supports. No changes have been made to the existing reaction code.

@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.95%. Comparing base (97839f1) to head (211bcca).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #107   +/-   ##
=======================================
  Coverage   86.95%   86.95%           
=======================================
  Files           3        3           
  Lines          23       23           
=======================================
  Hits           20       20           
  Misses          3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@boulderdaze boulderdaze marked this pull request as ready for review June 25, 2025 17:45
@boulderdaze boulderdaze self-assigned this Jun 25, 2025
@boulderdaze boulderdaze requested a review from mattldawson June 25, 2025 17:46
@boulderdaze boulderdaze requested a review from K20shores June 25, 2025 17:46
@boulderdaze boulderdaze mentioned this pull request Jun 25, 2025
Copy link
Contributor

@mattldawson mattldawson left a comment

Choose a reason for hiding this comment

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

Looks great! I just had a couple minor comments that I realized later were for existing code that was just being moved. So, feel free to ignore them if they seem out of scope for this PR


if (!ContainsUniqueObjectsByName<types::Species>(all_species))
{
errors.push_back({ ConfigParseStatus::DuplicateSpeciesDetected, "Duplicate species detected." });
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to include the name of the duplicated species? It might make it easier to fix in large mechanisms. And maybe include the location in the configuration file similar to errors below? (if that's possible)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a great suggestion. I created a separate issue #111 to address this, since the current one is already quite large.


if (RequiresUnknownSpecies(species, existing_species))
{
errors.push_back({ ConfigParseStatus::PhaseRequiresUnknownSpecies, "Phase requires unknown species." });
Copy link
Contributor

Choose a reason for hiding this comment

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

I was a little confused by what this meant at first. What about something like "Phase includes unknown species: 'foo'" and including the name of the species?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree with you. I created a new issue #112 to address that.


if (!ContainsUniqueObjectsByName<types::Phase>(all_phases))
{
errors.push_back({ ConfigParseStatus::DuplicatePhasesDetected, "Duplicate phases detected." });
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe include the phase name in the error message?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a great suggestion. I created a separate issue #111 to address this, since the current one is already quite large.

Comment on lines +105 to +109
{
"name": "gas",
"type": "GAS_PHASE",
"phase": "gas"
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't really understand the point of this. Do we really need this @mattldawson?

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.

I see nothing wrong, I just don't understand that purpose of the gas model, but that shouldn't hold up a merge

@boulderdaze boulderdaze merged commit 9e1fab9 into main Jun 26, 2025
15 checks passed
@boulderdaze boulderdaze deleted the add_models branch June 26, 2025 16:00
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.

5 participants