From f2739ab963d44eaee4dd3ed3907aa4d88b6954d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 18 May 2024 10:08:48 +0200 Subject: [PATCH 01/14] Test Numpy 2.0 and updates --- .github/workflows/test.yaml | 2 +- holoviews/core/sheetcoords.py | 2 +- holoviews/tests/core/test_dimensions.py | 6 +++++- holoviews/tests/element/test_comparisondimension.py | 10 ++++++++-- pixi.toml | 7 +++++++ pyproject.toml | 2 +- 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b16390f645..9da18b2b20 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -187,7 +187,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - environment: ["test-core"] + environment: ["test-core", "test-np2"] timeout-minutes: 120 steps: - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi diff --git a/holoviews/core/sheetcoords.py b/holoviews/core/sheetcoords.py index a6e8d163cc..7c5e665c12 100644 --- a/holoviews/core/sheetcoords.py +++ b/holoviews/core/sheetcoords.py @@ -365,7 +365,7 @@ def __new__(cls, bounds, sheet_coordinate_system, force_odd=False, else: slicespec=Slice._boundsspec2slicespec(bounds.lbrt(),sheet_coordinate_system) # Using numpy.int32 for legacy reasons - a = np.array(slicespec, dtype=np.int32, copy=False).view(cls) + a = np.array(slicespec, dtype=np.int32).view(cls) return a diff --git a/holoviews/tests/core/test_dimensions.py b/holoviews/tests/core/test_dimensions.py index 06f77066b9..bb3052b3fd 100644 --- a/holoviews/tests/core/test_dimensions.py +++ b/holoviews/tests/core/test_dimensions.py @@ -3,6 +3,7 @@ """ import numpy as np import pandas as pd +from packaging.version import Version from holoviews.core import Dimension, Dimensioned from holoviews.element.comparison import ComparisonTestCase @@ -243,7 +244,10 @@ def test_tuple_clone(self): class DimensionDefaultTest(ComparisonTestCase): def test_validate_default_against_values(self): - msg = r"Dimension\('A'\) default 1\.1 not found in declared values: \[0, 1\]" + if Version(np.__version__) >= Version('2.0.0a0'): + msg = r"Dimension\('A'\) default 1\.1 not found in declared values: \[np\.int64\(0\), np\.int64\(1\)\]" + else: + msg = r"Dimension\('A'\) default 1\.1 not found in declared values: \[0, 1\]" with self.assertRaisesRegex(ValueError, msg): Dimension('A', values=[0, 1], default=1.1) diff --git a/holoviews/tests/element/test_comparisondimension.py b/holoviews/tests/element/test_comparisondimension.py index 1234ce27c8..338f44c434 100644 --- a/holoviews/tests/element/test_comparisondimension.py +++ b/holoviews/tests/element/test_comparisondimension.py @@ -1,6 +1,9 @@ """ Test cases for Dimension and Dimensioned object comparison. """ +import numpy as np +from packaging.version import Version + from holoviews.core import Dimension, Dimensioned from holoviews.element.comparison import ComparisonTestCase @@ -74,8 +77,11 @@ def test_dimension_comparison_values_unequal(self): try: self.assertEqual(self.dimension4, self.dimension8) except AssertionError as e: - self.assertEqual(str(e), "Dimension parameter 'values' mismatched: [] != ['a', 'b']") - + if Version(np.__version__) >= Version('2.0.0a0'): + msg = "Dimension parameter 'values' mismatched: [] != [np.str_('a'), np.str_('b')]" + else: + msg = "Dimension parameter 'values' mismatched: [] != ['a', 'b']" + self.assertEqual(str(e), msg) def test_dimension_comparison_types_unequal(self): try: self.assertEqual(self.dimension9, self.dimension10) diff --git a/pixi.toml b/pixi.toml index 7e6a08d23f..6ff5f5b58f 100644 --- a/pixi.toml +++ b/pixi.toml @@ -15,6 +15,7 @@ test-311 = ["py311", "test-core", "test", "example", "test-example", "test-unit- test-312 = ["py312", "test-core", "test", "example", "test-example", "test-unit-task"] test-ui = ["py312", "test-core", "test", "test-ui"] test-core = ["py312", "test-core", "test-unit-task"] +test-np2 = ["py312", "test-core", "test-unit-task", "np2"] test-gpu = ["py311", "test-core", "test", "test-gpu"] docs = ["py311", "example", "doc"] build = ["py311", "build"] @@ -48,6 +49,12 @@ python = "3.11.*" [feature.py312.dependencies] python = "3.12.*" +[feature.np2] +channels = ["pyviz/label/dev", "conda-forge/label/numpy_rc", "conda-forge"] + +[feature.np2.dependencies] +numpy = "2.*" + [feature.example.dependencies] cftime = "*" dask-core = "*" diff --git a/pyproject.toml b/pyproject.toml index ed94c5e2d8..fb9b916db0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,7 +90,7 @@ filterwarnings = [ # 2023-01: Sqlalchemy 2.0 warning: "ignore: Deprecated API features detected:DeprecationWarning:ibis.backends.base.sql.alchemy", # https://github.com/ibis-project/ibis/issues/5048 # 2023-03: Already handling the nested sequence - "ignore:Creating an ndarray from ragged nested sequences:numpy.VisibleDeprecationWarning:holoviews.core.data.spatialpandas", + "ignore:Creating an ndarray from ragged nested sequences::holoviews.core.data.spatialpandas", # 2023-09: Dash needs to update their code to use the comm module and pkg_resources "ignore:The `.+?` class has been deprecated:DeprecationWarning:dash._jupyter", "ignore:pkg_resources is deprecated as an API:DeprecationWarning:dash.dash", From e9b35a4aa7afbc9d84dfa64ea839251fa1e81ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 18 May 2024 10:18:05 +0200 Subject: [PATCH 02/14] Add more dependencies --- .github/workflows/test.yaml | 2 +- pixi.toml | 28 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9da18b2b20..e6b8c5d91d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -187,7 +187,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - environment: ["test-core", "test-np2"] + environment: ["test-core", "test-numpy"] timeout-minutes: 120 steps: - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi diff --git a/pixi.toml b/pixi.toml index 6ff5f5b58f..23692e7a24 100644 --- a/pixi.toml +++ b/pixi.toml @@ -15,7 +15,7 @@ test-311 = ["py311", "test-core", "test", "example", "test-example", "test-unit- test-312 = ["py312", "test-core", "test", "example", "test-example", "test-unit-task"] test-ui = ["py312", "test-core", "test", "test-ui"] test-core = ["py312", "test-core", "test-unit-task"] -test-np2 = ["py312", "test-core", "test-unit-task", "np2"] +test-numpy = ["py312", "test-core", "test-unit-task", "np2"] test-gpu = ["py311", "test-core", "test", "test-gpu"] docs = ["py311", "example", "doc"] build = ["py311", "build"] @@ -49,11 +49,6 @@ python = "3.11.*" [feature.py312.dependencies] python = "3.12.*" -[feature.np2] -channels = ["pyviz/label/dev", "conda-forge/label/numpy_rc", "conda-forge"] - -[feature.np2.dependencies] -numpy = "2.*" [feature.example.dependencies] cftime = "*" @@ -141,6 +136,27 @@ rmm = { version = "*", channel = "rapidsai" } [feature.test-gpu.tasks] test-gpu = { cmd = "pytest holoviews/tests --gpu", env = { NUMBA_CUDA_LOW_OCCUPANCY_WARNINGS = '0' } } +[feature.np2] +channels = ["pyviz/label/dev", "conda-forge/label/numpy_rc", "conda-forge"] + +[feature.np2.dependencies] +numpy = "2.*" + +# test dependencies without Numba +cftime = "*" +contourpy = "*" +dask-core = "*" +ffmpeg = "*" +ibis-sqlite = "*" +nbconvert = "*" +networkx = "*" +pillow = "*" +scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 +selenium = "*" +shapely = "*" +xarray = ">=0.10.4" +xyzservices = "*" + # ============================================= # =================== DOCS ==================== # ============================================= From dda3f848176fc22015c91724959e6ed1a1e6b288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 18 May 2024 13:34:31 +0200 Subject: [PATCH 03/14] Update with Constant numpy version --- holoviews/core/util.py | 3 +++ holoviews/tests/core/test_dimensions.py | 4 ++-- holoviews/tests/element/test_comparisondimension.py | 5 ++--- holoviews/tests/test_streams.py | 13 ++++++++----- pixi.toml | 1 - 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/holoviews/core/util.py b/holoviews/core/util.py index c2ff670d50..2e2732bfb0 100644 --- a/holoviews/core/util.py +++ b/holoviews/core/util.py @@ -50,6 +50,9 @@ _PANDAS_ROWS_LARGE = 1_000_000 _PANDAS_SAMPLE_SIZE = 1_000_000 +numpy_version = Version(Version(np.__version__).base_version) +NUMPY_GE_200 = numpy_version >= Version("2") + pandas_version = Version(pd.__version__) try: if pandas_version >= Version('1.3.0'): diff --git a/holoviews/tests/core/test_dimensions.py b/holoviews/tests/core/test_dimensions.py index bb3052b3fd..7b79e1bcea 100644 --- a/holoviews/tests/core/test_dimensions.py +++ b/holoviews/tests/core/test_dimensions.py @@ -3,9 +3,9 @@ """ import numpy as np import pandas as pd -from packaging.version import Version from holoviews.core import Dimension, Dimensioned +from holoviews.core.util import NUMPY_GE_200 from holoviews.element.comparison import ComparisonTestCase from ..utils import LoggingComparisonTestCase @@ -244,7 +244,7 @@ def test_tuple_clone(self): class DimensionDefaultTest(ComparisonTestCase): def test_validate_default_against_values(self): - if Version(np.__version__) >= Version('2.0.0a0'): + if NUMPY_GE_200: msg = r"Dimension\('A'\) default 1\.1 not found in declared values: \[np\.int64\(0\), np\.int64\(1\)\]" else: msg = r"Dimension\('A'\) default 1\.1 not found in declared values: \[0, 1\]" diff --git a/holoviews/tests/element/test_comparisondimension.py b/holoviews/tests/element/test_comparisondimension.py index 338f44c434..b4125b1466 100644 --- a/holoviews/tests/element/test_comparisondimension.py +++ b/holoviews/tests/element/test_comparisondimension.py @@ -1,10 +1,9 @@ """ Test cases for Dimension and Dimensioned object comparison. """ -import numpy as np -from packaging.version import Version from holoviews.core import Dimension, Dimensioned +from holoviews.core.util import NUMPY_GE_200 from holoviews.element.comparison import ComparisonTestCase @@ -77,7 +76,7 @@ def test_dimension_comparison_values_unequal(self): try: self.assertEqual(self.dimension4, self.dimension8) except AssertionError as e: - if Version(np.__version__) >= Version('2.0.0a0'): + if NUMPY_GE_200: msg = "Dimension parameter 'values' mismatched: [] != [np.str_('a'), np.str_('b')]" else: msg = "Dimension parameter 'values' mismatched: [] != ['a', 'b']" diff --git a/holoviews/tests/test_streams.py b/holoviews/tests/test_streams.py index 17cb93bc30..a745ccc48c 100644 --- a/holoviews/tests/test_streams.py +++ b/holoviews/tests/test_streams.py @@ -11,7 +11,7 @@ import holoviews as hv from holoviews.core.spaces import DynamicMap -from holoviews.core.util import Version +from holoviews.core.util import NUMPY_GE_200, Version from holoviews.element import Curve, Histogram, Points, Polygons, Scatter from holoviews.element.comparison import ComparisonTestCase from holoviews.streams import * # noqa (Test all available streams) @@ -1421,6 +1421,7 @@ def test_selection_expr_stream_hist_invert_xaxis_yaxis(self): def test_selection_expr_stream_polygon_index_cols(self): + # TODO: Should test both spatialpandas and shapely # Create SelectionExpr on element try: import shapely # noqa except ImportError: @@ -1444,10 +1445,12 @@ def test_selection_expr_stream_polygon_index_cols(self): self.assertIsNone(expr_stream.bbox) self.assertIsNone(expr_stream.selection_expr) + format = lambda x: list(map(np.str_, x)) if NUMPY_GE_200 else x + expr_stream.input_streams[2].event(index=[0, 1]) self.assertEqual( repr(expr_stream.selection_expr), - repr(dim('cat').isin(['a', 'b'])) + repr(dim('cat').isin(format(['a', 'b']))) ) self.assertEqual(expr_stream.bbox, None) self.assertEqual(len(events), 1) @@ -1456,7 +1459,7 @@ def test_selection_expr_stream_polygon_index_cols(self): expr_stream.input_streams[0].event(bounds=(0, 0, 4, 1)) self.assertEqual( repr(expr_stream.selection_expr), - repr(dim('cat').isin(['a', 'b'])) + repr(dim('cat').isin(format(['a', 'b']))) ) self.assertEqual(len(events), 1) @@ -1464,7 +1467,7 @@ def test_selection_expr_stream_polygon_index_cols(self): expr_stream.input_streams[1].event(geometry=np.array([(0, 0), (4, 0), (4, 2), (0, 2)])) self.assertEqual( repr(expr_stream.selection_expr), - repr(dim('cat').isin(['a', 'b', 'c'])) + repr(dim('cat').isin(format(['a', 'b', 'c']))) ) self.assertEqual(len(events), 2) @@ -1472,7 +1475,7 @@ def test_selection_expr_stream_polygon_index_cols(self): expr_stream.input_streams[2].event(index=[1, 2]) self.assertEqual( repr(expr_stream.selection_expr), - repr(dim('cat').isin(['b', 'c'])) + repr(dim('cat').isin(format(['b', 'c']))) ) self.assertEqual(expr_stream.bbox, None) self.assertEqual(len(events), 3) diff --git a/pixi.toml b/pixi.toml index 23692e7a24..08e099c212 100644 --- a/pixi.toml +++ b/pixi.toml @@ -49,7 +49,6 @@ python = "3.11.*" [feature.py312.dependencies] python = "3.12.*" - [feature.example.dependencies] cftime = "*" dask-core = "*" From 478eecc9bd7cf749200f4c4ef40220b615401c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 18 May 2024 13:39:10 +0200 Subject: [PATCH 04/14] Update holoviews/tests/element/test_comparisondimension.py --- holoviews/tests/element/test_comparisondimension.py | 1 - 1 file changed, 1 deletion(-) diff --git a/holoviews/tests/element/test_comparisondimension.py b/holoviews/tests/element/test_comparisondimension.py index b4125b1466..8e5f5daffe 100644 --- a/holoviews/tests/element/test_comparisondimension.py +++ b/holoviews/tests/element/test_comparisondimension.py @@ -1,7 +1,6 @@ """ Test cases for Dimension and Dimensioned object comparison. """ - from holoviews.core import Dimension, Dimensioned from holoviews.core.util import NUMPY_GE_200 from holoviews.element.comparison import ComparisonTestCase From 018b276ba0154656659cec1265304823d3048dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 18 May 2024 19:30:25 +0200 Subject: [PATCH 05/14] Move up to unit test suite --- .github/workflows/test.yaml | 4 ++-- pixi.toml | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e6b8c5d91d..bd563974e7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -85,7 +85,7 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest", "macos-latest", "windows-latest"], - "environment": ["test-39", "test-312"] + "environment": ["test-39", "test-312", "test-numpy"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'full' option @@ -187,7 +187,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - environment: ["test-core", "test-numpy"] + environment: ["test-core"] timeout-minutes: 120 steps: - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi diff --git a/pixi.toml b/pixi.toml index 08e099c212..4fb238aeb6 100644 --- a/pixi.toml +++ b/pixi.toml @@ -15,7 +15,7 @@ test-311 = ["py311", "test-core", "test", "example", "test-example", "test-unit- test-312 = ["py312", "test-core", "test", "example", "test-example", "test-unit-task"] test-ui = ["py312", "test-core", "test", "test-ui"] test-core = ["py312", "test-core", "test-unit-task"] -test-numpy = ["py312", "test-core", "test-unit-task", "np2"] +test-numpy = ["py312", "test-core", "test-unit-task", "np2", "test-example"] test-gpu = ["py311", "test-core", "test", "test-gpu"] docs = ["py311", "example", "doc"] build = ["py311", "build"] @@ -141,10 +141,11 @@ channels = ["pyviz/label/dev", "conda-forge/label/numpy_rc", "conda-forge"] [feature.np2.dependencies] numpy = "2.*" -# test dependencies without Numba +# test dependencies cftime = "*" contourpy = "*" dask-core = "*" +# datashader = ">=0.11.1" ffmpeg = "*" ibis-sqlite = "*" nbconvert = "*" @@ -153,9 +154,18 @@ pillow = "*" scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 selenium = "*" shapely = "*" +# spatialpandas = "*" xarray = ">=0.10.4" xyzservices = "*" +# Examples (removed duplicates) +netcdf4 = "*" +notebook = "*" +pooch = "*" +# pyarrow = "*" +# scikit-image = "*" +streamz = ">=0.5.0" + # ============================================= # =================== DOCS ==================== # ============================================= From abc35a855529a9023937e6d93fc09b09f1ddb3b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 18 May 2024 19:37:50 +0200 Subject: [PATCH 06/14] Comment datashader for check-latest-packages --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bd563974e7..fbd70d0c75 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -129,7 +129,7 @@ jobs: - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} check-latest-packages bokeh panel param datashader + pixi run -e ${{ matrix.environment }} check-latest-packages bokeh panel param # datashader - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | From c9912b20ee766d7ebe857d359f9ca36df7529301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 18 May 2024 19:55:27 +0200 Subject: [PATCH 07/14] Ignore examples which uses datashader --- examples/conftest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/conftest.py b/examples/conftest.py index 22dced7136..6969487409 100644 --- a/examples/conftest.py +++ b/examples/conftest.py @@ -1,6 +1,7 @@ import os import platform import sys +from importlib.util import find_spec import bokeh import pandas as pd @@ -62,6 +63,17 @@ "user_guide/Plotting_with_Matplotlib.ipynb", ] +# 2024-05: Numpy 2.0 +if find_spec("datashader") is None: + collect_ignore_glob += [ + "reference/elements/matplotlib/ImageStack.ipynb", + "reference/elements/plotly/ImageStack.ipynb", + "user_guide/15-Large_Data.ipynb", + "user_guide/16-Streaming_Data.ipynb", + "user_guide/Linked_Brushing.ipynb", + "user_guide/Network_Graphs.ipynb", + ] + def pytest_runtest_makereport(item, call): """ From c6ca4098685ffb4c2adba2c40f0ac69ad3c1cf05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 18 May 2024 21:42:17 +0200 Subject: [PATCH 08/14] Update sheetcoords.py --- holoviews/core/sheetcoords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/holoviews/core/sheetcoords.py b/holoviews/core/sheetcoords.py index 7c5e665c12..690a55d709 100644 --- a/holoviews/core/sheetcoords.py +++ b/holoviews/core/sheetcoords.py @@ -365,7 +365,7 @@ def __new__(cls, bounds, sheet_coordinate_system, force_odd=False, else: slicespec=Slice._boundsspec2slicespec(bounds.lbrt(),sheet_coordinate_system) # Using numpy.int32 for legacy reasons - a = np.array(slicespec, dtype=np.int32).view(cls) + a = np.asarray(slicespec, dtype=np.int32).view(cls) return a From 3164cfa5da8536bd8db625c68914451fd056710b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sun, 19 May 2024 10:57:05 +0200 Subject: [PATCH 09/14] Rename to fmt --- holoviews/tests/test_streams.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/holoviews/tests/test_streams.py b/holoviews/tests/test_streams.py index a745ccc48c..2bc957f679 100644 --- a/holoviews/tests/test_streams.py +++ b/holoviews/tests/test_streams.py @@ -1445,12 +1445,12 @@ def test_selection_expr_stream_polygon_index_cols(self): self.assertIsNone(expr_stream.bbox) self.assertIsNone(expr_stream.selection_expr) - format = lambda x: list(map(np.str_, x)) if NUMPY_GE_200 else x + fmt = lambda x: list(map(np.str_, x)) if NUMPY_GE_200 else x expr_stream.input_streams[2].event(index=[0, 1]) self.assertEqual( repr(expr_stream.selection_expr), - repr(dim('cat').isin(format(['a', 'b']))) + repr(dim('cat').isin(fmt(['a', 'b']))) ) self.assertEqual(expr_stream.bbox, None) self.assertEqual(len(events), 1) @@ -1459,7 +1459,7 @@ def test_selection_expr_stream_polygon_index_cols(self): expr_stream.input_streams[0].event(bounds=(0, 0, 4, 1)) self.assertEqual( repr(expr_stream.selection_expr), - repr(dim('cat').isin(format(['a', 'b']))) + repr(dim('cat').isin(fmt(['a', 'b']))) ) self.assertEqual(len(events), 1) @@ -1467,7 +1467,7 @@ def test_selection_expr_stream_polygon_index_cols(self): expr_stream.input_streams[1].event(geometry=np.array([(0, 0), (4, 0), (4, 2), (0, 2)])) self.assertEqual( repr(expr_stream.selection_expr), - repr(dim('cat').isin(format(['a', 'b', 'c']))) + repr(dim('cat').isin(fmt(['a', 'b', 'c']))) ) self.assertEqual(len(events), 2) @@ -1475,7 +1475,7 @@ def test_selection_expr_stream_polygon_index_cols(self): expr_stream.input_streams[2].event(index=[1, 2]) self.assertEqual( repr(expr_stream.selection_expr), - repr(dim('cat').isin(format(['b', 'c']))) + repr(dim('cat').isin(fmt(['b', 'c']))) ) self.assertEqual(expr_stream.bbox, None) self.assertEqual(len(events), 3) From c9a4f36bee54c7b144c65800db63697077ac273d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sun, 19 May 2024 11:26:17 +0200 Subject: [PATCH 10/14] Rename feature to numpy2 --- pixi.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pixi.toml b/pixi.toml index 4fb238aeb6..1c8bf13fec 100644 --- a/pixi.toml +++ b/pixi.toml @@ -15,7 +15,7 @@ test-311 = ["py311", "test-core", "test", "example", "test-example", "test-unit- test-312 = ["py312", "test-core", "test", "example", "test-example", "test-unit-task"] test-ui = ["py312", "test-core", "test", "test-ui"] test-core = ["py312", "test-core", "test-unit-task"] -test-numpy = ["py312", "test-core", "test-unit-task", "np2", "test-example"] +test-numpy = ["py312", "test-core", "test-unit-task", "numpy2", "test-example"] test-gpu = ["py311", "test-core", "test", "test-gpu"] docs = ["py311", "example", "doc"] build = ["py311", "build"] @@ -135,10 +135,10 @@ rmm = { version = "*", channel = "rapidsai" } [feature.test-gpu.tasks] test-gpu = { cmd = "pytest holoviews/tests --gpu", env = { NUMBA_CUDA_LOW_OCCUPANCY_WARNINGS = '0' } } -[feature.np2] +[feature.numpy2] channels = ["pyviz/label/dev", "conda-forge/label/numpy_rc", "conda-forge"] -[feature.np2.dependencies] +[feature.numpy2.dependencies] numpy = "2.*" # test dependencies From 4e81f3ce7a41fb1418e8ca062fbf6e2e6ab0d457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sun, 19 May 2024 13:31:24 +0200 Subject: [PATCH 11/14] Update holoviews/tests/element/test_comparisondimension.py --- holoviews/tests/element/test_comparisondimension.py | 1 + 1 file changed, 1 insertion(+) diff --git a/holoviews/tests/element/test_comparisondimension.py b/holoviews/tests/element/test_comparisondimension.py index 8e5f5daffe..3bdfb04c4e 100644 --- a/holoviews/tests/element/test_comparisondimension.py +++ b/holoviews/tests/element/test_comparisondimension.py @@ -80,6 +80,7 @@ def test_dimension_comparison_values_unequal(self): else: msg = "Dimension parameter 'values' mismatched: [] != ['a', 'b']" self.assertEqual(str(e), msg) + def test_dimension_comparison_types_unequal(self): try: self.assertEqual(self.dimension9, self.dimension10) From 097d9d187ff83635bef5965c2f9136838bbfc6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sun, 19 May 2024 14:24:57 +0200 Subject: [PATCH 12/14] Only run numpy 2 environment on Ubuntu --- .github/workflows/test.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fbd70d0c75..a9b98bb3d6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -85,7 +85,10 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest", "macos-latest", "windows-latest"], - "environment": ["test-39", "test-312", "test-numpy"] + "environment": ["test-39", "test-312"], + "include": [ + { "os": "ubuntu-latest", "environment": "test-numpy" } + ] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'full' option @@ -93,7 +96,10 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest", "macos-latest", "windows-latest"], - "environment": ["test-39", "test-310", "test-311", "test-312"] + "environment": ["test-39", "test-310", "test-311", "test-312"], + "include": [ + { "os": "ubuntu-latest", "environment": "test-numpy" } + ] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'downstream' option From 31155be6ad1864a7ee5ac7e9563a38a43a1f74d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 23 May 2024 16:20:25 +0200 Subject: [PATCH 13/14] Try with latest dev datashader --- .github/workflows/test.yaml | 2 +- pixi.toml | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a9b98bb3d6..1a8340ad1d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -135,7 +135,7 @@ jobs: - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} check-latest-packages bokeh panel param # datashader + pixi run -e ${{ matrix.environment }} check-latest-packages bokeh panel param datashader - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | diff --git a/pixi.toml b/pixi.toml index 1c8bf13fec..bf8e0bd0c3 100644 --- a/pixi.toml +++ b/pixi.toml @@ -136,16 +136,18 @@ rmm = { version = "*", channel = "rapidsai" } test-gpu = { cmd = "pytest holoviews/tests --gpu", env = { NUMBA_CUDA_LOW_OCCUPANCY_WARNINGS = '0' } } [feature.numpy2] -channels = ["pyviz/label/dev", "conda-forge/label/numpy_rc", "conda-forge"] +channels = ["pyviz/label/dev", "conda-forge/label/numpy_rc", "numba/label/dev", "conda-forge"] [feature.numpy2.dependencies] numpy = "2.*" +numba = { version = "0.60.*", channel = "numba/label/dev" } +llvmlite = { version = "*", channel = "numba/label/dev" } # test dependencies cftime = "*" contourpy = "*" dask-core = "*" -# datashader = ">=0.11.1" +datashader = ">=0.11.1" ffmpeg = "*" ibis-sqlite = "*" nbconvert = "*" @@ -159,7 +161,7 @@ xarray = ">=0.10.4" xyzservices = "*" # Examples (removed duplicates) -netcdf4 = "*" +# netcdf4 = "*" notebook = "*" pooch = "*" # pyarrow = "*" From 1de5b0c6d8adb2987ca8feec15e3f7163a90a6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 23 May 2024 17:01:42 +0200 Subject: [PATCH 14/14] Ignore scikit-image notebook when not available [skip ci] --- examples/conftest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/conftest.py b/examples/conftest.py index 6969487409..588cabb548 100644 --- a/examples/conftest.py +++ b/examples/conftest.py @@ -74,6 +74,11 @@ "user_guide/Network_Graphs.ipynb", ] +if find_spec("scikit-image"): + collect_ignore_glob += [ + "user_guide/Network_Graphs.ipynb", + ] + def pytest_runtest_makereport(item, call): """