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

Make cfdm.read always return unicode strings from netCDF files #251

Closed
davidhassell opened this issue Mar 24, 2023 · 1 comment · Fixed by #252
Closed

Make cfdm.read always return unicode strings from netCDF files #251

davidhassell opened this issue Mar 24, 2023 · 1 comment · Fixed by #252
Labels
enhancement New feature or request netCDF read Relating to reading netCDF datasets
Milestone

Comments

@davidhassell
Copy link
Contributor

davidhassell commented Mar 24, 2023

Currently, cfdm.read can return either unicode or byte strings, which sometimes makes testing for equality difficult, as the equals methods treat them the two data types as unequal (as does numpy).

It would be good it it was consistent, and the obvious choice is unicode.

>>> cfdm.environment(paths=False)
Platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.35
HDF5 library: 1.12.1
netcdf library: 4.8.1
Python: 3.10.9
netCDF4: 1.6.0
numpy: 1.22.3
cfdm.core: 1.10.0.3
cftime: 1.6.2
netcdf_flattener: 1.2.0
cfdm: 1.10.0.3
@davidhassell
Copy link
Contributor Author

This change constitutes a "major", rather than "minor" change (https://ncas-cms.github.io/cfdm/releases.html#versioning-strategy) because in a some cases existing code will behave differently. The one case where this has been identified is that it could cause a call to Data.equals to return the opposite result to before - due to different/same data types.

As a consequence, the major version number should be increased, and this change will go in at version 1.10.1.0

@davidhassell davidhassell added the netCDF read Relating to reading netCDF datasets label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request netCDF read Relating to reading netCDF datasets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant