Stream: python-questions

Topic: warning message with open_mfdataset


view this post on Zulip Cecile Hannay (Mar 09 2022 at 21:29):

I am reading a variable:
ref_t = xr.open_mfdataset(fils)['T'].sel(lat=lat, lon=lon).compute()
and I am getting teh warning:

/glade/work/hannay/miniconda3/envs/python-tutorial/lib/python3.7/site-packages/xarray/backends/api.py:783: FutureWarning: In xarray version 0.13 `auto_combine` will be deprecated.
  coords=coords)
/glade/work/hannay/miniconda3/envs/python-tutorial/lib/python3.7/site-packages/xarray/backends/api.py:783: FutureWarning: The datasets supplied have global dimension coordinates. You may want
to use the new `combine_by_coords` function (or the
`combine='by_coords'` option to `open_mfdataset` to order the datasets
before concatenation. Alternatively, to continue concatenating based
on the order the datasets are supplied in in future, please use the
new `combine_nested` function (or the `combine='nested'` option to
open_mfdataset).
  coords=coords)

I have tried to change the syntax and use combine='nested' or combine='by_coords' but anything I try, I will get an error.

Any advice? Thanks.

view this post on Zulip Anderson Banihirwe (Mar 09 2022 at 21:35):

/glade/work/hannay/miniconda3/envs/python-tutorial/lib/python3.7/site-packages/xarray/backends/api.py:783: FutureWarning: In xarray version 0.13 auto_combine

xarray 0.13 is quite outdated (more than 2 years old). Have you considered upgrading to a more recent version?

view this post on Zulip Cecile Hannay (Mar 09 2022 at 21:45):

Hi Anderson,
I can certainly update if I know how to do it and the scripts I am using still work. Sorry to be so clueless. Thanks a bunch.

view this post on Zulip Anderson Banihirwe (Mar 09 2022 at 21:48):

Okay... In the meantime, we can try to diagnose the issue you are running into. Do you mind posting the full traceback/error message you are getting? I'm asking because your previous message contains warnings from xarray (Warnings are usually harmless) but you do mention that you are getting some errors

view this post on Zulip Cecile Hannay (Mar 09 2022 at 22:00):

I am not getting error with:
ref_t = xr.open_mfdataset(fils)['T'].sel(lat=lat, lon=lon).compute()
Just warning.

I get error when I try change the syntax to include combine='nested' but maybe I need to update xarray first.

view this post on Zulip Cecile Hannay (Mar 10 2022 at 00:00):

I was able to solve my issue by doing:

module unload python
module load conda
conda activate npl
python -m ipykernel install --user --name=my-ADF

view this post on Zulip Cecile Hannay (Mar 10 2022 at 00:07):

@Anderson Banihirwe : I am just curious. Is there a way to check the version of xarray I am using with that setting.

Also, I just want to mention a broken link. I was following documentation at:
https://ncar.github.io/esds/faq/#creating-and-accessing-a-new-conda-environment

It says somewhere on that page:


Conda Environments on JupyterHub

The Computational and Information Systems Lab (CISL) at NCAR put together some good documentation on dealing with environments on Casper/Cheyenne


But the link to good documentation is not there anymore. I thought I would mention it in case you want to fix it.

view this post on Zulip Anderson Banihirwe (Mar 10 2022 at 00:16):

Is there a way to check the version of xarray I am using with that setting.

Within your notebook, try the following

import xarray as xr
print(xr.__version__) # gets xarray version

# or

print(xr.show_versions()) # outputs xarray version plus other related packages

view this post on Zulip Anderson Banihirwe (Mar 10 2022 at 00:17):

Also, I just want to mention a broken link. I was following documentation at:
https://ncar.github.io/esds/faq/#creating-and-accessing-a-new-conda-environment
But the link to good documentation is not there anymore. I thought I would mention it in case you want to fix it.

Good catch. That link has moved to https://arc.ucar.edu/knowledge_base/83853599.

view this post on Zulip Anderson Banihirwe (Mar 10 2022 at 00:17):

I'm going to update that page


Last updated: May 16 2025 at 17:14 UTC