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

The creation_commands method does not return a command for setting the coordinate geometry type #59

Closed
davidhassell opened this issue Apr 17, 2020 · 1 comment · Fixed by #60
Assignees
Labels
bug Something isn't working

Comments

@davidhassell
Copy link
Collaborator

>>> cf.environment(paths=False)
Platform: Linux-5.3.0-46-generic-x86_64-with-debian-buster-sid
HDF5 library: 1.10.4
netcdf library: 4.6.3
udunits2 library: libudunits2.so.0
python: 3.7.3
netCDF4: 1.5.3
cftime: 1.1.1
numpy: 1.18.1
psutil: 5.4.7
scipy: 1.4.1
matplotlib: 3.2.0
ESMF: 8.0.0
cfdm: 1.8.0
cfunits: 3.2.5
cfplot: not available
cf: 3.2.0

The creation_command method of the coordinate constructs ignores a geometry type if it has been set. This should be included. E.g.

>>> x = f.coordinate('X')
>>> x.get_geometry()
'polygon'
>>> print(x.creation_commands(representative_data=True))
# auxiliary_coordinate: longitude
c = cf.AuxiliaryCoordinate()
c.set_properties({'units': 'degrees_east', 'standard_name': 'longitude'})
d = <CF Data(2): [10.0, 40.0] degrees_east> # Representative data
c.set_data(d)
c.nc_set_variable('lon')
b = cf.Bounds()
b.set_properties({'units': 'degrees_east', 'standard_name': 'longitude', 'axis': 'X'})
d = <CF Data(2, 3, 4): [[[20.0, ..., --]]] degrees_east> # Representative data
b.set_data(d)
b.nc_set_variable('x')
c.set_bounds(b)
@davidhassell davidhassell added the bug Something isn't working label Apr 17, 2020
@davidhassell davidhassell self-assigned this Apr 17, 2020
@davidhassell
Copy link
Collaborator Author

Fixed in v3.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant