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

Warning for user when non-constant functions are modified by 'params' #58

Closed
JamesPHoughton opened this issue Feb 18, 2016 · 2 comments · Fixed by #430
Closed

Warning for user when non-constant functions are modified by 'params' #58

JamesPHoughton opened this issue Feb 18, 2016 · 2 comments · Fixed by #430

Comments

@JamesPHoughton
Copy link
Collaborator

Say the user wants to set the initial conditions for the simulation, but they accidentally use the 'params' keyword. This will overwrite the stock calling functions with the values they meant to use as initial conditions, and they will get very unusual behavior.

We could check for this, and give a warning.

@JamesPHoughton
Copy link
Collaborator Author

And by 'hypothetical user' I really mean: I just did this, and couldn't figure out what was happening.

@enekomartinmartinez
Copy link
Collaborator

Hi @JamesPHoughton
I am thinking about including some small improvements in 3.8.0 to close some old issues. I could probably include different warnings in params let me know if they suit you (I will probably include also information about the var names and an option to don't show the warning messages):

  • When setting a Data o Lookup object to a constant "Warning: Replacing interpolation data with constant values."
  • When setting a cache constant value with a type different than a constant (i.e. a constant that is computed with other constant values): "Warning: Replacing a constant value that is not primitive by another constant value."
  • When replacing a constant with a pandas.Series "Warning: replacing a constant value with a time-dependent value. The value will be interpolated over time."
  • When replacing a time-dependent variable with a constant or a pandas.Series "Warning: replacing the value of a variable by a constant/time dependent value"
  • When replacing a stateful object with a constant or a pandas.Series "Warning: replacing the value of Stateful variable by a constant/time-dependent value. To set initial conditions use xxxxxx"

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

Successfully merging a pull request may close this issue.

2 participants