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

daops production error: ZeroDivisionError: float divmod() - with tiny (lat, lon) box #61

Closed
agstephens opened this issue Mar 23, 2021 · 5 comments
Assignees

Comments

@agstephens
Copy link
Collaborator

  • daops version: production
  • Python version: 3.7
  • Operating System: Centos7

Description

The error logs have shown that this request fails:

from daops.ops.subset import subset

inputs = {
  'collection': 'c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1i1p1f1.day.tasmax.gn.v20191108',
  'area': (8.37, 39.12, 8.56, 39.26),
  'level': None,
  'time': ('2006-01-01T00:00:00', '2099-12-30T00:00:00'),
  'output_type': 'netcdf',
  'output_dir': '.',
  'split_method': 'time:auto',
  'file_namer': 'standard'
}

resp = subset(**inputs)

The error we are seeing is:

/usr/local/Miniconda3-py39_4.9.2-Linux-x86_64/envs/rook/lib/python3.7/site-packages/clisops/core/subset.py: found within input date time range. Defaulting to minimum time step in xarray object.
  da = subset_time(da, start_date=start_date, end_date=end_date)
/usr/local/Miniconda3-py39_4.9.2-Linux-x86_64/envs/rook/lib/python3.7/site-packages/clisops/core/subset.py:een nudged to nearest valid time step in xarray object.
  da = subset_time(da, start_date=start_date, end_date=end_date)
ZeroDivisionError: float divmod()

My first guess is that the lat and lon selection is coming back with no data because the range is too small - but that that doesn't actually trigger an exception in xarray, then subsequent processing is highlighting the error.

@ellesmith88 please take a look. Thanks

@ellesmith88
Copy link
Collaborator

This comes from having no latitude and longitude values which results in da.nybtes = 0, so the error occurs in clisops.utils.output_utils.get_time_slices

@agstephens
Copy link
Collaborator Author

@ellesmith88 @cehbrecht: That's good. I think the appropriate response is for us to raise an Exception inside clisops to say that the subset did not include any valid data points. Do you agree? (Alternatively, we could nudge the lat/lon selection).

@ellesmith88
Copy link
Collaborator

@agstephens @cehbrecht I agree - I have just been testing with an exception in clisops.ops.subset, but maybe it should live in subset_bbox?

@agstephens
Copy link
Collaborator Author

@ellesmith88 I think it should live in clisops.core.subset::subset_bbox - but we should check with Ouranos/CRIM just in case it will impact on their usage of the module.

@ellesmith88
Copy link
Collaborator

closed by roocs/clisops#152

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

No branches or pull requests

2 participants