-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fix cfdm.write
failure for a vertical CRS that has no coordinates
#165
Conversation
Codecov Report
@@ Coverage Diff @@
## master #165 +/- ##
==========================================
- Coverage 88.72% 88.71% -0.00%
==========================================
Files 101 101
Lines 10806 10806
==========================================
- Hits 9587 9586 -1
- Misses 1219 1220 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good fix, but can we have a test to cover the case of writing a field with a vertical coordinate reference system? Nothing fails on master
to indicate the issue at hand...
Hi Sadie, Fair enough! The error came from some user data, and I'll try to get a minimal reproducer we can include in the tests. |
cfdm.write
failure for a field with a vertical coordinate reference systemcfdm.write
failure for a vertical CRS that has no coordinates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the new test, which passes on this PR branch but fails on master
due to the issue at hand:
ERROR: test_CoordinateReference_write (__main__.CoordinateReferenceTest)
Test write when vertical CRS has no coordinates.
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_CoordinateReference.py", line 61, in test_CoordinateReference_write
cfdm.write(f, tempfile1)
File "/home/sadie/cfdm/cfdm/read_write/write.py", line 522, in write
netcdf.write(
File "/home/sadie/cfdm/cfdm/decorators.py", line 171, in verbose_override_wrapper
return method_with_verbose_kwarg(*args, **kwargs)
File "/home/sadie/cfdm/cfdm/read_write/netcdf/netcdfwrite.py", line 4809, in write
self._file_io_iteration(
File "/home/sadie/cfdm/cfdm/read_write/netcdf/netcdfwrite.py", line 5089, in _file_io_iteration
self._write_field_or_domain(f)
File "/home/sadie/cfdm/cfdm/read_write/netcdf/netcdfwrite.py", line 3725, in _write_field_or_domain
z_axis = self.implementation.get_construct_data_axes(
TypeError: 'NoneType' object is not subscriptable
----------------------------------------------------------------------
so captures the bug. All good!
Thank you, Sadie. |
Fixes #164