-
Notifications
You must be signed in to change notification settings - Fork 91
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
ValueError is raised when delay_time argument in DelayFixed has dimensions #401
Comments
The current implementation of any DELAY function allows only a 0-dim positive integer delay_order (in DELAY_FIXED delay_time should be a 0-dim multiple of time_step). If delay order depends on the dimension, I would suggest splitting your delay equation in equations of the same order. |
Another option would be to automatize PySD to create several delay objects following the dimensions of delay_order (or delay_time in DELAY_FIXED), But this would take more time. So it depends on your needs. My recommendation would be writing Vensim code in this way:
|
OK. I'll evaluate the second option when I find the time (in a few weeks), and be back to you. In the meantime, it would be wise to add an exception with a more convenient error message (and possibly a suggested workaround) if the time_delay has dimensions. |
@rogersamso would you like to add the exception error message in dev branch? |
Hi @enekomartinmartinez I don't have the time right now, so if you want to do it yourself, please go ahead. |
When calculating the order, the following ValueError is raised:
This test model reproduces the error:
The text was updated successfully, but these errors were encountered: