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

Allow infinities instead of NaN to signify "goal has no target at this time step" #1081

Open
SGeeversAtVortech opened this issue Nov 22, 2018 · 1 comment

Comments

@SGeeversAtVortech
Copy link
Contributor

In GitLab by @vreeken on Nov 22, 2018, 20:37

Would it be a good idea to allow the use of +/- infinity to signify that no target_min/max should be set at certain time? Currently we only allow the use of NaN for this, but NaN is very annoying in that any comparisons/arithmetic fails (whereas it typically behaves nicely with infinity). Something simple as assert target_min.values <= target_max.values will fail if there are NaNs present.

As far as implementation is concerned, it seems that there are only some validation checks preventing the use of infinities as this[0]. The generated constraint+objective is exactly equal for both NaN and +/- inf. There might be other changes needed, but first I just want to check if anyone else thinks this might be worth supporting.

Somewhat related to #1079

[0] Two checks I could find was that target should be in the function range (which infinity obviously is not), and the monotonicity check.

@SGeeversAtVortech
Copy link
Contributor Author

In GitLab by @jvande42b on Nov 23, 2018, 09:15

Coming from refactoring the LookupTable stuff, the first thing that comes to mind is that we need to do np.isfininte() instead of ~np.isnan() in __call__ and reverse_call().

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

1 participant