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 cf.Field.has_construct method returns False unless a construct key is used #67

Closed
davidhassell opened this issue Apr 29, 2020 · 0 comments · Fixed by #68
Closed
Assignees
Labels
bug Something isn't working

Comments

@davidhassell
Copy link
Collaborator

In [12]: import cf

In [13]: f = cf.example_field(0)

In [14]: print(f.constructs)
Constructs:
{'cellmethod0': <CF CellMethod: area: mean>,
 'dimensioncoordinate0': <CF DimensionCoordinate: latitude(5) degrees_north>,
 'dimensioncoordinate1': <CF DimensionCoordinate: longitude(8) degrees_east>,
 'dimensioncoordinate2': <CF DimensionCoordinate: time(1) days since 2018-12-01 >,
 'domainaxis0': <CF DomainAxis: size(5)>,
 'domainaxis1': <CF DomainAxis: size(8)>,
 'domainaxis2': <CF DomainAxis: size(1)>}

In [15]: f.has_construct('dimensioncoordinate2')
Out[15]: True

In [16]: f.has_construct('T')
Out[16]: False

We should have:

>>> f.has_construct('T')
True
  • The version of the software and the environment in which you are encountering an issue. The output of cf.environment(paths=False) is useful for this.
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.1
cfunits: 3.2.6
cfplot: not available
cf: 3.3.0
@davidhassell davidhassell added the bug Something isn't working label Apr 29, 2020
@davidhassell davidhassell self-assigned this Apr 29, 2020
davidhassell added a commit that referenced this issue Apr 29, 2020
has_construct bug fix + docs (Fixes #67)
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