forked from Ciela-Institute/caustics
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add functionality to build simulator from a YAML configuration …
…file (Ciela-Institute#167) * feat: Add registry for various parametrized "kind" (#84) * feat: Add registry for various parametrized "kind" Added a registry for cosmology, lenses, light, and sims classes to be used as "kind" * style: pre-commit fixes * fix: Fix misspelling of pixelatedconvergence Co-authored-by: Cordero Core <127983572+uwcdc@users.noreply.github.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Cordero Core <127983572+uwcdc@users.noreply.github.com> * feat: Add _meta_params class attribute * fix: Fix default _meta_params type * feat: Add _meta_params to cosmo, lenses, and source (#87) * feat: Add _meta_params to cosmology, lenses, and sources for use in yaml validation * feat: Add _meta_params to lens_source * fix: Remove _meta_params from multiplane.py Co-authored-by: Don Setiawan <landungs@uw.edu> * fix: Remove _meta_params from singleplane.py * fix: Update _meta_params to reflect z_s --------- Co-authored-by: Don Setiawan <landungs@uw.edu> * feat: Add pydantic dynamic models from classes (#88) * feat: Add pydantic dynamic models from classes * revert: Remove the use of _meta_params, and use annotated instead * feat: Updated dynamic creation to use annotated from class * fix: Fix bugs in creating field defs * test: Add tests for models/utils * fix: Fix typehints for Parametrized | * chore(deps): Add pydantic 2 as dependency * refactor: Add build_simulator function to caustics init * feat: Add way to evaluate string and dict in pre field inputs * fix: Fix return type to be Any * fix: Apply suggestions from code review Co-authored-by: Cordero Core <127983572+uwcdc@users.noreply.github.com> * fix: Apply suggestions from code review Co-authored-by: Cordero Core <127983572+uwcdc@users.noreply.github.com> --------- Co-authored-by: Cordero Core <127983572+uwcdc@users.noreply.github.com> * feat: Add ValueError when dict doesn't include both 'func' and 'keys' * test: Add integration test for yaml config (#89) * test: Add integration test for yaml config * refactor: Remove unecessary attr and specify union for build * test: Add test for models registry * chore(deps): Add pytest-mock for mocking * test: Separate models test utils and create a complex yaml * fix: Move SinglePlane to single lenses and handle case * test: Add test for models api * fix: Add single plane model to list of lenses * refactor: Renamed config_json to config_dict for clarity * test: Fix tempfile test for windows * test: Fix temp file creation and reading * test: Extract temp yaml creation to a func * test: Fix to use path of tempfile * test: Fix where name is extracted * test: Add build_simulator test with state * test: Ignore cleanup for temp state dict... let OS clean it up * fix: Fix bug with arbitrary dict --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Cordero Core <127983572+uwcdc@users.noreply.github.com>
- Loading branch information
1 parent
76e630c
commit ea19d89
Showing
48 changed files
with
2,053 additions
and
281 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.