home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 935747115

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
935747115 MDU6SXNzdWU5MzU3NDcxMTU= 5565 Tests fail when no SciPy installed 33122845 closed 0     0 2021-07-02T12:58:49Z 2021-07-17T21:05:13Z 2021-07-17T21:05:13Z CONTRIBUTOR      

What happened: Tests failed, also reported in #5564 and relatd to #5559 What you expected to happen:

Minimal Complete Verifiable Example:

python cd xarray pip install -e . pip install h5netcdf pytest-xdist netcdf4 py.test -n 4 ```python ======================================================= FAILURES ======================================================= ______ TestH5NetCDFFileObject.testopen_fileobj _______ [gw3] linux -- Python 3.9.5 /home/joeperdefloep/miniconda3/envs/xr-dev/bin/python3.9

self = <xarray.tests.test_backends.TestH5NetCDFFileObject object at 0x7f051a6b59a0>

def test_open_fileobj(self):
    # open in-memory datasets instead of local file paths
    expected = create_test_data().drop_vars("dim3")
    expected.attrs["foo"] = "bar"
    with create_tmp_file() as tmp_file:
        expected.to_netcdf(tmp_file, engine="h5netcdf")

        with open(tmp_file, "rb") as f:
            with open_dataset(f, engine="h5netcdf") as actual:
                assert_identical(expected, actual)

            f.seek(0)
            with open_dataset(f) as actual:
                assert_identical(expected, actual)

            f.seek(0)
            with BytesIO(f.read()) as bio:
                with open_dataset(bio, engine="h5netcdf") as actual:
                    assert_identical(expected, actual)

            f.seek(0)
            with pytest.raises(TypeError, match="not a valid NetCDF 3"):
              open_dataset(f, engine="scipy")

/mnt/e/Git/xarray/xarray/tests/test_backends.py:2887:


/mnt/e/Git/xarray/xarray/backends/api.py:483: in open_dataset backend = plugins.get_backend(engine)


engine = 'scipy'

def get_backend(engine):
    """Select open_dataset method based on current engine."""
    if isinstance(engine, str):
        engines = list_engines()
        if engine not in engines:
          raise ValueError(
                f"unrecognized engine {engine} must be one of: {list(engines)}"
            )

E ValueError: unrecognized engine scipy must be one of: ['netcdf4', 'h5netcdf', 'store']

/mnt/e/Git/xarray/xarray/backends/plugins.py:156: ValueError ________ test_3641 ___________ [gw0] linux -- Python 3.9.5 /home/joeperdefloep/miniconda3/envs/xr-dev/bin/python3.9

@requires_cftime
def test_3641():
    times = xr.cftime_range("0001", periods=3, freq="500Y")
    da = xr.DataArray(range(3), dims=["time"], coords=[times])
  da.interp(time=["0002-05-01"])

/mnt/e/Git/xarray/xarray/tests/test_interp.py:733:


/mnt/e/Git/xarray/xarray/core/dataarray.py:1687: in interp ds = self._to_temp_dataset().interp( /mnt/e/Git/xarray/xarray/core/dataset.py:3146: in interp variables[name] = missing.interp(var, var_indexers, method, kwargs) /mnt/e/Git/xarray/xarray/core/missing.py:633: in interp interped = interp_func( /mnt/e/Git/xarray/xarray/core/missing.py:752: in interp_func return _interpnd(var, x, new_x, func, kwargs) /mnt/e/Git/xarray/xarray/core/missing.py:770: in _interpnd return _interp1d(var, x, new_x, func, kwargs) /mnt/e/Git/xarray/xarray/core/missing.py:758: in _interp1d rslt = func(x, var, assume_sorted=True, kwargs)(np.ravel(new_x))


self = <[AttributeError("'ScipyInterpolator' object has no attribute 'method'") raised in repr()] ScipyInterpolator object at 0x7f1aa547fc40> xi = <xarray.IndexVariable 'time' (time: 2)> array([0.00000e+00, 1.57788e+19]), yi = array([0, 1]), method = 'linear' fill_value = None, assume_sorted = True, copy = False, bounds_error = False, order = None, kwargs = {}

def __init__(
    self,
    xi,
    yi,
    method=None,
    fill_value=None,
    assume_sorted=True,
    copy=False,
    bounds_error=False,
    order=None,
    **kwargs,
):
  from scipy.interpolate import interp1d

E ModuleNotFoundError: No module named 'scipy'

/mnt/e/Git/xarray/xarray/core/missing.py:129: ModuleNotFoundError =================================================== warnings summary =================================================== xarray/tests/test_dataarray.py::TestReduce1D::test_min[x3-5-2-1] xarray/tests/test_dataarray.py::TestReduce1D::test_max[x3-5-2-1] xarray/tests/test_dataarray.py::TestReduce2D::test_min[x2-minindex2-maxindex2-nanindex2] xarray/tests/test_dataarray.py::TestReduce2D::test_max[x2-minindex2-maxindex2-nanindex2] /home/joeperdefloep/miniconda3/envs/xr-dev/lib/python3.9/site-packages/numpy/core/fromnumeric.py:86: RuntimeWarning: invalid value encountered in reduce return ufunc.reduce(obj, axis, dtype, out, **passkwargs)

-- Docs: https://docs.pytest.org/en/stable/warnings.html =============================================== short test summary info ================================================ FAILED xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_open_fileobj - ValueError: unrecognized engine sci... FAILED xarray/tests/test_interp.py::test_3641 - ModuleNotFoundError: No module named 'scipy' ============= 2 failed, 8243 passed, 3776 skipped, 29 xfailed, 26 xpassed, 4 warnings in 229.01s (0:03:49) ============= ``` Anything else we need to know?:

Environment:

Output of <tt>xr.show_versions()</tt> INSTALLED VERSIONS ------------------ commit: a874739378f28f68c4e184c5bf1cebdb749dc836 python: 3.9.5 | packaged by conda-forge | (default, Jun 19 2021, 00:32:32) [GCC 9.3.0] python-bits: 64 OS: Linux OS-release: 4.19.128-microsoft-standard machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: C.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.0 libnetcdf: 4.7.4 xarray: 0.18.2.dev69+gc472f8a4 pandas: 1.2.5 numpy: 1.21.0 scipy: None netCDF4: 1.5.7 pydap: None h5netcdf: 0.11.0 h5py: 3.3.0 Nio: None zarr: None cftime: 1.5.0 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 pint: None setuptools: 49.6.0.post20210108 pip: 21.1.3 conda: None pytest: 6.2.4 IPython: None sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5565/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

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