home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

19,901 rows where author_association = "MEMBER" sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user >30

  • shoyer 5,143
  • dcherian 2,724
  • max-sixty 2,489
  • keewis 1,740
  • jhamman 1,180
  • mathause 781
  • rabernat 731
  • fmaussion 690
  • TomNicholas 591
  • fujiisoup 539
  • benbovy 523
  • crusaderky 488
  • Illviljan 466
  • kmuehlbauer 457
  • spencerkclark 438
  • mrocklin 284
  • andersy005 221
  • alexamici 125
  • clarkfitzg 124
  • TomAugspurger 52
  • hameerabbasi 27
  • scottyhq 26
  • takluyver 17
  • jreback 15
  • choldgraf 10
  • JessicaS11 7
  • chris-b1 3
  • femtotrader 3
  • aterrel 2
  • teoliphant 1
  • …

issue >30

  • WIP: Zarr backend 71
  • CFTimeIndex 62
  • ENH: use `dask.array.apply_gufunc` in `xr.apply_ufunc` 62
  • WIP: indexing with broadcasting 60
  • release v0.18.0 59
  • Multidimensional groupby 56
  • Explicit indexes in xarray's data-model (Future of MultiIndex) 53
  • implement interp() 49
  • Hooks for XArray operations 46
  • merge scipy19 docs 45
  • Explicit indexes 44
  • 0.13.0 release 41
  • Integration with dask/distributed (xarray backend design) 38
  • html repr of xarray object (for the notebook) 37
  • tests for arrays with units 37
  • Feature Request: Hierarchical storage and processing in xarray 37
  • Add an example of ERA5 and GRIB data & visualization to the gallery 34
  • FIX: correct dask array handling in _calc_idxminmax 34
  • Add support for cross product 34
  • faceted plots 33
  • fix distributed writes 33
  • Silence sphinx warnings 32
  • support for units 31
  • WIP: Optional indexes (no more default coordinates given by range(n)) 31
  • WIP: html repr 31
  • New function for applying vectorized functions for unlabeled arrays to xarray objects 30
  • Add RasterIO backend 30
  • why time grouping doesn't preserve chunks 30
  • API design for pointwise indexing 28
  • allow passing coordinate names as x and y to plot methods 28
  • …

author_association 1

  • MEMBER · 19,901 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1280906370 https://github.com/pydata/xarray/pull/7173#issuecomment-1280906370 https://api.github.com/repos/pydata/xarray/issues/7173 IC_kwDOAMm_X85MWRSC Illviljan 14371165 2022-10-17T13:57:47Z 2024-03-20T23:12:49Z MEMBER

Scatter vs. Lines:

```python ds = xr.tutorial.scatter_example_dataset(seed=42) hue_ = "y" x_ = "y" size_="y" z_ = "z" fig = plt.figure() ax = fig.add_subplot(1, 2, 1, projection='3d') ds.A.sel(w="one").plot.lines(x=x_, z=z_, hue=hue_, linewidth=size_, ax=ax) ax = fig.add_subplot(1, 2, 2, projection='3d') ds.A.sel(w="one").plot.scatter(x=x_, z=z_, hue=hue_, markersize=size_, ax=ax) ```
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add LineCollection plot 1410608825
285380106 https://github.com/pydata/xarray/issues/1303#issuecomment-285380106 https://api.github.com/repos/pydata/xarray/issues/1303 MDEyOklzc3VlQ29tbWVudDI4NTM4MDEwNg== rabernat 1197350 2017-03-09T15:18:18Z 2024-02-06T17:57:21Z MEMBER

Just wanted to link to a somewhat related discussion happening in brian-rose/climlab#50.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `xarray.core.variable.as_variable()` part of the public API? 213004586
732361140 https://github.com/pydata/xarray/issues/4601#issuecomment-732361140 https://api.github.com/repos/pydata/xarray/issues/4601 MDEyOklzc3VlQ29tbWVudDczMjM2MTE0MA== max-sixty 5635139 2020-11-23T19:00:30Z 2023-09-24T19:44:17Z MEMBER

Great observation @mathause . I think there are two parts of this: - Do we want other libraries which do da.longitude to raise a mypy error? That may be a tradeoff with raising the true error on da.isel - How do we design the type hierarchy? We could add methods to DataWithCoords or add some Dataset_Or_DataArray-like type

Having methods like isel typed would be a win I think

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Don't type check __getattr__? 748684119
732472373 https://github.com/pydata/xarray/issues/4601#issuecomment-732472373 https://api.github.com/repos/pydata/xarray/issues/4601 MDEyOklzc3VlQ29tbWVudDczMjQ3MjM3Mw== max-sixty 5635139 2020-11-23T22:51:38Z 2023-09-24T19:36:02Z MEMBER

Good point re accessors, I hadn't considered those. So sounds like raising an error on da.isel isn't possible regardless...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Don't type check __getattr__? 748684119
1259228475 https://github.com/pydata/xarray/issues/6293#issuecomment-1259228475 https://api.github.com/repos/pydata/xarray/issues/6293 IC_kwDOAMm_X85LDk07 benbovy 4160723 2022-09-27T09:22:04Z 2023-08-24T11:42:53Z MEMBER

Following thoughts and discussions in various issues (e.g., #6836), I'd like to suggest another section to the ones in the top comment:

Deprecate pandas.MultiIndex special cases in Xarray

  • remove the multi-index “dimension” coordinate (tuple elements)
  • do not automatically promote pandas.MultiIndex objects as dimension + level coordinates, e.g., like in xr.Dataset(coords={“x”: pd_midx}) but instead treat it as a single duck-array.
  • do not accept pandas.MultiIndex as dim argument in xarray.concat() (#7148)
  • remove obj.to_index() for all xarray objects?
  • (EDIT) remove Dataset.reset_index() and DataArray.reset_index()

They are source of many problems and complexities in Xarray internals (many regressions reported since the index refactor were related to those special cases) and I'm not sure that the value they add is really worth the trouble. Also, in the long term the special treatment of PandasMultiIndex vs. other Xarray multi-indexes may add some confusion.

Some of those features are widely used (e.g., the creation of Dataset / DataArray from pandas multi-indexes is used in many places in unit tests), so we would need convenient alternatives and a smooth transition.

{
    "total_count": 5,
    "+1": 5,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Explicit indexes: next steps 1148021907
1578775636 https://github.com/pydata/xarray/pull/7862#issuecomment-1578775636 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85eGjRU kmuehlbauer 5821660 2023-06-06T13:30:15Z 2023-06-06T13:30:15Z MEMBER

Might be worth an issue over at numpy with the example from the test.

numpy/numpy#23886

The issue is already resolved over at numpy which is really great! It was also marked as backport. @headtr1ck How are these issues resolved currently or how do we track removing the ignore?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1578248748 https://github.com/pydata/xarray/pull/7862#issuecomment-1578248748 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85eEios kmuehlbauer 5821660 2023-06-06T09:04:39Z 2023-06-06T09:04:39Z MEMBER

Might be worth an issue over at numpy with the example from the test.

https://github.com/numpy/numpy/issues/23886

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1577838062 https://github.com/pydata/xarray/pull/7888#issuecomment-1577838062 https://api.github.com/repos/pydata/xarray/issues/7888 IC_kwDOAMm_X85eC-Xu dcherian 2448579 2023-06-06T03:20:39Z 2023-06-06T03:20:39Z MEMBER

Should we delete the cfgrib example instead?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add cfgrib,ipywidgets to doc env 1736542260
1577827466 https://github.com/pydata/xarray/issues/7841#issuecomment-1577827466 https://api.github.com/repos/pydata/xarray/issues/7841 IC_kwDOAMm_X85eC7yK dcherian 2448579 2023-06-06T03:05:47Z 2023-06-06T03:05:47Z MEMBER

https://github.com/corteva/rioxarray/issues/676

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Xarray docs showing tracebacks instead of plots 1709215291
1577474914 https://github.com/pydata/xarray/issues/7894#issuecomment-1577474914 https://api.github.com/repos/pydata/xarray/issues/7894 IC_kwDOAMm_X85eBlti dcherian 2448579 2023-06-05T21:05:47Z 2023-06-05T21:05:57Z MEMBER

but is it not possible for it to calculate the integrated values where there were regular values?

@chfite Can you provide an example of what you would want it to do please

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Can a "skipna" argument be added for Dataset.integrate() and DataArray.integrate()? 1742035781
1576080083 https://github.com/pydata/xarray/issues/7866#issuecomment-1576080083 https://api.github.com/repos/pydata/xarray/issues/7866 IC_kwDOAMm_X85d8RLT kmuehlbauer 5821660 2023-06-05T05:45:30Z 2023-06-05T05:45:30Z MEMBER

@vrishk Sorry for the delay here and thanks for bringing this to attention. We now have at least two requests which might move this forward (moving ensure_dtype_not_object into the backends). But this would need some discussion first, how to do this.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Enable object_codec in zarr backend 1720924071
1576074048 https://github.com/pydata/xarray/issues/7892#issuecomment-1576074048 https://api.github.com/repos/pydata/xarray/issues/7892 IC_kwDOAMm_X85d8PtA kmuehlbauer 5821660 2023-06-05T05:37:32Z 2023-06-05T05:37:32Z MEMBER

@mktippett Thanks for raising this. The issue should be cleared after #7888 is merged.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  GRIB Data Example is broken 1740685974
1575756825 https://github.com/pydata/xarray/pull/7891#issuecomment-1575756825 https://api.github.com/repos/pydata/xarray/issues/7891 IC_kwDOAMm_X85d7CQZ Illviljan 14371165 2023-06-04T22:29:18Z 2023-06-04T22:29:18Z MEMBER

You could use DataArray.round to round to significant decimals.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add errors option to curvefit 1740268634
1575671448 https://github.com/pydata/xarray/pull/7889#issuecomment-1575671448 https://api.github.com/repos/pydata/xarray/issues/7889 IC_kwDOAMm_X85d6taY andersy005 13301940 2023-06-04T18:46:09Z 2023-06-04T18:46:09Z MEMBER

Thank you @keewis

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  retire the TestPyPI workflow 1738586208
1574365471 https://github.com/pydata/xarray/issues/7890#issuecomment-1574365471 https://api.github.com/repos/pydata/xarray/issues/7890 IC_kwDOAMm_X85d1ukf dcherian 2448579 2023-06-02T22:04:33Z 2023-06-02T22:04:33Z MEMBER

I think the only other one is dask, which should also work.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `xarray.rolling_window` Converts `dims` Argument from Tuple to List Causing Issues for Cupy-Xarray 1738835134
1574331034 https://github.com/pydata/xarray/issues/7890#issuecomment-1574331034 https://api.github.com/repos/pydata/xarray/issues/7890 IC_kwDOAMm_X85d1mKa dcherian 2448579 2023-06-02T21:23:25Z 2023-06-02T21:27:06Z MEMBER

This seems like a real easy fix? axis = tuple(self.get_axis_num(d) for d in dim)

EDIT: the Array API seems to type axis as Optional[Union[int, Tuple[int, ...]]] pretty consistently, so it seems like we should always pass tuples down to the array library

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `xarray.rolling_window` Converts `dims` Argument from Tuple to List Causing Issues for Cupy-Xarray 1738835134
1574264842 https://github.com/pydata/xarray/pull/7862#issuecomment-1574264842 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85d1WAK dcherian 2448579 2023-06-02T20:14:33Z 2023-06-02T20:14:48Z MEMBER

xarray/tests/test_coding_strings.py:36: error: No overload variant of "dtype" matches argument types "str", "Dict[str, Type[str]]" [call-overload]

cc @Illviljan @headtr1ck

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1572412059 https://github.com/pydata/xarray/pull/7880#issuecomment-1572412059 https://api.github.com/repos/pydata/xarray/issues/7880 IC_kwDOAMm_X85duRqb shoyer 1217238 2023-06-01T16:51:07Z 2023-06-01T17:10:49Z MEMBER

Given that this error only is caused when Python is shutting down, which is exactly a case in which we do not need to clean up open file objects, maybe we can remove the __del__ instead?

Something like: ```python import atexit

@atexit.register def _remove_del_method(): # We don't need to close unclosed files at program exit, # and may not be able to do, because Python is cleaning up # imports. del CachingFileManager.del ```

(I have not tested this!)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  don't use `CacheFileManager.__del__` on interpreter shutdown 1730664352
1572437423 https://github.com/pydata/xarray/pull/7880#issuecomment-1572437423 https://api.github.com/repos/pydata/xarray/issues/7880 IC_kwDOAMm_X85duX2v keewis 14808389 2023-06-01T17:01:56Z 2023-06-01T17:06:06Z MEMBER

that appears to work on both my laptop and my local HPC, and is arguably a lot easier to implement / understand as we don't need to make sure all the globals we use are still available (which in this case would be acquire, OPTIONS, warnings, and RuntimeWarning).

Edit: let me change the PR to do that instead

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  don't use `CacheFileManager.__del__` on interpreter shutdown 1730664352
1572384036 https://github.com/pydata/xarray/pull/7880#issuecomment-1572384036 https://api.github.com/repos/pydata/xarray/issues/7880 IC_kwDOAMm_X85duK0k keewis 14808389 2023-06-01T16:38:23Z 2023-06-01T16:54:08Z MEMBER

Have you verfied that this fixes things at least on your machine?

I thought I did, but apparently something changed: right now it fails because OPTIONS is not available anymore, so we might have to add a reference to that, as well. Additionally, for the warning we use warnings.warn and RuntimeWarning that might also have disappeared already (but those are standard library / builtins, so hopefully not?)

In any case, you can verify this, too: - create a new environment using mamba create -n test python=3.11 numpy pandas packaging pooch netcdf4 and activate it - run pip install 'dask[array]' to install dask without distributed (this appears to make a difference for me, not sure if that's the same elsewhere) - editable-install xarray so we can easily switch between branches - run python -c 'import xarray as xr; ds = xr.tutorial.open_dataset("air_temperature", chunks={})'

This should print an error for main and shouldn't with this branch (confirmed on my local HPC).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  don't use `CacheFileManager.__del__` on interpreter shutdown 1730664352
1572363440 https://github.com/pydata/xarray/pull/7880#issuecomment-1572363440 https://api.github.com/repos/pydata/xarray/issues/7880 IC_kwDOAMm_X85duFyw keewis 14808389 2023-06-01T16:26:42Z 2023-06-01T16:26:42Z MEMBER

the issue is that this doesn't occur on normal garbage collection but only on interpreter shutdown. So really, I don't think we have any way to test this using pytest as that itself is written in python (unless of course we can make use of sub-interpreters, but that might be more trouble than it's worth).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  don't use `CacheFileManager.__del__` on interpreter shutdown 1730664352
1572350143 https://github.com/pydata/xarray/pull/7880#issuecomment-1572350143 https://api.github.com/repos/pydata/xarray/issues/7880 IC_kwDOAMm_X85duCi_ shoyer 1217238 2023-06-01T16:16:40Z 2023-06-01T16:16:40Z MEMBER

I agree that this seems very hard to test!

Have you verfied that this fixes things at least on your machine?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  don't use `CacheFileManager.__del__` on interpreter shutdown 1730664352
1572306481 https://github.com/pydata/xarray/pull/7883#issuecomment-1572306481 https://api.github.com/repos/pydata/xarray/issues/7883 IC_kwDOAMm_X85dt34x dcherian 2448579 2023-06-01T15:49:42Z 2023-06-01T15:49:42Z MEMBER

Hmmm ndim is in the array api so potentially we could just update the test.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Avoid one call to len when getting ndim of Variables 1731320789
1572276996 https://github.com/pydata/xarray/issues/7884#issuecomment-1572276996 https://api.github.com/repos/pydata/xarray/issues/7884 IC_kwDOAMm_X85dtwsE dcherian 2448579 2023-06-01T15:30:26Z 2023-06-01T15:30:26Z MEMBER

Please ask over at the cfgrib repo. But it does look like a bad environment / bad install.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Reading .grib files with xarray 1732510720
1572021301 https://github.com/pydata/xarray/pull/7862#issuecomment-1572021301 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85dsyQ1 kmuehlbauer 5821660 2023-06-01T13:06:32Z 2023-06-01T13:06:32Z MEMBER

@tomwhite I've added tests to check the backend code for vlen string dtype metadadata. Also had to add specific check for the h5py vlen string metadata. I think we've covered everything for the proposed change to allow empty vlen strings dtype metadata.

I'm looking at the mypy error and do not have the slightest clue what and where to change. Any help appreciated.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1571698855 https://github.com/pydata/xarray/issues/7887#issuecomment-1571698855 https://api.github.com/repos/pydata/xarray/issues/7887 IC_kwDOAMm_X85drjin keewis 14808389 2023-06-01T09:39:09Z 2023-06-01T09:39:09Z MEMBER

this is #7879 (and thus probably #7079). I suspect our locks are not working properly, but in any case we really should try to fix this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ⚠️ Nightly upstream-dev CI failed ⚠️ 1735219849
1570587416 https://github.com/pydata/xarray/issues/7884#issuecomment-1570587416 https://api.github.com/repos/pydata/xarray/issues/7884 IC_kwDOAMm_X85dnUMY keewis 14808389 2023-05-31T16:56:16Z 2023-05-31T16:58:23Z MEMBER

No module named '_cffi_backend'

Does simply import cfgrib work for you? I suspect it doesn't, which would explain the issue. It's unfortunate that the error is rewritten to "unknown engine", but I'm not sure how we would detect that it's a dependency that fails.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Reading .grib files with xarray 1732510720
1570164833 https://github.com/pydata/xarray/pull/7821#issuecomment-1570164833 https://api.github.com/repos/pydata/xarray/issues/7821 IC_kwDOAMm_X85dltBh Illviljan 14371165 2023-05-31T12:43:30Z 2023-05-31T12:43:30Z MEMBER

Thanks @mgunyho !

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement multidimensional initial guess and bounds for `curvefit` 1698626185
1569021273 https://github.com/pydata/xarray/issues/7884#issuecomment-1569021273 https://api.github.com/repos/pydata/xarray/issues/7884 IC_kwDOAMm_X85dhV1Z keewis 14808389 2023-05-30T20:07:31Z 2023-05-30T20:08:04Z MEMBER

No, this should still work: sh conda create -n test -c conda-forge xarray ipython python=3.11 cfgrib pooch conda activate test ipython ```python import xarray as xr

xr.tutorial.open_dataset("era5-2mt-2019-03-uk.grib") `` We somewhat recently dropped the builtincfgribengine in favor of the one provided by thecfgribpackage (and that is also the reason why the example in the docs fails:cfgrib` is not installed into the docs environment anymore, which is definitely an oversight).

Which version of cfgrib do you have? For reference, in the environment built with the command above I have cfgrib=0.9.10.3

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Reading .grib files with xarray 1732510720
1568728602 https://github.com/pydata/xarray/pull/7876#issuecomment-1568728602 https://api.github.com/repos/pydata/xarray/issues/7876 IC_kwDOAMm_X85dgOYa keewis 14808389 2023-05-30T16:25:25Z 2023-05-30T16:25:25Z MEMBER

great, thanks for the confirmation!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  deprecate the `cdms2` conversion methods 1729709527
1568726002 https://github.com/pydata/xarray/issues/7884#issuecomment-1568726002 https://api.github.com/repos/pydata/xarray/issues/7884 IC_kwDOAMm_X85dgNvy keewis 14808389 2023-05-30T16:23:30Z 2023-05-30T16:23:30Z MEMBER

as stated by the exception, the cfgrib engine is unknown, which usually means you're missing the cfgrib package (or this is a environment issue). If you did indeed install it, can you post the output of either conda list or pip list (in case you're not using conda)?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Reading .grib files with xarray 1732510720
1568557130 https://github.com/pydata/xarray/issues/7871#issuecomment-1568557130 https://api.github.com/repos/pydata/xarray/issues/7871 IC_kwDOAMm_X85dfkhK mathause 10194086 2023-05-30T14:40:50Z 2023-05-30T14:40:50Z MEMBER

I am closing this. Feel free to re-open/ or open a new issue.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Nan Values never get deleted 1723010051
1567446747 https://github.com/pydata/xarray/pull/7880#issuecomment-1567446747 https://api.github.com/repos/pydata/xarray/issues/7880 IC_kwDOAMm_X85dbVbb keewis 14808389 2023-05-29T19:22:12Z 2023-05-29T19:22:12Z MEMBER

I would have thought that the global (or module level here) variable/function aquire should have at least one reference until after the deletion of the object.

I think this is intended (though certainly not very easy to get right): see the second part of the warning in the __del__ documentation.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  don't use `CacheFileManager.__del__` on interpreter shutdown 1730664352
1567366415 https://github.com/pydata/xarray/issues/7879#issuecomment-1567366415 https://api.github.com/repos/pydata/xarray/issues/7879 IC_kwDOAMm_X85dbB0P keewis 14808389 2023-05-29T17:22:09Z 2023-05-29T17:22:09Z MEMBER

If I'm reading the different issues correctly, that means this is a duplicate of #7079

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  occasional segfaults on CI 1730451312
1567154608 https://github.com/pydata/xarray/issues/2697#issuecomment-1567154608 https://api.github.com/repos/pydata/xarray/issues/2697 IC_kwDOAMm_X85daOGw keewis 14808389 2023-05-29T13:41:37Z 2023-05-29T13:41:37Z MEMBER

closing, since anything still missing should be feature requests for xncml

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  read ncml files to create multifile datasets 401874795
1567147143 https://github.com/pydata/xarray/issues/893#issuecomment-1567147143 https://api.github.com/repos/pydata/xarray/issues/893 IC_kwDOAMm_X85daMSH keewis 14808389 2023-05-29T13:33:58Z 2023-05-29T13:34:49Z MEMBER

I think this has been fixed by xncml and/or kerchunk.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  'Warm start' for open_mfdataset? 163267018
1567109753 https://github.com/pydata/xarray/pull/7827#issuecomment-1567109753 https://api.github.com/repos/pydata/xarray/issues/7827 IC_kwDOAMm_X85daDJ5 spencerkclark 6628425 2023-05-29T13:00:30Z 2023-05-29T13:00:30Z MEMBER

One other tricky edge case that occurs to me is one where an extreme fill value (e.g. 1e30) is used for floating point fields. If we decode the times first, it might appear that the dates cannot be represented as nanosecond-precision values, but in reality they would be. We may need to think more about how to handle this edge case in addition to #7817.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Preserve nanosecond resolution when encoding/decoding times 1700227455
1567037851 https://github.com/pydata/xarray/issues/7814#issuecomment-1567037851 https://api.github.com/repos/pydata/xarray/issues/7814 IC_kwDOAMm_X85dZxmb keewis 14808389 2023-05-29T11:53:37Z 2023-05-29T12:10:00Z MEMBER

Actually, it goes away with pip install jinja2. We don't use jinja2 at all, so either this is some kind of weird effect on garbage collection (a timing issue?), or dask is doing something differently as soon as jinja2 is available.

Edit: most likely this is a timing issue... the offending line tries to make use of the internal acquire function, which I think at that point has already been destroyed. To fix that, I think we need to somehow store a reference on the file manager?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  TypeError: 'NoneType' object is not callable when joining netCDF files. Works when ran interactively. 1695028906
1567025628 https://github.com/pydata/xarray/issues/7814#issuecomment-1567025628 https://api.github.com/repos/pydata/xarray/issues/7814 IC_kwDOAMm_X85dZunc keewis 14808389 2023-05-29T11:41:06Z 2023-05-29T11:56:20Z MEMBER

I can reproduce this locally: - download and unpack the files from https://github.com/pydata/xarray/issues/7814#issuecomment-1535168128 - use mamba create -n test python=3.11 xarray netcdf4 to create the environment (note: no dask) - use pip install "dask[array]" to install dask (does not pull distributed like the package from conda-forge) - put the code into a script and execute it

For reference, the full traceback is: pytb Exception ignored in: <function CachingFileManager.__del__ at 0x7fbdb237b430> Traceback (most recent call last): File "/home/jmagin/.local/opt/mambaforge/envs/test/lib/python3.9/site-packages/xarray/backends/file_manager.py", line 246, in __del__ TypeError: 'NoneType' object is not callable

As far as I can tell, this means we're using something from distributed with a broken fallback, since the error goes away as soon as I install distributed.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  TypeError: 'NoneType' object is not callable when joining netCDF files. Works when ran interactively. 1695028906
1563788348 https://github.com/pydata/xarray/pull/7875#issuecomment-1563788348 https://api.github.com/repos/pydata/xarray/issues/7875 IC_kwDOAMm_X85dNYQ8 Illviljan 14371165 2023-05-26T04:17:07Z 2023-05-26T04:18:08Z MEMBER

cos is a float operation so I would lean towards using a isclose-check: xr.testing.assert_allclose(a + 1, np.cos(a)).

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  defer to `numpy` for the expected result 1726529405
1563092362 https://github.com/pydata/xarray/issues/7856#issuecomment-1563092362 https://api.github.com/repos/pydata/xarray/issues/7856 IC_kwDOAMm_X85dKuWK keewis 14808389 2023-05-25T15:19:26Z 2023-05-25T15:19:26Z MEMBER

how did you set up your environment? This works for me: sh mamba create -n test python=3.11 xarray dask netcdf4 pooch ipython mamba activate test ipython python xr.tutorial.open_dataset("rasm", chunks={})

Interestingly enough, though, is that you should only see this with xarray=2023.5.0, while your environment claims to have xarray=2023.4.2. It seems there is something wrong with your environment?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unrecognized chunk manager dask - must be one of: [] 1718410975
1562707652 https://github.com/pydata/xarray/issues/7871#issuecomment-1562707652 https://api.github.com/repos/pydata/xarray/issues/7871 IC_kwDOAMm_X85dJQbE mathause 10194086 2023-05-25T11:02:29Z 2023-05-25T11:02:29Z MEMBER

Yes float64 should cause less imprecision. You can convert using astype:

```python import numpy as np import xarray as xr

da = xr.DataArray(np.array([1, 2], dtype=np.float32))

da = da.astype(float) ```

As for the other problems I think you are better of asking the people over at rioxarray. However, you should first gather all the steps you did to convert the data as code. This way it is easier to see what you are actually doing.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Nan Values never get deleted 1723010051
1562637946 https://github.com/pydata/xarray/issues/7870#issuecomment-1562637946 https://api.github.com/repos/pydata/xarray/issues/7870 IC_kwDOAMm_X85dI_Z6 keewis 14808389 2023-05-25T10:07:35Z 2023-05-25T10:07:35Z MEMBER

I agree, this change should be fine.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Name collision with Pulsar Timing package 'PINT'  1722614979
1562605326 https://github.com/pydata/xarray/issues/7871#issuecomment-1562605326 https://api.github.com/repos/pydata/xarray/issues/7871 IC_kwDOAMm_X85dI3cO mathause 10194086 2023-05-25T09:44:31Z 2023-05-25T09:44:31Z MEMBER

xarray handles nan values and ignores them per default - so you don't need to remove them. For example: ```python import numpy as np import xarray as xr

da = xr.DataArray([1, 2, 3, np.nan]) da.mean() `` If you have precision problems - that might be because you havefloat32` values.

I don't know what goes wrong with your lon values - that is an issue in the reprojection. You could convert them to 0...360 by using

```python

lon_dim = "x" new_lon = np.mod(da[lon_dim], 360) da = da.assign_coords({lon_dim: new_lon}) da.reindex({lon_dim : np.sort(da[lon_dim])})

```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Nan Values never get deleted 1723010051
1561584592 https://github.com/pydata/xarray/issues/7868#issuecomment-1561584592 https://api.github.com/repos/pydata/xarray/issues/7868 IC_kwDOAMm_X85dE-PQ kmuehlbauer 5821660 2023-05-24T16:50:34Z 2023-05-24T16:50:34Z MEMBER

Thanks @ghiggi for your comment.

The problem is we have at least two contradicting user requests here, see #7328 and #7862.

I'm sure there is a solution to accommodate both sides.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `open_dataset` with `chunks="auto"` fails when a netCDF4 variables/coordinates is encoded as `NC_STRING` 1722417436
1561543105 https://github.com/pydata/xarray/issues/7870#issuecomment-1561543105 https://api.github.com/repos/pydata/xarray/issues/7870 IC_kwDOAMm_X85dE0HB TomNicholas 35968931 2023-05-24T16:31:30Z 2023-05-24T16:31:30Z MEMBER

Thanks for raising this @vhaasteren ! We want to do what we can to support users from all fields of science :)

I would be okay with that change (especially as it's not really special-casing pint-pulsar, so much as generalizing an existing error-catching mechanism), but would defer to the opinion of @keewis on this.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Name collision with Pulsar Timing package 'PINT'  1722614979
1561504841 https://github.com/pydata/xarray/issues/7856#issuecomment-1561504841 https://api.github.com/repos/pydata/xarray/issues/7856 IC_kwDOAMm_X85dEqxJ TomNicholas 35968931 2023-05-24T16:16:41Z 2023-05-24T16:26:15Z MEMBER

Solution for those who just found this issue:

Just re-install xarray. pip install -e . is sufficient. Re-installing any way through pip/conda should register the dask chunkmanager entrypoint.


@Illviljan I brought this up in the xarray team call today and we decided that since this only affects people who have previously cloned the xarray repository, are using a development install, and then updated by pulling changes from main; this problem only affects maybe ~10-20 people worldwide, all of whom are developers who are equipped to quickly solve it.

I'm going to add a note into the what's new entry for this version now - if you think we need to do more then let me know.

EDIT: I added a note to whatsnew in https://github.com/pydata/xarray/commit/69445c62953958488a6b35fafd8b9cfd6c0374a5, and updated the release notes.

{
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unrecognized chunk manager dask - must be one of: [] 1718410975
1561302572 https://github.com/pydata/xarray/issues/7873#issuecomment-1561302572 https://api.github.com/repos/pydata/xarray/issues/7873 IC_kwDOAMm_X85dD5Ys jhamman 2443309 2023-05-24T14:47:56Z 2023-05-24T14:47:56Z MEMBER

We dropped Python 3.8 support prior to the Pandas 2 release and have no plans to backport support at this time.

xref: #7765

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 1,
    "eyes": 0
}
  No `Xarray` conda package compatible with pandas>=2 for python 3.8 1724137371
1561285499 https://github.com/pydata/xarray/pull/7862#issuecomment-1561285499 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85dD1N7 kmuehlbauer 5821660 2023-05-24T14:37:58Z 2023-05-24T14:37:58Z MEMBER

Thanks for trying. I can't think of any downsides for the netcdf4-fix, as it just adds the needed metadata to the object-dtype. But you never know, so it would be good to get another set of eyes on it.

So it looks like the changes here with the fix in my branch will get your issue resolved @tomwhite, right?

I'm a bit worried, that this might break other users workflows, if they depend on the current conversion to floating point for some reason. Also other backends might rely on this feature. Especially because this has been there since the early days when xarray was known as xray.

@dcherian What would be the way to go here?

There is also a somehow contradicting issue in #7868.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1561214028 https://github.com/pydata/xarray/issues/7868#issuecomment-1561214028 https://api.github.com/repos/pydata/xarray/issues/7868 IC_kwDOAMm_X85dDjxM kmuehlbauer 5821660 2023-05-24T13:58:16Z 2023-05-24T13:58:16Z MEMBER

My main question here is, why is dask not trying to retrieve the object types from dtype.metadata? Or does it and fail for some reason?.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `open_dataset` with `chunks="auto"` fails when a netCDF4 variables/coordinates is encoded as `NC_STRING` 1722417436
1561195832 https://github.com/pydata/xarray/pull/7862#issuecomment-1561195832 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85dDfU4 kmuehlbauer 5821660 2023-05-24T13:52:04Z 2023-05-24T13:52:04Z MEMBER

@tomwhite I've put a commit with changes to zarr/netcdf4-backends which should preserve the dtype metadata here: https://github.com/kmuehlbauer/xarray/tree/preserve-vlen-string-dtype.

I'm not really sure if that is the right location, but as it was already present that location at netcdf4-backend I think it will do.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1561173824 https://github.com/pydata/xarray/issues/5644#issuecomment-1561173824 https://api.github.com/repos/pydata/xarray/issues/5644 IC_kwDOAMm_X85dDZ9A dcherian 2448579 2023-05-24T13:39:30Z 2023-05-24T13:39:30Z MEMBER

Do you know where the in-place modification is happening? We could just copy there and fix this particular issue.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `polyfit` with weights alters the DataArray in place 955043280
1561162311 https://github.com/pydata/xarray/pull/7862#issuecomment-1561162311 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85dDXJH kmuehlbauer 5821660 2023-05-24T13:32:26Z 2023-05-24T13:32:57Z MEMBER

@tomwhite Special casing on netcdf4 backend should be possible, too.

But it might need fixing at zarr backend, too:

python ds = xr.Dataset({"a": np.array([], dtype=xr.coding.strings.create_vlen_dtype(str))}) print(f"dtype: {ds['a'].dtype}") print(f"metadata: {ds['a'].dtype.metadata}") ds.to_zarr("a.zarr") print("\n### Loading ###") with xr.open_dataset("a.zarr", engine="zarr") as ds: print(f"dtype: {ds['a'].dtype}") print(f"metadata: {ds['a'].dtype.metadata}") ```python dtype: object metadata: {'element_type': <class 'str'>}

Loading

dtype: object metadata: None ```

Could you verify the above example, please? I'm relatively new to zarr :grimacing:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1560777789 https://github.com/pydata/xarray/issues/7871#issuecomment-1560777789 https://api.github.com/repos/pydata/xarray/issues/7871 IC_kwDOAMm_X85dB5Q9 mathause 10194086 2023-05-24T09:32:46Z 2023-05-24T09:32:46Z MEMBER

Yes but there are less - so as mentioned it removes all columns/ rows with only nans, if there is at least one non-nan value the row is kept.

What is the reason that you want to get rid of the nan values?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Nan Values never get deleted 1723010051
1560674198 https://github.com/pydata/xarray/issues/7868#issuecomment-1560674198 https://api.github.com/repos/pydata/xarray/issues/7868 IC_kwDOAMm_X85dBf-W kmuehlbauer 5821660 2023-05-24T08:27:11Z 2023-05-24T08:27:11Z MEMBER

@ghiggi Glad it works, but we still have to check if that is the correct location for the fix, as it's not CF specific.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `open_dataset` with `chunks="auto"` fails when a netCDF4 variables/coordinates is encoded as `NC_STRING` 1722417436
1560587282 https://github.com/pydata/xarray/issues/7871#issuecomment-1560587282 https://api.github.com/repos/pydata/xarray/issues/7871 IC_kwDOAMm_X85dBKwS mathause 10194086 2023-05-24T07:24:37Z 2023-05-24T07:24:37Z MEMBER

Can you try notnull instead of isnull - I often get the boolean array wrong in where:

python da = ds['z'] da = da.where(da.notnull(), drop=True)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Nan Values never get deleted 1723010051
1560572196 https://github.com/pydata/xarray/issues/7871#issuecomment-1560572196 https://api.github.com/repos/pydata/xarray/issues/7871 IC_kwDOAMm_X85dBHEk mathause 10194086 2023-05-24T07:12:28Z 2023-05-24T07:12:28Z MEMBER

What is the reason that you want to get rid of the nan values?

The reason they come back is that are needed to fill the grid again. The dataframe is 1D but the dataarray is 2D.

What you can try is to use where:

python da = ds['z'] da = da.where(da.isnull(), drop=True) but it will only drop the values if the entire row/ column is nan.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Nan Values never get deleted 1723010051
1560559426 https://github.com/pydata/xarray/pull/7862#issuecomment-1560559426 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85dBD9C kmuehlbauer 5821660 2023-05-24T07:01:44Z 2023-05-24T07:01:44Z MEMBER

Thanks @tomwhite for the PR. I've only quickly checked the approach, which looks reasonable. But those changes have implications on several locations of the backend code, which we would have to sort out.

Considering this example:

```python import numpy as np import xarray as xr print(f"creating dataset with empty string array") print("-----------------------------------------") dtype = xr.coding.strings.create_vlen_dtype(str) ds = xr.Dataset({"a": np.array([], dtype=dtype)}) print(f"dtype: {ds['a'].dtype}") print(f"metadata: {ds['a'].dtype.metadata}") ds.to_netcdf("a.nc", engine="netcdf4")

print("\nncdump") print("-------") !ncdump a.nc

engines = ["netcdf4", "h5netcdf"] for engine in engines: with xr.open_dataset("a.nc", engine=engine) as ds: print(f"\nloading with {engine}") print("-------------------") print(f"dtype: {ds['a'].dtype}") print(f"metadata: {ds['a'].dtype.metadata}") ```

```python creating dataset with empty string array


dtype: object metadata: {'element_type': <class 'str'>}

ncdump

netcdf a { dimensions: a = UNLIMITED ; // (0 currently) variables: string a(a) ; data: }

loading with netcdf4

dtype: object metadata: None

loading with h5netcdf

dtype: object metadata: {'vlen': <class 'str'>} ```

Engine netcdf4 does not roundtrip here, losing the dtype metadata information. There is special casing for h5netcdf backend, though.

The source is actually located in open_store_variable of netcdf4 backend, when the underlying data is converted to Variable (which does some object dtype twiddling).

Unfortunately I do not have an immediate solution here.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1560534067 https://github.com/pydata/xarray/issues/7328#issuecomment-1560534067 https://api.github.com/repos/pydata/xarray/issues/7328 IC_kwDOAMm_X85dA9wz kmuehlbauer 5821660 2023-05-24T06:37:39Z 2023-05-24T06:37:39Z MEMBER

@tomwhite Sorry for the delay here. I'll respond shortly on your PR #7862, but we might have to reiterate here later

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Zarr store array dtype changes for empty object string 1466586967
1560225308 https://github.com/pydata/xarray/pull/7865#issuecomment-1560225308 https://api.github.com/repos/pydata/xarray/issues/7865 IC_kwDOAMm_X85c_yYc dcherian 2448579 2023-05-23T22:49:14Z 2023-05-23T22:49:14Z MEMBER

Thanks @martinfleis this is a very valuable contribution to the ecosystem!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Upload nightly wheels to scientific-python-nightly-wheels 1720850091
1560060281 https://github.com/pydata/xarray/pull/7865#issuecomment-1560060281 https://api.github.com/repos/pydata/xarray/issues/7865 IC_kwDOAMm_X85c_KF5 keewis 14808389 2023-05-23T20:11:32Z 2023-05-23T20:11:32Z MEMBER

this appears to have worked. Thanks, @martinfleis!

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 1,
    "eyes": 0
}
  Upload nightly wheels to scientific-python-nightly-wheels 1720850091
1560049420 https://github.com/pydata/xarray/pull/7865#issuecomment-1560049420 https://api.github.com/repos/pydata/xarray/issues/7865 IC_kwDOAMm_X85c_HcM keewis 14808389 2023-05-23T20:02:05Z 2023-05-23T20:02:05Z MEMBER

add the token as a ANACONDA_NIGHTLY secret.

done. Let's try it!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Upload nightly wheels to scientific-python-nightly-wheels 1720850091
1559959581 https://github.com/pydata/xarray/issues/7868#issuecomment-1559959581 https://api.github.com/repos/pydata/xarray/issues/7868 IC_kwDOAMm_X85c-xgd kmuehlbauer 5821660 2023-05-23T18:42:55Z 2023-05-23T19:01:00Z MEMBER

@ghiggi Thanks for getting this back into action. I got dragged away from the one string object issue in #7654. I'll split this out and add a PR.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `open_dataset` with `chunks="auto"` fails when a netCDF4 variables/coordinates is encoded as `NC_STRING` 1722417436
1559973194 https://github.com/pydata/xarray/issues/7868#issuecomment-1559973194 https://api.github.com/repos/pydata/xarray/issues/7868 IC_kwDOAMm_X85c-01K kmuehlbauer 5821660 2023-05-23T18:55:46Z 2023-05-23T18:55:46Z MEMBER

@ghiggi I'd appreciate if you could test your workflows against #7869. Your example and the one over in #7652 are working AFAICT.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `open_dataset` with `chunks="auto"` fails when a netCDF4 variables/coordinates is encoded as `NC_STRING` 1722417436
1559677947 https://github.com/pydata/xarray/pull/7865#issuecomment-1559677947 https://api.github.com/repos/pydata/xarray/issues/7865 IC_kwDOAMm_X85c9sv7 keewis 14808389 2023-05-23T15:33:46Z 2023-05-23T15:33:46Z MEMBER

Do we need to build the wheel in the same way you currently do in [the TestPyPI workflow]

depends on whether we can put local versions on anaconda. PyPI and TestPyPI don't allow that, so we had to modify pyproject.toml to make setuptools-scm generate versions without the local part.

Do you have an account there so I can add you?

now I do, the username is the same as on github.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Upload nightly wheels to scientific-python-nightly-wheels 1720850091
1559210203 https://github.com/pydata/xarray/pull/7867#issuecomment-1559210203 https://api.github.com/repos/pydata/xarray/issues/7867 IC_kwDOAMm_X85c76jb keewis 14808389 2023-05-23T12:33:48Z 2023-05-23T12:33:48Z MEMBER

since the version with cdms2 fails on environment creation we can't really remove the special case for python=3.11 until we reached a decision on what to do with cdms2 support. I'll open a new issue for that, but otherwise this should be ready for merging.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  add `numba` to the py3.11 environment 1721896187
1557705518 https://github.com/pydata/xarray/issues/7863#issuecomment-1557705518 https://api.github.com/repos/pydata/xarray/issues/7863 IC_kwDOAMm_X85c2LMu keewis 14808389 2023-05-22T18:33:15Z 2023-05-22T18:33:15Z MEMBER

I wonder if pure-python projects could get away with asking to install from github? This works today: sh pip install git+https://github.com/pydata/xarray.git and we have been using it downstream in nightly CI.

That said, I can see a central location being helpful, and we'd certainly be happy to add a scheduled github action to upload built packages. We'd need some help with setting that up, though, as I personally don't have any experience whatsoever in uploading to anaconda.org. Do you have documentation/examples on how to do the actual upload?

That would also allow us to stop publishing builds to TestPyPI (not sure if those are nightlies), as that seems to have accumulated quite a few packages already that due to the PyPI policy stay there forever.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Produce nightly wheels 1720191529
1557319228 https://github.com/pydata/xarray/issues/7860#issuecomment-1557319228 https://api.github.com/repos/pydata/xarray/issues/7860 IC_kwDOAMm_X85c0s48 mathause 10194086 2023-05-22T14:25:52Z 2023-05-22T14:25:52Z MEMBER

cc @spencerkclark @znicholls

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  diff of cftime.Datetime 1719805837
1557089270 https://github.com/pydata/xarray/pull/7827#issuecomment-1557089270 https://api.github.com/repos/pydata/xarray/issues/7827 IC_kwDOAMm_X85cz0v2 spencerkclark 6628425 2023-05-22T11:58:18Z 2023-05-22T11:58:18Z MEMBER

Great, yeah, that's a nice example without writing to disk. Indeed I saw those warnings too, but omitted them in my earlier message to focus on the encoding issue (sorry about that). I agree that these are something we should address.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Preserve nanosecond resolution when encoding/decoding times 1700227455
1556891860 https://github.com/pydata/xarray/pull/7827#issuecomment-1556891860 https://api.github.com/repos/pydata/xarray/issues/7827 IC_kwDOAMm_X85czEjU kmuehlbauer 5821660 2023-05-22T09:40:04Z 2023-05-22T09:40:04Z MEMBER

The example below is only based on Variable and the cf encode/decode variable functions.

```python import xarray as xr import numpy as np

create DataArray

times = [np.datetime64("2000-01-01", "ns"), np.datetime64("NaT")] da = xr.DataArray(times, dims=["time"], name="foo") da.encoding["dtype"] = np.float64 da.encoding["_FillValue"] = 20.0

extract Variable

source_var = da.variable print("---------- source_var ------------------") print(source_var) print(source_var.encoding)

encode Variable

encoded_var = xr.conventions.encode_cf_variable(source_var) print("\n---------- encoded_var ------------------") print(encoded_var)

decode Variable

decoded_var = xr.conventions.decode_cf_variable("foo", encoded_var) print("\n---------- decoded_var ------------------") print(decoded_var.load()) ```

```python /home/kai/miniconda/envs/xarray_311/lib/python3.11/site-packages/xarray/coding/times.py:618: RuntimeWarning: invalid value encountered in cast int_num = np.asarray(num, dtype=np.int64) /home/kai/miniconda/envs/xarray_311/lib/python3.11/site-packages/xarray/coding/times.py:254: RuntimeWarning: invalid value encountered in cast flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( /home/kai/miniconda/envs/xarray_311/lib/python3.11/site-packages/xarray/coding/times.py:254: RuntimeWarning: invalid value encountered in cast flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype(

---------- source_var ------------------ <xarray.Variable (time: 2)> array(['2000-01-01T00:00:00.000000000', 'NaT'], dtype='datetime64[ns]') {'dtype': <class 'numpy.float64'>, '_FillValue': 20.0} dtype num float64

---------- encoded_var ------------------ <xarray.Variable (time: 2)> array([ 0., 20.]) Attributes: units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian _FillValue: 20.0

---------- decoded_var ------------------ <xarray.Variable (time: 2)> array(['2000-01-01T00:00:00.000000000', 'NaT'], dtype='datetime64[ns]') {'_FillValue': 20.0, 'units': 'days since 2000-01-01 00:00:00', 'calendar': 'proleptic_gregorian', 'dtype': dtype('float64')} ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Preserve nanosecond resolution when encoding/decoding times 1700227455
1556869361 https://github.com/pydata/xarray/pull/7827#issuecomment-1556869361 https://api.github.com/repos/pydata/xarray/issues/7827 IC_kwDOAMm_X85cy_Dx kmuehlbauer 5821660 2023-05-22T09:24:47Z 2023-05-22T09:24:47Z MEMBER

@spencerkclark With current master I get the following RuntimeWarning running your code example:

  • on encoding (calling to_netcdf()):

python /home/kai/miniconda/envs/xarray_311/lib/python3.11/site-packages/xarray/coding/times.py:618: RuntimeWarning: invalid value encountered in cast int_num = np.asarray(num, dtype=np.int64)

  • on decoding (calling open_dataset()):

python /home/kai/miniconda/envs/xarray_311/lib/python3.11/site-packages/xarray/coding/times.py:254: RuntimeWarning: invalid value encountered in cast flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype( /home/kai/miniconda/envs/xarray_311/lib/python3.11/site-packages/xarray/coding/times.py:254: RuntimeWarning: invalid value encountered in cast flat_num_dates_ns_int = (flat_num_dates * _NS_PER_TIME_DELTA[delta]).astype(

The latter was discussed in #7098 (casting float64 to int64), the former was aimed to be resolved with this PR.

I'll try to create a test case using Variable and the respective encoding/decoding functions without involving IO (per your suggestion @spencerkclark).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Preserve nanosecond resolution when encoding/decoding times 1700227455
1556201913 https://github.com/pydata/xarray/issues/7856#issuecomment-1556201913 https://api.github.com/repos/pydata/xarray/issues/7856 IC_kwDOAMm_X85cwcG5 TomNicholas 35968931 2023-05-21T15:04:05Z 2023-05-21T15:04:05Z MEMBER

The only reason I didn't separate the chunkmanager entry points into local and other entry points was simplicity of code.

I didn't realise that might make a difference when it came to whether or not you have to pip install - I assumed that adding a new type of entry point would require re-installing no matter how I implemented it. If that's not the case perhaps we should adjust it (and re-release).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unrecognized chunk manager dask - must be one of: [] 1718410975
1556198984 https://github.com/pydata/xarray/issues/7856#issuecomment-1556198984 https://api.github.com/repos/pydata/xarray/issues/7856 IC_kwDOAMm_X85cwbZI Illviljan 14371165 2023-05-21T14:51:55Z 2023-05-21T14:51:55Z MEMBER

Nope, I have not tried that. I suspect things will just self heal then considering the CI without understanding the root cause.

Looking at the backends; we initialize a dict here: https://github.com/pydata/xarray/blob/d8ec3a3f6b02a8b941b484b3d254537af84b5fde/xarray/backends/common.py#L435

Stores each of our entrypoints like this: https://github.com/pydata/xarray/blob/d8ec3a3f6b02a8b941b484b3d254537af84b5fde/xarray/backends/h5netcdf_.py#L438

Then we append the local and other entrypoints together here: https://github.com/pydata/xarray/blob/d8ec3a3f6b02a8b941b484b3d254537af84b5fde/xarray/backends/plugins.py#L106-L116

But load_chunkmanagers doesn't really seem to append from a dict: https://github.com/pydata/xarray/blob/d8ec3a3f6b02a8b941b484b3d254537af84b5fde/xarray/core/parallelcompat.py#L48-L62

Why do the backends use the BACKEND_ENTRYPOINTS strategy? To avoid these cases? Or something else?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unrecognized chunk manager dask - must be one of: [] 1718410975
1556191719 https://github.com/pydata/xarray/issues/7856#issuecomment-1556191719 https://api.github.com/repos/pydata/xarray/issues/7856 IC_kwDOAMm_X85cwZnn TomNicholas 35968931 2023-05-21T14:19:27Z 2023-05-21T14:35:22Z MEMBER

Yes, but I'm wondering what functional difference is that making here?

Have you tried doing the local pip install of the xarray dev version again? I.e. pip install -e . from the xarray folder.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unrecognized chunk manager dask - must be one of: [] 1718410975
1556191288 https://github.com/pydata/xarray/issues/7856#issuecomment-1556191288 https://api.github.com/repos/pydata/xarray/issues/7856 IC_kwDOAMm_X85cwZg4 Illviljan 14371165 2023-05-21T14:17:30Z 2023-05-21T14:17:30Z MEMBER

The CI recreates its entire environment all the time and I don't?

```python from xarray.core.parallelcompat import list_chunkmanagers

list_chunkmanagers() Out[1]: {} ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unrecognized chunk manager dask - must be one of: [] 1718410975
1556182520 https://github.com/pydata/xarray/issues/7856#issuecomment-1556182520 https://api.github.com/repos/pydata/xarray/issues/7856 IC_kwDOAMm_X85cwXX4 TomNicholas 35968931 2023-05-21T13:36:22Z 2023-05-21T13:36:22Z MEMBER

Hmm, it's acting as if dask is not installed/importable. Any idea what's different about your setup vs the xarray CI?

Yes daskmanager is also registered via a different entry point, but that should already be set up to happen by default.

To see which chunk managers it can find you can call

```python from xarray.core.parallelcompat import list_chunkmanagers

list_chunkmanagers() ```

I expect it will return an empty list in your case, but that's the code we should be trying to debug on your system.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unrecognized chunk manager dask - must be one of: [] 1718410975
1556160022 https://github.com/pydata/xarray/pull/7844#issuecomment-1556160022 https://api.github.com/repos/pydata/xarray/issues/7844 IC_kwDOAMm_X85cwR4W Illviljan 14371165 2023-05-21T11:54:28Z 2023-05-21T11:55:48Z MEMBER

before after ratio [05c7888d] [d135ab97] - 2.47±0.02s 806±6ms 0.33 pandas.ToDataFrameDask.time_to_dataframe

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Improve to_dask_dataframe performance 1710752209
1556114932 https://github.com/pydata/xarray/issues/7856#issuecomment-1556114932 https://api.github.com/repos/pydata/xarray/issues/7856 IC_kwDOAMm_X85cwG30 Illviljan 14371165 2023-05-21T08:13:47Z 2023-05-21T08:13:47Z MEMBER

Our backends are stored in a dict like this: BACKEND_ENTRYPOINTS["h5netcdf"] = ("h5netcdf", H5netcdfBackendEntrypoint). Is it something similar daskmanager needs to do?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unrecognized chunk manager dask - must be one of: [] 1718410975
1556113793 https://github.com/pydata/xarray/issues/7856#issuecomment-1556113793 https://api.github.com/repos/pydata/xarray/issues/7856 IC_kwDOAMm_X85cwGmB Illviljan 14371165 2023-05-21T08:09:09Z 2023-05-21T08:09:09Z MEMBER

cc @TomNicholas

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unrecognized chunk manager dask - must be one of: [] 1718410975
1555902158 https://github.com/pydata/xarray/issues/7707#issuecomment-1555902158 https://api.github.com/repos/pydata/xarray/issues/7707 IC_kwDOAMm_X85cvS7O keewis 14808389 2023-05-20T12:32:47Z 2023-05-20T15:26:43Z MEMBER

with #7855 and the recent change to pint we're finally down to just two test failures (and a whole lot of warnings): xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_cdms2_sgrid: ValueError: operands could not be broadcast together with shapes (3,) (4,) xarray/tests/test_ufuncs.py::test_unary: AssertionError: assert (<class 'int'> is <class 'numpy.float64'> or 1.0 == 0.9999999999999999) The first one looks like cdms2 is incompatible with a change in numpy>=1.25. Not sure if we can do anything about that, especially since there's a big warning on the cdms2 repo stating that the package is going to be retired / archived by the end of this year... I guess we should start thinking about removing cdms2 support?

The second looks like a precision issue, which we should be able to resolve by using assert_allclose instead... not sure, though, especially given numpy/numpy#23773. Otherwise we could just defer to whatever numpy is doing (of course, that assumes that full_like works properly, which might not be a good idea for a unit test): ```python @pytest.mark.parametrize( "a", [ xr.Variable(["x"], [0, 0]), xr.DataArray([0, 0], dims="x"), xr.Dataset({"y": ("x", [0, 0])}), ], ) def test_unary(a): fill_value = np.cos(0)

expected = xr.full_like(a, fill_value=fill_value, dtype=fill_value.dtype)
actual = np.cos(a)

assert_identical(actual, expected)

`` Edit: if relying onfull_like` turns out to be a concern, maybe we could use "copy + assign" instead?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ⚠️ Nightly upstream-dev CI failed ⚠️ 1650481625
1554532844 https://github.com/pydata/xarray/pull/7827#issuecomment-1554532844 https://api.github.com/repos/pydata/xarray/issues/7827 IC_kwDOAMm_X85cqEns kmuehlbauer 5821660 2023-05-19T12:57:31Z 2023-05-19T12:57:31Z MEMBER

Thanks @spencerkclark for taking the time. NaN has been written to disk (as you assumed). Let's have another try next week.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Preserve nanosecond resolution when encoding/decoding times 1700227455
1553614542 https://github.com/pydata/xarray/issues/7848#issuecomment-1553614542 https://api.github.com/repos/pydata/xarray/issues/7848 IC_kwDOAMm_X85cmkbO TomNicholas 35968931 2023-05-18T20:36:35Z 2023-05-18T21:07:33Z MEMBER

np.pad is an interesting example in the context of chunked arrays (xref #6807) - dask implements it (parallelized using various approaches, including map_blocks internally), but cubed currently doesn't implement it because it's not part of the array API standard. (cc @tomwhite)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Compatibility with the Array API standard  1716228662
1553588837 https://github.com/pydata/xarray/pull/7815#issuecomment-1553588837 https://api.github.com/repos/pydata/xarray/issues/7815 IC_kwDOAMm_X85cmeJl TomNicholas 35968931 2023-05-18T20:10:43Z 2023-05-18T20:10:43Z MEMBER

Closing in favour of #7847

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Array API fixes for astype 1695244129
1553453937 https://github.com/pydata/xarray/pull/7019#issuecomment-1553453937 https://api.github.com/repos/pydata/xarray/issues/7019 IC_kwDOAMm_X85cl9Nx jhamman 2443309 2023-05-18T18:27:52Z 2023-05-18T18:27:52Z MEMBER

👏 Congrats @TomNicholas on getting this in! Such an important contribution. 👏

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Generalize handling of chunked array types 1368740629
1553395594 https://github.com/pydata/xarray/pull/7019#issuecomment-1553395594 https://api.github.com/repos/pydata/xarray/issues/7019 IC_kwDOAMm_X85clu-K TomNicholas 35968931 2023-05-18T17:37:22Z 2023-05-18T17:37:22Z MEMBER

Woooo thanks @dcherian !

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Generalize handling of chunked array types 1368740629
1553390072 https://github.com/pydata/xarray/pull/7019#issuecomment-1553390072 https://api.github.com/repos/pydata/xarray/issues/7019 IC_kwDOAMm_X85cltn4 dcherian 2448579 2023-05-18T17:34:01Z 2023-05-18T17:34:01Z MEMBER

Thanks @TomNicholas Big change!

{
    "total_count": 3,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 3,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Generalize handling of chunked array types 1368740629
1551638978 https://github.com/pydata/xarray/pull/7788#issuecomment-1551638978 https://api.github.com/repos/pydata/xarray/issues/7788 IC_kwDOAMm_X85cfCHC dcherian 2448579 2023-05-17T15:45:41Z 2023-05-17T15:45:41Z MEMBER

Thanks @maxhollmann I pushed a test for #2377.

I see this is your first contribution to Xarray. Welcome! #1792 would be a nice contribution if you're looking for more to do ;)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix as_compatible_data for read-only np.ma.MaskedArray 1685422501
1550594808 https://github.com/pydata/xarray/issues/7841#issuecomment-1550594808 https://api.github.com/repos/pydata/xarray/issues/7841 IC_kwDOAMm_X85cbDL4 dcherian 2448579 2023-05-17T02:24:57Z 2023-05-17T02:24:57Z MEMBER

We should migrate these to rioxarray if they aren't there already.

cc @snowman2 @scottyhq @JessicaS11

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Xarray docs showing tracebacks instead of plots 1709215291
1550564976 https://github.com/pydata/xarray/pull/7019#issuecomment-1550564976 https://api.github.com/repos/pydata/xarray/issues/7019 IC_kwDOAMm_X85ca75w TomNicholas 35968931 2023-05-17T01:39:08Z 2023-05-17T01:39:08Z MEMBER

@Illviljan thanks for all your comments!

Would you (or @keewis?) be willing to approve this PR now? I would really like to merge this so that I can release a version of xarray that I can use as a dependency for cubed-xarray.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Generalize handling of chunked array types 1368740629
1550187275 https://github.com/pydata/xarray/pull/7788#issuecomment-1550187275 https://api.github.com/repos/pydata/xarray/issues/7788 IC_kwDOAMm_X85cZfsL dcherian 2448579 2023-05-16T18:47:27Z 2023-05-16T18:47:27Z MEMBER

Thanks @maxhollmann can you add a note to whats-new.rst please?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix as_compatible_data for read-only np.ma.MaskedArray 1685422501
1547017905 https://github.com/pydata/xarray/pull/7824#issuecomment-1547017905 https://api.github.com/repos/pydata/xarray/issues/7824 IC_kwDOAMm_X85cNZ6x Illviljan 14371165 2023-05-14T22:44:06Z 2023-05-15T08:40:51Z MEMBER

Think I'll stop here.

@alimanfoo, feel free to try this out if you have the time.

Results: ``` before after ratio [964d350a] [86ef9540] - 117±2ms 65.6±0.9ms 0.56 groupby.Resample.time_agg_large_num_groups('sum', 2, False) - 117±2ms 65.3±0.7ms 0.56 groupby.ResampleCFTime.time_agg_large_num_groups('sum', 2, False) - 113±1ms 62.0±0.4ms 0.55 groupby.ResampleCFTime.time_agg_large_num_groups('sum', 1, False) - 112±2ms 61.4±0.5ms 0.55 groupby.Resample.time_agg_large_num_groups('sum', 1, False) - 8.50±0.2ms 1.61±0.01ms 0.19 combine.Combine1d.time_combine_by_coords - 1.81±0.02s 224±2ms 0.12 combine.Combine1dDask.time_combine_by_coords

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY. PERFORMANCE INCREASED. ```

{
    "total_count": 4,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 2,
    "eyes": 0
}
  Improve concat performance 1699099029
1546951468 https://github.com/pydata/xarray/issues/5511#issuecomment-1546951468 https://api.github.com/repos/pydata/xarray/issues/5511 IC_kwDOAMm_X85cNJss shoyer 1217238 2023-05-14T17:17:56Z 2023-05-14T17:17:56Z MEMBER

If we can find cases where we know concurrent writes are unsafe, we can definitely start raising errors. Better to be safe than to suffer from silent data corruption!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Appending data to a dataset stored in Zarr format produce PermissonError or NaN values in the final result 927617256
1546028265 https://github.com/pydata/xarray/pull/7840#issuecomment-1546028265 https://api.github.com/repos/pydata/xarray/issues/7840 IC_kwDOAMm_X85cJoTp keewis 14808389 2023-05-12T16:56:23Z 2023-05-12T16:56:23Z MEMBER

let's have a look at what defines the object: python data = xr.DataArray(np.random.randn(2, 3), dims=("x", "y"), coords={"x": [10, 20]}) That means we have: - random data - two dimensions: x with a length of 2 and y with a length of 3 - one coordinate: x with values [10, 20]

The line python data.x.attrs["units"] = "x units" can be split into two parts: python x = data.x and python x.attrs["units"] = "x units" where x is the coordinate.

If we did the same thing with y we would not get the dimension, but a dummy coordinate that has the values np.arange(data.sizes["y"]). This is admittedly a bit confusing.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix words to make terminology consistent in docs 1707774178
1546024198 https://github.com/pydata/xarray/issues/7838#issuecomment-1546024198 https://api.github.com/repos/pydata/xarray/issues/7838 IC_kwDOAMm_X85cJnUG dcherian 2448579 2023-05-12T16:52:29Z 2023-05-12T16:52:29Z MEMBER

Thanks! I tracked this down to the difference between reading the file remotely, or downloading first and accessing a local copy on v0.20.2 (the latter is what I used to produce my figures). Can you reproduce? remote = xr.open_dataset( "http://kage.ldeo.columbia.edu:81/SOURCES/.LOCAL/.sst.mon.mean.nc/.sst/dods" ).sst.sel(lat=20, lon=280, method="nearest") local = xr.open_dataset("~/Downloads/data.cdf").sst.sel(lat=20, lon=280, method="nearest")

(remote.groupby("time.month") - remote.groupby("time.month").mean()).plot()

(local.groupby("time.month") - local.groupby("time.month").mean()).plot()

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Anomaly calculation with groupby leaves seasonal cycle 1706864252
1545974461 https://github.com/pydata/xarray/pull/7796#issuecomment-1545974461 https://api.github.com/repos/pydata/xarray/issues/7796 IC_kwDOAMm_X85cJbK9 dcherian 2448579 2023-05-12T16:09:04Z 2023-05-12T16:09:14Z MEMBER

Yes, 10-30% on my machine: before after ratio [91f14c9b] [1eb74149] <v2023.04.2> <speedup-dt-accesor> - 1.17±0.04ms 1.02±0.04ms 0.87 accessors.DateTimeAccessor.time_dayofyear('standard') - 1.25±0.07ms 976±30μs 0.78 accessors.DateTimeAccessor.time_year('standard') - 3.90±0.1ms 2.68±0.05ms 0.69 accessors.DateTimeAccessor.time_year('noleap') - 4.75±0.07ms 3.25±0.04ms 0.68 accessors.DateTimeAccessor.time_dayofyear('noleap')

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 1,
    "eyes": 0
}
  Speed up .dt accessor by preserving Index objects. 1689364566
1545939343 https://github.com/pydata/xarray/pull/7788#issuecomment-1545939343 https://api.github.com/repos/pydata/xarray/issues/7788 IC_kwDOAMm_X85cJSmP dcherian 2448579 2023-05-12T15:39:24Z 2023-05-12T15:39:24Z MEMBER

I defer to @shoyer, the solution with where_method seems good to me.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix as_compatible_data for read-only np.ma.MaskedArray 1685422501
1545937746 https://github.com/pydata/xarray/pull/7840#issuecomment-1545937746 https://api.github.com/repos/pydata/xarray/issues/7840 IC_kwDOAMm_X85cJSNS keewis 14808389 2023-05-12T15:37:59Z 2023-05-12T15:37:59Z MEMBER

I agree, coordinate is the correct term. We could make that a bit less confusing by using a non-dimension coordinate in the example, but then again the point is that any coordinate can have additional metadata.

But I think the concept of dimension-coordinates (when the coordinate has the same name as the dimension) is still relevant.

If I remember correctly, while they lost their status as the only ones having an index dimension coordinates are still used for alignment.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix words to make terminology consistent in docs 1707774178
1545930953 https://github.com/pydata/xarray/issues/7838#issuecomment-1545930953 https://api.github.com/repos/pydata/xarray/issues/7838 IC_kwDOAMm_X85cJQjJ dcherian 2448579 2023-05-12T15:32:47Z 2023-05-12T15:35:02Z MEMBER

Can you compare ds_anom at a point in both versions please? I get a plot that looks quite similar

v0.20.2:

v2022.03.0:

v2023.04.2

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Anomaly calculation with groupby leaves seasonal cycle 1706864252
1545446155 https://github.com/pydata/xarray/pull/7788#issuecomment-1545446155 https://api.github.com/repos/pydata/xarray/issues/7788 IC_kwDOAMm_X85cHaML kmuehlbauer 5821660 2023-05-12T09:23:13Z 2023-05-12T09:23:13Z MEMBER

@maxhollmann I'm sorry, I'm still finding my way into Xarray. I've taken a closer look at #2377, especially https://github.com/pydata/xarray/issues/2377#issuecomment-415074188.

There @shoyer suggested to just use:

python data = duck_array_ops.where_method(data, ~mask, fill_value)

instead of python data[mask] = fill_value

I've checked and it works nicely with your test. That way we would get away without the flags test and the special handling will take place in duck_array_ops. Would be great if someone can double check.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix as_compatible_data for read-only np.ma.MaskedArray 1685422501
1545408039 https://github.com/pydata/xarray/issues/4220#issuecomment-1545408039 https://api.github.com/repos/pydata/xarray/issues/4220 IC_kwDOAMm_X85cHQ4n kmuehlbauer 5821660 2023-05-12T08:55:09Z 2023-05-12T08:55:09Z MEMBER

combine_first uses fillna under the hood -> #3570

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_first of Datasets changes dtype of variable present only in one Dataset 656089264

Next page

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 667.916ms · About: xarray-datasette
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows