-
Notifications
You must be signed in to change notification settings - Fork 121
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
check for zero size landgrid before calling .min #1279
base: master
Are you sure you want to change the base?
Conversation
Hi, |
Hi, Yes, I agree. Maybe better to put an assert there, if it becomes a problem in the future and should it should not stop the simulation it can be changed then. It probably indicates some issue with the input landmask model that needs to be fixed for meaningful simulation. |
Yes, so you could simply do Generally, it is best to raise errors when something is wrong. Btw, if you provide |
I have started work on making this more granular. The first step is to make more specific errors, which you can see here: https://github.com/OpenDrift/opendrift/blob/master/opendrift/errors.py , maybe one of those can be used. The idea is that if e.g. a reader gives an |
Yes, I was also very perplexed, but unfortunately I did not keep the log files I think. But it was a long simulation (several days of CPU time) so making an MWE would have been a nightmare anyway. Also, I am very positive to raising errors that can be handled appropriately! I will update the PR with |
I assume that whether or not landgrid.size can be 0 is what comes back from this routine:
(since all of the other covers_positions return booleans, not arrays or anything else one could index on.)Is there any reason this cannot be zero size? What do we know about what is combined? |
I think the landmask reader uses this function:
|
Ah, ok. Then why can
|
Hi, should I close this PR, and replace your changes with |
Hei, I seemed to need this fix a while ago. Unsure whether there is some root issue why I got zero size landgrids in the first place, but since opendrift hardly ever raises errors anyway, we can probably get away by emitting a warning here too.