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

Throw a warning/error if radiative losses undefined #90

Open
jwreep opened this issue Feb 6, 2020 · 1 comment
Open

Throw a warning/error if radiative losses undefined #90

jwreep opened this issue Feb 6, 2020 · 1 comment

Comments

@jwreep
Copy link
Member

jwreep commented Feb 6, 2020

If power law losses are switched off, and both arrays of elements used in the radiation calculation, presumably there would be no radiative losses (or HYDRAD would just crash). Pydrad should throw either an error or warning if such a case happens.

@wtbarnes
Copy link
Member

wtbarnes commented Feb 7, 2020

Agreed this is a good idea.

I think there are probably a few other places where we should probably check conditions that are dependent on multiple parameters and it is not completely obvious to me how to do this in a "clean" way.

It's very easy to do validation on single parameters given some input by simply adding a filter and applying it in the Jinja template. This is how the unit and missing parameter checking is done. Maybe we need to add some sort of config validation step that looks at the whole configuration and applies checks that depend on combinations of parameters like this one. Setting this up would also make it easy to apply any additional checks that may arise.

Alternatively, this could all be done in the Jinja templates themselves. The logic might be a bit messy though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants