Repository navigation
Replace look-ahead reads of optional drydep inputs with explicit spec lines - #237
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #237 +/- ##
==========================================
+ Coverage 78.48% 78.53% +0.05%
==========================================
Files 56 56
Lines 9815 9801 -14
==========================================
- Hits 7703 7697 -6
+ Misses 2112 2104 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mwest1066
approved these changes
Nov 20, 2026
Collaborator
|
thank you, @jcurtis2 & @mwest1066 |
Collaborator
|
@jcurtis2, after routing the partmc submodule to this branch, the PyPartMC PR 560 compiles OK! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two spec-file readers decide whether an optional line is present by reading the next line and then rewinding with
spec_file_unread_line:spec_file_read_scenario: optionaldrydep_paramsafterloss_function drydepspec_file_read_run_sect: optionaldo_aero_dilutionThis PR replaces both look-aheads with explicit spec lines. The input format is then strictly sequential again, the same as other optional inputs such as
do_fractalordo_coagulation, where a flag decides what follows.Motivation
PyPartMC reads PartMC inputs from Python dicts by key, so there is no "next line" to look at. Supporting the look-ahead meant emulating line order from dict key order, potentially a complicated solution on that end.
Changes
loss_functionisdrydep, the next line must bedrydep_use_defaults(logical). If it isno, it must be followed bydrydep_params <file>.do_aero_dilutionis required whenloss_functionisdrydepand is not read otherwise; dilution is then always applied.spec_file_unread_lineis no longer called and removed.Input format change
Spec files with
loss_function drydepneed the new line:Sectional drydep specs must include
do_aero_dilution.Testing
scenarios/7_drydepmodal run: withdrydep_use_defaults nothe parameter file is read (final N = 2.52e9 m^-3); withyesthe defaults are used (1.69e9 m^-3).do_aero_dilution, and aloss_function nonerun that includes it, both fail at the right line; anonerun without it works.