ecmwf / earthkit-data

A format-agnostic Python interface for geospatial data
Apache License 2.0
47 stars 9 forks source link

Allow None for bits_per_value option in FieldList save() method #326

Closed sandorkertesz closed 4 months ago

sandorkertesz commented 4 months ago

Is your feature request related to a problem? Please describe.

Currently save() has the following options:

def save(filename, append=False, check_nans=True, bits_per_value=16)

where bits_per_value must be an int (cannot be None).

This poses a problem when the Fieldlist was created by modifying another one, and we want keep the original fields' bits_per_value settings.

The simplest solution would be to allow bits_per_value=None, which would indicate to keep the original settings.

As for the default value, we should use:

bits_per_value=None

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Organisation

No response

cfkanesan commented 2 months ago

@sandorkertesz This change has not been released as of version 0.6.0. Any plans for the release?

sandorkertesz commented 2 months ago

@cfkanesan The 0.7.0 release will come very soon with everything we have now in develop. 0.6.0 only contains a single (isolated) feature and basically nothing from develop.

sandorkertesz commented 2 months ago

@cfkanesan, 0.7.0 with this feature has been released: https://earthkit-data.readthedocs.io/en/latest/release_notes/version_0.7_updates.html