BCDA-APS / bluesky_training

Bluesky training, including instrument package
https://bcda-aps.github.io/bluesky_training/
Other
11 stars 0 forks source link

Dataset.dims definition changing in python update #265

Open lcgallington opened 4 months ago

lcgallington commented 4 months ago

In the https://bcda-aps.github.io/bluesky_training/tutor/hello_world.html tutorial, after I run the hello_world demonstration plan and go to read data from the last run, I get a warning message about Dataset.dims needing to be changed to Dataset.sizes in future versions of python.


run = cat[-1]
metadata=run.metadata
data=run.primary.read()

/home/apsu/Apps/miniconda3/envs/bluesky_2024_1/lib/python3.11/site-packages/xarray/core/utils.py:494: FutureWarning: The return type of Dataset.dims will be changed to return a set of dimension names in future, in order to be more consistent with DataArray.dims. To access a mapping from dimension names to lengths, please use Dataset.sizes. warnings.warn(

prjemian commented 4 months ago

@lcgallington Thanks for reporting this. I believe the call to the xarray package comes from an upstream library, such as databroker. The training notebooks don't call xarray directly.

$ git grep xarray | grep "import "
databroker/mongo_normalized.py:import xarray
databroker/mongo_normalized.py:from tiled.adapters.xarray import DatasetAdapter
databroker/projector.py:import xarray
databroker/tests/test_projector.py:import xarray
databroker/v1.py:import xarray