Skip to content

Refactor code organization after adding Aerosols and Emissions#293

Merged
boulderdaze merged 7 commits into
mainfrom
organize_types
Jul 8, 2026
Merged

Refactor code organization after adding Aerosols and Emissions#293
boulderdaze merged 7 commits into
mainfrom
organize_types

Conversation

@boulderdaze

@boulderdaze boulderdaze commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This PR:

  • Types are now organized into species, reactions, aerosol, emissions. The species file also includes phases, since species is its primary type.
  • Moves Print function in the public header used exclusively by google test to test/utils. This avoids including <ostream> and gtest helpers in non-test builds, where they are never used.
  • Moves Version struct out of mechanism. The push macro/pop macro glibc workaround is noisy. mechansim.hpp now contains mechanism struct only , and no platform specific workarounds.
  • Capitalizes all constants for consistency (boltzmann -> BOLTZMANN)
  • Splits emissions_parser.hpp, which bundles CheckEmissionsSchema and ParseEmissionsSection into seperate schema.hpp and parser.hpp files.
  • Renames ParseEmissionsSection to ParseEmissions for consistency. (@smeechncar, let me know what you think about the renaming.)
  • Moves ParseEmissionsSection() into Build() so species, phases, reactions, aerosol, and emissions are all assembled in one place.
  • Separates emissions validation logics from gas model validation by creating ValidateEmissionsModel.
  • Files in the top level directory contain code shared across multiple structs. For example, Arrhenius keys remains at the top level because it is used by both the reactions and aerosols.
  • Renames GetReactionComponentName -> GetComponentName because it's also used to extract species names and phase-species names, not just reaction reactants/productss
  • Closes Improve Emissions handling consistency #291

Note: This PR is large, but it contains no actual code changes unless explicitly noted in the comments. The changes are limited to code reorganization, file relocations, and renaming.

@boulderdaze boulderdaze self-assigned this Jul 8, 2026
@codecov-commenter

codecov-commenter commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.08063% with 136 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.68%. Comparing base (b6a7001) to head (c6b4fac).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/v1/aerosol/schema.cpp 78.23% 37 Missing ⚠️
src/v1/aerosol/parsers.cpp 85.00% 27 Missing ⚠️
src/v1/reactions/schema.cpp 72.09% 12 Missing ⚠️
src/v1/reactions/surface.cpp 72.09% 12 Missing ⚠️
src/v1/species/parsers.cpp 83.92% 9 Missing ⚠️
src/v1/emissions/parsers.cpp 88.23% 8 Missing ⚠️
src/v1/aerosol/utils.cpp 80.95% 4 Missing ⚠️
src/v1/reactions/branched.cpp 89.47% 4 Missing ⚠️
src/v1/reactions/arrhenius.cpp 93.02% 3 Missing ⚠️
src/v1/reactions/parsers.cpp 89.65% 3 Missing ⚠️
... and 9 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #293      +/-   ##
==========================================
+ Coverage   87.57%   87.68%   +0.10%     
==========================================
  Files          41       45       +4     
  Lines        2479     2484       +5     
==========================================
+ Hits         2171     2178       +7     
+ Misses        308      306       -2     
Files with missing lines Coverage Δ
include/mechanism_configuration/errors.hpp 100.00% <ø> (+42.85%) ⬆️
...lude/mechanism_configuration/mechanism_version.hpp 100.00% <100.00%> (ø)
src/detail/v1/reactions/parsers.hpp 100.00% <ø> (ø)
src/schema.cpp 87.93% <ø> (ø)
src/v0/arrhenius_parser.cpp 100.00% <100.00%> (ø)
src/v0/branched_parser.cpp 100.00% <100.00%> (ø)
src/v0/emission_parser.cpp 100.00% <ø> (ø)
src/v0/first_order_loss_parser.cpp 100.00% <ø> (ø)
src/v0/parser.cpp 87.61% <ø> (ø)
src/v0/photolysis_parser.cpp 100.00% <ø> (ø)
... and 30 more
🚀 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 July 8, 2026 02:23
@smeechncar

Copy link
Copy Markdown
Contributor

@boulderdaze I have no problem with the name change since it is purely internal to MC and invisible to MUSICA.

@K20shores K20shores left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This makes my soul feel good

@boulderdaze boulderdaze merged commit 4cdab36 into main Jul 8, 2026
27 of 28 checks passed
@boulderdaze boulderdaze deleted the organize_types branch July 8, 2026 15:11
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.

Improve Emissions handling consistency

4 participants