home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1394854820

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1394854820 I_kwDOAMm_X85TI8uk 7115 import_metadata==5.0.0 causes error when loading netcdf file 15892073 closed 0     5 2022-10-03T14:39:57Z 2022-10-03T16:13:20Z 2022-10-03T16:11:53Z CONTRIBUTOR      

What happened?

Loading an .nc file under Python 3.7 and with the latest importlib_metadata==5.0.0 doesn't work.

What did you expect to happen?

File should be loaded.

Minimal Complete Verifiable Example

```Python

Python version 3.7

import_metadata==5.0.0

import xarray as xr import numpy as np

data = xr.DataArray( np.random.rand(10, 20) ) data.to_netcdf('test.nc') xr.load_dataarray('test.nc') ```

MVCE confirmation

  • [X] 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, returning the result.
  • [X] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

Python Traceback (most recent call last): File "xarray_bug.py", line 7, in <module> xr.load_dataarray('test.nc') File "/home/etienne/anaconda3/envs/py37/lib/python3.7/site-packages/xarray/backends/api.py", line 267, in load_dataarray with open_dataarray(filename_or_obj, **kwargs) as da: File "/home/etienne/anaconda3/envs/py37/lib/python3.7/site-packages/xarray/backends/api.py", line 666, in open_dataarray **kwargs, File "/home/etienne/anaconda3/envs/py37/lib/python3.7/site-packages/xarray/backends/api.py", line 479, in open_dataset engine = plugins.guess_engine(filename_or_obj) File "/home/etienne/anaconda3/envs/py37/lib/python3.7/site-packages/xarray/backends/plugins.py", line 110, in guess_engine engines = list_engines() File "/home/etienne/anaconda3/envs/py37/lib/python3.7/site-packages/xarray/backends/plugins.py", line 105, in list_engines entrypoints = entry_points().get("xarray.backends", ()) AttributeError: 'EntryPoints' object has no attribute 'get'

Anything else we need to know?

  • Only with importlib_metadata==5.0.0
  • Doesn't works with Python 3.7 but it works with 3.9
  • Similar problem for flake8 repo.
  • They solved it by imposing a specific version for python versions under 3.8 : https://github.com/PyCQA/flake8/blob/2c1bfa1f3d85e4d94ebc3b6d601d454a09d8043e/setup.cfg#L44

Environment

INSTALLED VERSIONS ------------------ commit: None python: 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 5.4.210-1-MANJARO machine: x86_64 processor: byteorder: little LC_ALL: None LANG: fr_FR.UTF-8 LOCALE: ('fr_FR', 'UTF-8') libhdf5: 1.12.2 libnetcdf: 4.9.0 xarray: 0.20.2 pandas: 1.3.5 numpy: 1.21.6 scipy: None netCDF4: 1.6.1 pydap: None h5netcdf: 1.0.2 h5py: 3.7.0 Nio: None zarr: None cftime: 1.6.2 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: None distributed: None matplotlib: None cartopy: None seaborn: None numbagg: None fsspec: None cupy: None pint: None sparse: None setuptools: 65.4.1 pip: 22.2.2 conda: None pytest: None IPython: 7.34.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7115/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.713ms · About: xarray-datasette