-
-
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
polyval
with timedelta64 coordinates produces wrong results
#6597
Comments
As listed in breaking changes, the new polyval algorithm uses the values of the Your coordinate is a Timedelta |
Thanks - I think I might be misunderstanding how the new implementation works. xr.polyval(values - values[0], polyfit_coefficients)
xr.polyval(azimuth_time.coords["azimuth_time"], polyfit_coefficients)
|
Ok, the first idea does not work since values is a numpy array. The second idea should work, so this is a bug. |
What happened?
I'm not sure if this is a bug or an expected breaking change, but I'm not able to reproduce the results generated by
polyval
using a timedelta64 coordinate. The results are correct inxarray=2022.3.0
, whereas they are wrong in the latest unreleased version (main
,commit 6bb2b855498b5c68d7cca8cceb710365d58e604
).What did you expect to happen?
Both the stable and latest
polyval
functions should return the same results.Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
No response
Environment
INSTALLED VERSIONS
commit: None
python: 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:43:32) [Clang 12.0.1 ]
python-bits: 64
OS: Darwin
OS-release: 21.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None
LOCALE: (None, 'UTF-8')
libhdf5: None
libnetcdf: None
xarray: 2022.3.0 or 2022.3.1.dev102+g6bb2b855
pandas: 1.4.2
numpy: 1.22.3
scipy: 1.8.0
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.11.3
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: 1.2.10
cfgrib: None
iris: None
bottleneck: None
dask: 2022.05.0
distributed: 2022.5.0
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
fsspec: 2022.3.0
cupy: None
pint: None
sparse: None
setuptools: 62.2.0
pip: 22.1
conda: None
pytest: 7.1.2
IPython: None
sphinx: None
The text was updated successfully, but these errors were encountered: