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 2141447815,I_kwDOAMm_X85_o-aH,8768,`xarray/datatree_` missing in 2024.2.0 sdist,110765,closed,0,,,15,2024-02-19T03:57:31Z,2024-04-23T18:11:58Z,2024-04-23T15:35:21Z,CONTRIBUTOR,,,,"### What happened? Apparently `xarray-2024.2.0` requires `xarray.datatree_` module but this module isn't included in sdist tarball. ### What did you expect to happen? _No response_ ### Minimal Complete Verifiable Example ```Python $ tar -tf /tmp/dist/xarray-2024.2.0.tar.gz | grep datatree_ (empty) ``` ### MVCE confirmation - [ ] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray. - [ ] Complete example — the example is self-contained, including all data and the text of any traceback. - [ ] Verifiable example — the example copy & pastes into an IPython prompt or [Binder notebook](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/blank_template.ipynb), returning the result. - [ ] New issue — a search of GitHub Issues suggests this is not a duplicate. - [ ] Recent environment — the issue occurs with the latest version of xarray and its dependencies. ### Relevant log output _No response_ ### Anything else we need to know? _No response_ ### Environment n/a","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8768/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 2109799517,PR_kwDOAMm_X85ljgaW,8686,Fixes for pytest-8.0.0 compatibility,110765,closed,0,,,4,2024-01-31T10:39:25Z,2024-01-31T17:15:48Z,2024-01-31T16:53:45Z,CONTRIBUTOR,,0,pydata/xarray/pulls/8686,"Two fixes for compatibility with pytest 8.0.0: 1. Removed `pytest.warns()` inside `pytest.raises()` where no warnings are actually raised. 2. Cleared recorded warnings after `pytest.warns()` invocation where the function expected all warnings to be captured. Explained in detail in commit messages. - [x] Closes #8681 - [ ] Tests added - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8686/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 941808931,MDU6SXNzdWU5NDE4MDg5MzE=,5593,TestDataset.test_resample_loffset fails (due to precision?) on i686,110765,open,0,,,0,2021-07-12T08:32:00Z,2023-11-02T04:38:35Z,,CONTRIBUTOR,,,,"**What happened**: The test suite failed: ```pytb =================================== FAILURES =================================== ______________________ TestDataset.test_resample_loffset _______________________ self = def test_resample_loffset(self): times = pd.date_range(""2000-01-01"", freq=""6H"", periods=10) ds = Dataset( { ""foo"": ([""time"", ""x"", ""y""], np.random.randn(10, 5, 3)), ""bar"": (""time"", np.random.randn(10), {""meta"": ""data""}), ""time"": times, } ) ds.attrs[""dsmeta""] = ""dsdata"" # Our use of `loffset` may change if we align our API with pandas' changes. # ref https://github.com/pydata/xarray/pull/4537 actual = ds.resample(time=""24H"", loffset=""-12H"").mean().bar expected_ = ds.bar.to_series().resample(""24H"").mean() expected_.index += to_offset(""-12H"") expected = DataArray.from_series(expected_) > assert_identical(actual, expected) E AssertionError: Left and right DataArray objects are not identical E E Differing values: E L E array([ 0.018477, -0.178807, -0.792644]) E R E array([ 0.018477, -0.178807, -0.792644]) actual = array([ 0.01847694, -0.1788066 , -0.79264435]) Coordinates: * time (time) datetime64[ns] 1999-12-31T12:00:00 ... 2000-01-02T12:00:00 ds = Dimensions: (time: 10, x: 5, y: 3) Coordinates: * time (time) datetime64[ns] 2000-01-01 ... 2000-01-03T06:00:00 Dimensions without coordinates: x, y Data variables: foo (time, x, y) float64 1.764 0.4002 0.9787 ... 1.117 -1.316 -0.4616 bar (time) float64 -0.06824 1.713 -0.7448 ... -1.08 -1.147 -0.4378 Attributes: dsmeta: dsdata expected = array([ 0.01847694, -0.1788066 , -0.79264435]) Coordinates: * time (time) datetime64[ns] 1999-12-31T12:00:00 ... 2000-01-02T12:00:00 expected_ = time 1999-12-31 12:00:00 0.018477 2000-01-01 12:00:00 -0.178807 2000-01-02 12:00:00 -0.792644 Freq: 24H, Name: bar, dtype: float64 self = times = DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 06:00:00', '2000-01-01 12:00:00', '2000-01-01 18:00:00', '2000-01-02 00:00:00', '2000-01-02 06:00:00', '2000-01-02 12:00:00', '2000-01-02 18:00:00', '2000-01-03 00:00:00', '2000-01-03 06:00:00'], dtype='datetime64[ns]', freq='6H') /var/tmp/portage/dev-python/xarray-0.18.2-r1/work/xarray-0.18.2/xarray/tests/test_dataset.py:3991: AssertionError =============================== warnings summary =============================== ``` **What you expected to happen**: Test suite passing ;-). **Minimal Complete Verifiable Example**: n/a (xarray test suite problem) **Anything else we need to know?**: This happens on 32-bit i686 system but not on amd64. I suppose it's a precision problem. **Environment**:
Output of xr.show_versions() ``` INSTALLED VERSIONS ------------------ commit: None python: 3.9.5 (default, Jun 13 2021, 01:01:34) [GCC 10.3.0] python-bits: 32 OS: Linux OS-release: 4.14.34-gentoo-infra38 machine: i686 processor: Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz byteorder: little LC_ALL: None LANG: en_US.utf8 LOCALE: ('en_US', 'UTF-8') libhdf5: None libnetcdf: None xarray: 0.18.2 pandas: 1.2.3 numpy: 1.20.2 scipy: 1.6.2 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: 1.3.2 dask: None distributed: None matplotlib: None cartopy: None seaborn: None numbagg: None pint: None setuptools: 57.0.0 pip: None conda: None pytest: None IPython: None sphinx: None ```
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5593/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 1858211666,I_kwDOAMm_X85uwg9S,8092,xarray/tests/test_dask.py::TestToDaskDataFrame::test_to_dask_dataframe_* test failures when dask+pyarrow are installed,110765,open,0,,,0,2023-08-20T17:45:57Z,2023-08-20T17:45:57Z,,CONTRIBUTOR,,,,"### What happened? When running the test suite in an environment where both `dask` and `pyarrow` are installed, two tests fail (log below): ``` FAILED xarray/tests/test_dask.py::TestToDaskDataFrame::test_to_dask_dataframe_2D - AssertionError: Attributes of DataFrame.iloc[:, 1] (column name=""y"") are different FAILED xarray/tests/test_dask.py::TestToDaskDataFrame::test_to_dask_dataframe_not_daskarray - AssertionError: DataFrame.index are different ``` ### What did you expect to happen? Tests passing ;-). ### Minimal Complete Verifiable Example ```Python pip install . pytest 'dask[complete]' python -m pytest xarray/tests/test_dask.py ``` ### MVCE confirmation - [ ] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray. - [X] Complete example — the example is self-contained, including all data and the text of any traceback. - [X] Verifiable example — the example copy & pastes into an IPython prompt or [Binder notebook](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/blank_template.ipynb), returning the result. - [X] New issue — a search of GitHub Issues suggests this is not a duplicate. ### Relevant log output ```Python ____________________________________________ TestToDaskDataFrame.test_to_dask_dataframe_2D ____________________________________________ self = def test_to_dask_dataframe_2D(self): # Test if 2-D dataset is supplied w = np.random.randn(2, 3) ds = Dataset({""w"": ((""x"", ""y""), da.from_array(w, chunks=(1, 2)))}) ds[""x""] = (""x"", np.array([0, 1], np.int64)) ds[""y""] = (""y"", list(""abc"")) # dask dataframes do not (yet) support multiindex, # but when it does, this would be the expected index: exp_index = pd.MultiIndex.from_arrays( [[0, 0, 0, 1, 1, 1], [""a"", ""b"", ""c"", ""a"", ""b"", ""c""]], names=[""x"", ""y""] ) expected = pd.DataFrame({""w"": w.reshape(-1)}, index=exp_index) # so for now, reset the index expected = expected.reset_index(drop=False) actual = ds.to_dask_dataframe(set_index=False) assert isinstance(actual, dd.DataFrame) > assert_frame_equal(expected, actual.compute()) E AssertionError: Attributes of DataFrame.iloc[:, 1] (column name=""y"") are different E E Attribute ""dtype"" are different E [left]: object E [right]: string[pyarrow] /tmp/xarray/xarray/tests/test_dask.py:822: AssertionError ______________________________________ TestToDaskDataFrame.test_to_dask_dataframe_not_daskarray _______________________________________ self = def test_to_dask_dataframe_not_daskarray(self): # Test if DataArray is not a dask array x = np.random.randn(10) y = np.arange(10, dtype=""uint8"") t = list(""abcdefghij"") ds = Dataset({""a"": (""t"", x), ""b"": (""t"", y), ""t"": (""t"", t)}) expected = pd.DataFrame({""a"": x, ""b"": y}, index=pd.Index(t, name=""t"")) actual = ds.to_dask_dataframe(set_index=True) assert isinstance(actual, dd.DataFrame) > assert_frame_equal(expected, actual.compute()) /tmp/xarray/xarray/tests/test_dask.py:867: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ left = Index(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'], dtype='object', name='t') right = Index(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'], dtype='string', name='t'), obj = 'DataFrame.index' def _check_types(left, right, obj: str = ""Index"") -> None: if not exact: return assert_class_equal(left, right, exact=exact, obj=obj) assert_attr_equal(""inferred_type"", left, right, obj=obj) # Skip exact dtype checking when `check_categorical` is False if is_categorical_dtype(left.dtype) and is_categorical_dtype(right.dtype): if check_categorical: assert_attr_equal(""dtype"", left, right, obj=obj) assert_index_equal(left.categories, right.categories, exact=exact) return > assert_attr_equal(""dtype"", left, right, obj=obj) E AssertionError: DataFrame.index are different E E Attribute ""dtype"" are different E [left]: object E [right]: string[pyarrow] /tmp/xarray/.venv/lib/python3.11/site-packages/pandas/_testing/asserters.py:250: AssertionError ``` ### Anything else we need to know? _No response_ ### Environment
``` INSTALLED VERSIONS ------------------ commit: 83c2919b27b4b2d8a01bfa380226134c71321aa0 python: 3.11.4 (main, Jun 8 2023, 06:01:19) [GCC 13.1.1 20230527] python-bits: 64 OS: Linux OS-release: 6.4.7-gentoo-dist machine: x86_64 processor: AMD Ryzen 5 3600 6-Core Processor byteorder: little LC_ALL: None LANG: pl_PL.UTF-8 LOCALE: ('pl_PL', 'UTF-8') libhdf5: None libnetcdf: None xarray: 2023.8.0 pandas: 2.0.3 numpy: 1.25.2 scipy: None netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None iris: None bottleneck: None dask: 2023.8.1 distributed: 2023.8.1 matplotlib: None cartopy: None seaborn: None numbagg: None fsspec: 2023.6.0 cupy: None pint: None sparse: None flox: None numpy_groupies: None setuptools: 68.1.2 pip: 23.2.1 conda: None pytest: 7.4.0 mypy: None IPython: None sphinx: None ```
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8092/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue