We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
iris.coord_categorisation.add_weekday() fails with cftime v1.1.1, the latest cftime release. Provided below is a traceback error. >>> import iris >>> import iris.coord_categorisation >>> from glob import glob >>> fnames = glob('/project/champ/data/cmip5/output1/ICHEC/EC-EARTH/historical/mon/atmos/Amon/r1i1p1/v20131231/tas/*.nc') >>> cube = iris.load_cube(fnames[0]) >>> iris.coord_categorisation.add_weekday(cube, 'time', name='weekday') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/h01/jbedwell/miniconda/envs/test_environment/lib/python3.6/site-packages/iris/coord_categorisation.py", line 208, in add_weekday units='no_unit') File "/home/h01/jbedwell/miniconda/envs/test_environment/lib/python3.6/site-packages/iris/coord_categorisation.py", line 79, in add_categorised_coord result = category_function(from_coord, from_coord.points.ravel()[0]) File "/home/h01/jbedwell/miniconda/envs/test_environment/lib/python3.6/site-packages/iris/coord_categorisation.py", line 207, in <lambda> lambda coord, x: calendar.day_abbr[_pt_date(coord, x).weekday()], AttributeError: 'cftime._cftime.DatetimeGregorian' object has no attribute 'weekday'
>>> import iris
>>> import iris.coord_categorisation
>>> from glob import glob
>>> fnames = glob('/project/champ/data/cmip5/output1/ICHEC/EC-EARTH/historical/mon/atmos/Amon/r1i1p1/v20131231/tas/*.nc')
>>> cube = iris.load_cube(fnames[0])
>>> iris.coord_categorisation.add_weekday(cube, 'time', name='weekday')
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/h01/jbedwell/miniconda/envs/test_environment/lib/python3.6/site-packages/iris/coord_categorisation.py", line 208, in add_weekday units='no_unit') File "/home/h01/jbedwell/miniconda/envs/test_environment/lib/python3.6/site-packages/iris/coord_categorisation.py", line 79, in add_categorised_coord result = category_function(from_coord, from_coord.points.ravel()[0]) File "/home/h01/jbedwell/miniconda/envs/test_environment/lib/python3.6/site-packages/iris/coord_categorisation.py", line 207, in <lambda> lambda coord, x: calendar.day_abbr[_pt_date(coord, x).weekday()], AttributeError: 'cftime._cftime.DatetimeGregorian' object has no attribute 'weekday'
The text was updated successfully, but these errors were encountered:
I can confirm this is replicable when running the test suite in Travis CI. Will investigate a fix (pinning or otherwise)
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
iris.coord_categorisation.add_weekday() fails with cftime v1.1.1, the latest cftime release. Provided below is a traceback error.
>>> import iris
>>> import iris.coord_categorisation
>>> from glob import glob
>>> fnames = glob('/project/champ/data/cmip5/output1/ICHEC/EC-EARTH/historical/mon/atmos/Amon/r1i1p1/v20131231/tas/*.nc')
>>> cube = iris.load_cube(fnames[0])
>>> iris.coord_categorisation.add_weekday(cube, 'time', name='weekday')
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/h01/jbedwell/miniconda/envs/test_environment/lib/python3.6/site-packages/iris/coord_categorisation.py", line 208, in add_weekday units='no_unit') File "/home/h01/jbedwell/miniconda/envs/test_environment/lib/python3.6/site-packages/iris/coord_categorisation.py", line 79, in add_categorised_coord result = category_function(from_coord, from_coord.points.ravel()[0]) File "/home/h01/jbedwell/miniconda/envs/test_environment/lib/python3.6/site-packages/iris/coord_categorisation.py", line 207, in <lambda> lambda coord, x: calendar.day_abbr[_pt_date(coord, x).weekday()], AttributeError: 'cftime._cftime.DatetimeGregorian' object has no attribute 'weekday'
The text was updated successfully, but these errors were encountered: