developmentseed / developmentseed/titiler-multidim

Tests fail when using NumPy 2.0

Open
#59 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
88
Forks
13
Avg merge
2d 53m
Merged PRs (30d)
10

Description

All the `titiler-xarray` tests fail when using NumPy 2.0, with `ERROR tests/test_app.py::test_get_variables_test - ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject`

Here's the full traceback for one of the failures:
```
_________________________________________________________________________________________ ERROR at setup of test_get_variables_test _________________________________________________________________________________________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x108495f10>

@pytest.fixture
def app(monkeypatch):
"""App fixture."""
monkeypatch.setenv("TITILER_XARRAY_DEBUG", "TRUE")
monkeypatch.setenv("TEST_ENVIRONMENT", "1")

> from titiler.xarray.main import app

tests/conftest.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
titiler/xarray/main.py:5: in
import rioxarray
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/rioxarray/__init__.py:5: in
import rioxarray.raster_array # noqa
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/rioxarray/raster_array.py:22: in
import xarray
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/xarray/__init__.py:3: in
from xarray import testing, tutorial
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/xarray/testing/__init__.py:1: in
from xarray.testing.assertions import ( # noqa: F401
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/xarray/testing/assertions.py:9: in
import pandas as pd
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/pandas/__init__.py:22: in
from pandas.compat import is_numpy_dev as _is_numpy_dev # pyright: ignore # noqa:F401
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/pandas/compat/__init__.py:18: in
from pandas.compat.numpy import (
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/pandas/compat/numpy/__init__.py:4: in
from pandas.util.version import Version
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/pandas/util/__init__.py:2: in
from pandas.util._decorators import ( # noqa:F401
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/pandas/util/_decorators.py:14: in
from pandas._libs.properties import cache_readonly
/Users/max/miniforge3/envs/titiler-xarray/lib/python3.11/site-packages/pandas/_libs/__init__.py:13: in
from pandas._libs.interval import Interval
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

> ???
E ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

pandas/_libs/interval.pyx:1: ValueError

```

These is likely a Pandas issue, but I'm just raising an issue for now until I have more time to look into it. I'm going to open a separate PR to temporarily pin NumPy to unblock some work.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.