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

Should pysand allow nan as input and return nan? #75

Open
cklov opened this issue Jun 24, 2021 · 3 comments
Open

Should pysand allow nan as input and return nan? #75

cklov opened this issue Jun 24, 2021 · 3 comments
Labels
question Further information is requested

Comments

@cklov
Copy link
Contributor

cklov commented Jun 24, 2021

After implementing pysand in IOC erosion calculations we have encountered several issues with NaN values. IOC accept NaNs as a valid result, however pysand throws an exception if a NaN value is passed as input. The result is that the IOC calculations fail and cannot progress past the timestamp containing a NaN and data starts to lag.

We have made some modifications to the pythonscripts in IOC to replace NaN values before they are passed to pysand, but maybe pysand should accept NaNs as this is a valid datapoint in python?

@smolvik1
Copy link
Collaborator

So, if I understand this correctly. You want erosion calculations to return NaN as output rather than throwing an exception when insufficient input is provided?

@cklov
Copy link
Contributor Author

cklov commented Jun 24, 2021

Yep. If one or more input variables is NaN the function should return NaN. I guess python by default returns NaN if NaN is part of a calculation? Any other invalid input, such as None, should probably still trigger an exception

@smolvik1
Copy link
Collaborator

smolvik1 commented Jun 24, 2021

Instinctively I am not a fan of just returning NaN on user input NaN. Would it be an option to issue a warning instead of throwing an exception?

@smolvik1 smolvik1 added the question Further information is requested label May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants