Repository navigation
Export CurlCurl/ToyDrift in struphy.api.models; fix model docstring and propagator Options template - #798
Merged
Conversation
….api.models; fix model and propagator templates - api/models/__init__.py: add the three missing models; new test checks that its __all__ matches struphy.models (closes #793) - models/base.py: docstring now says one model per module and where to register it, instead of fluid.py/kinetic.py/... (closes #794) - propagators/base.py: template option is opt1: OptsTemplate = "implicit" instead of a tuple annotated as str (closes #795) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups: api/tests/ was in no CI shard; added to shard-2 of both workflows and to struphy test unit. The test now also checks that each exported model is imported from its defining module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #793, closes #794, closes #795.
struphy.api.modelsnow also exportsCurlCurl,ToyDriftandIncompressibleNavierStokesSPH(the last one was missing too). A new test inapi/tests/test_public_api.pyparsesapi/models/__init__.py(without importing every model). It checks that__all__matchesstruphy.models.__all__and_LAZY_IMPORTS, and that each name is imported from its defining module. So a model that is missing from the hand-maintained api file now fails CI.StruphyModeldocstring no longer points tofluid.py/kinetic.py/... It now says one module per model, regeneratestruphy/models/__init__.pywithstruphy build-init-files, and add the model by hand tostruphy/api/models/__init__.py.Propagator.Optionsnow declaresopt1: OptsTemplate = "implicit", the same pattern as the real propagators (e.g.implicit_diffusion.py). It used to beopt1: str = ("implicit",).check_optionaccepts tuples on purpose (list-valued options), which is why the old default never failed.src/struphy/api/tests/was in no test shard, so its tests never ran in CI. It is now in shard-2 ofreusable-unit-testing.ymlandreusable-scheduled.ymland instruphy test unit. Its tests are markedmpi_skip, and the folder gets an__init__.pylike the other test folders.Follow-up for #797: once this is merged, the line "Don't copy the template in
base.pyliterally: itsopt1default is a tuple." insrc/struphy/propagators/AGENTS.mdcan be removed.🤖 Generated with Claude Code