-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Document that Variable.encoding
is ignored if encoding is given in to_netcdf
#7127
Closed
4 tasks done
Comments
observingClouds
added
bug
needs triage
Issue that has not been reviewed by xarray team member
labels
Oct 4, 2022
observingClouds
changed the title
Dtype changes if any encoding is given
Dtype changes if any encoding is given in Oct 4, 2022
to_netcdf
This was referenced Oct 4, 2022
observingClouds
added a commit
to observingClouds/xbitinfo
that referenced
this issue
Oct 5, 2022
this is a temporary restiction to ensure only correct encoding for the output is used. Related: pydata/xarray#7127
observingClouds
added a commit
to observingClouds/xbitinfo
that referenced
this issue
Oct 6, 2022
this is a temporary restiction to ensure only correct encoding for the output is used. Related: pydata/xarray#7127
Yes this is right. It would be nice to point this out in the docstring. |
dcherian
added
topic-documentation
and removed
bug
needs triage
Issue that has not been reviewed by xarray team member
labels
Jan 15, 2023
dcherian
changed the title
Dtype changes if any encoding is given in
Document that Jan 15, 2023
to_netcdf
Variable.encoding
is ignored if encoding is given in to_netcdf
vallirep
added a commit
to vallirep/xarray
that referenced
this issue
Jun 27, 2023
1 task
dcherian
added a commit
that referenced
this issue
Jul 21, 2023
* improved docstring of to_netcdf (issue #7127) * Spelling * Update xarray/core/dataset.py --------- Co-authored-by: Tom Nicholas <[email protected]> Co-authored-by: Deepak Cherian <[email protected]>
dcherian
added a commit
to dcherian/xarray
that referenced
this issue
Jul 24, 2023
…lazy-array * upstream/main: (153 commits) Add HDF5 Section to read/write docs page (pydata#8012) [pre-commit.ci] pre-commit autoupdate (pydata#8014) Update interpolate_na in dataset.py (pydata#7974) improved docstring of to_netcdf (issue pydata#7127) (pydata#7947) Expose "Coordinates" as part of Xarray's public API (pydata#7368) Core team member guide (pydata#7999) join together duplicate entries in the text `repr` (pydata#7225) Update copyright year in README (pydata#8007) Allow opening datasets with nD dimenson coordinate variables. (pydata#7989) Move whats-new entry [pre-commit.ci] pre-commit autoupdate (pydata#7997) Add documentation on custom indexes (pydata#6975) Use variable name in all exceptions raised in `as_variable` (pydata#7995) Bump pypa/gh-action-pypi-publish from 1.8.7 to 1.8.8 (pydata#7994) New whatsnew section Remove future release notes before this release Update whats-new.rst for new release (pydata#7993) Remove hue_style from plot1d docstring (pydata#7925) Add new what's new section (pydata#7986) Release summary for v2023.07.0 (pydata#7979) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
With a change from xarray version
2022.06.0
to2022.09.0
the following output is no longer written asfloat32
butfloat64
.What did you expect to happen?
I expected the output to have the same
dtype
.Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
In addition to the change of
dtype
fromfloat
todouble
, I wonder if both outputs should actually rather beint16
, because this is thedtype
of the original dataset:Sorry for mixing an issue with a question, but why is the
add_offset
andscale_factor
applied and the values saved asfloat32/float64
in caseencoding
is set? I guessencoding
into_netcdf
is overwriting the initial encoding, becauseproduces the expected output that matches the original one. So I imagine, a good way of setting the output encoding is currently something like
in case an encoding similar to the input encoding - with additional parameters (e.g. 'zlib') - is requested.
Environment
xarray: 2022.6.0. # or 2022.9.0
pandas: 1.5.0
numpy: 1.23.3
scipy: None
netCDF4: 1.6.1
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.13.2
cftime: 1.6.2
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 65.4.1
pip: 22.2.2
conda: None
pytest: None
IPython: 8.3.0
sphinx: None
The text was updated successfully, but these errors were encountered: