Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Simple generator for model and parameters for use in testing #816

Closed
jsnel opened this issue Sep 13, 2021 · 1 comment
Closed

✨ Simple generator for model and parameters for use in testing #816

jsnel opened this issue Sep 13, 2021 · 1 comment
Labels
Type: Enhancement Feature requests
Milestone

Comments

@jsnel
Copy link
Member

jsnel commented Sep 13, 2021

Simple generators

Models and parameter schemes are typically either defined as a yaml file or as (in-line) dictionaries alongside Python code. For obvious reasons the test files (test_*.py) are full if in-line model definitions, and often multiple that are very similar. For instance, a one compartment decay, with and without dispersion, or a two or three compartment decay are all similar and have a lot of (boilerplate) in common. This not only results in code (dict definitions) duplication, but also in hard-to-read tests since the variation between model or parameter schemes are often quite subtle. Also because of this typo's and/or copy paste mistakes are luring around every corner. A simple generator for model and parameters can help with this.

Describe the solution you'd like

A simple generator, designed as a dataclass, that can generate a model or parameter scheme based on 'starting values' assigned to its fields.

Describe alternatives you've considered

We have attempted yaml reference nesting for a while but that did not improve readability much (see e.g. test_spectral_irf.py)

Additional context

Within the pyglotaran project feature there is also a need for simple generator, perhaps the functionalities can be merged at some point.

@jsnel
Copy link
Member Author

jsnel commented Sep 16, 2021

This has been resolved with the #807 PR which was merged into main in #778.

A follow up issue has been created in #815.

@jsnel jsnel closed this as completed Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Feature requests
Projects
None yet
Development

No branches or pull requests

1 participant