issues: 1303640708
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1303640708 | I_kwDOAMm_X85Ns_qE | 6782 | xr.apply_ufunc: apply_variable_ufunc can get called again because of existing reference | 2129135 | closed | 0 | 2 | 2022-07-13T15:58:09Z | 2022-07-13T16:17:42Z | 2022-07-13T16:03:18Z | NONE | What happened?I wrapped When then using this value in combination with my result from the call to What did you expect to happen?It should not call Minimal Complete Verifiable Example```Python import xarray as xr import numpy as np def fft( a: xr.DataArray, dim: str, newdim: str, n: int = None, norm: str = None, keep_attrs=None, ) -> xr.DataArray:
duration = 10.0 fs = 8000.0 nsamples = int(fs * duration) f = 100.0 A = 2.0 n = 100 dim = "time" newdim = "frequency" signal = A * np.sin(2.0 * np.pi * f * np.arange(nsamples) / fs) signal = xr.DataArray(signal, dims=[dim], coords={dim: np.arange(nsamples)}).expand_dims("channel") result = fft(signal, n=n, dim=dim, newdim=newdim) ``` MVCE confirmation
Relevant log output```Python ======================================================================================================================================== FAILURES ========================================================================================================================================= ___________________ testfft _____________________
tests/test_signal.py:323: xarray_scipy/signal.py:187: in fft result[newdim] = np.fft.fftfreq(n, delta) /nix/store/9mr36pjhxnlvdy00njp8dj22rd7n3yg3-python3-3.10.5-env/lib/python3.10/site-packages/numpy/fft/helper.py:169: in fftfreq return results * val ../xarray/xarray/core/arithmetic.py:70: in array_ufunc return apply_ufunc( ../xarray/xarray/core/computation.py:1132: in apply_ufunc return apply_dataarray_vfunc( ../xarray/xarray/core/computation.py:271: in apply_dataarray_vfunc result_var = func(*data_vars) func = <ufunc 'multiply'>, signature = _UFuncSignature([(), ()], [()]), exclude_dims = frozenset(), dask = 'allowed', output_dtypes = None
../xarray/xarray/core/computation.py:746: ValueError ``` Anything else we need to know?No response Environment
In [2]: xr.show_versions()
/nix/store/9mr36pjhxnlvdy00njp8dj22rd7n3yg3-python3-3.10.5-env/lib/python3.10/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
INSTALLED VERSIONS
------------------
commit: None
python: 3.10.5 (main, Jun 6 2022, 12:05:50) [GCC 11.3.0]
python-bits: 64
OS: Linux
OS-release: 5.15.43
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: None
libnetcdf: None
xarray: 2022.3.0
pandas: 1.4.2
numpy: 1.21.6
scipy: 1.8.0
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 2022.05.2
distributed: None
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
fsspec: 2022.5.0
cupy: None
pint: None
sparse: None
setuptools: 61.2.0.post0
pip: None
conda: None
pytest: 7.1.1
IPython: 8.4.0
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6782/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |