From b0d1afe2ab6a9dd6584297d6fb991afbf08e5582 Mon Sep 17 00:00:00 2001 From: Michael Ekstrand Date: Sat, 2 Mar 2024 20:01:58 -0500 Subject: [PATCH 1/3] Bump Pandas and NumPy versions --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f02b6cb60..5ccdba719 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,9 +22,9 @@ readme = "README.md" license = { file = "LICENSE.md" } dynamic = ["version"] dependencies = [ - "pandas >=1.4, <2", - "numpy >= 1.22", - "scipy >= 1.8.0", + "pandas >=1.5, <3", + "numpy >= 1.23", + "scipy >= 1.9.0", "numba >= 0.56, < 0.59", "cffi >= 1.15.0", "threadpoolctl >=3.0", From 6a9fadd73c94c8ca3721c8c4b15949295b20855e Mon Sep 17 00:00:00 2001 From: Michael Ekstrand Date: Sat, 2 Mar 2024 20:03:16 -0500 Subject: [PATCH 2/3] rerender environments --- envs/lenskit-py3.10-ci.yaml | 6 +++--- envs/lenskit-py3.10-dev.yaml | 9 ++++----- envs/lenskit-py3.10-doc.yaml | 6 +++--- envs/lenskit-py3.10-test.yaml | 6 +++--- envs/lenskit-py3.11-ci.yaml | 6 +++--- envs/lenskit-py3.11-dev.yaml | 9 ++++----- envs/lenskit-py3.11-doc.yaml | 6 +++--- envs/lenskit-py3.11-test.yaml | 6 +++--- 8 files changed, 26 insertions(+), 28 deletions(-) diff --git a/envs/lenskit-py3.10-ci.yaml b/envs/lenskit-py3.10-ci.yaml index dc545ad3d..bdd8b6859 100644 --- a/envs/lenskit-py3.10-ci.yaml +++ b/envs/lenskit-py3.10-ci.yaml @@ -17,13 +17,13 @@ dependencies: - csr>=0.5 - hypothesis>=6 - numba<0.59,>=0.56 - - numpy>=1.22 - - pandas<2,>=1.4 + - numpy>=1.23 + - pandas<3,>=1.5 - pytest-cov>=2.12 - pytest-doctestplus>=0.9 - pytest==7.* - scikit-learn>=1.1 - - scipy>=1.8.0 + - scipy>=1.9.0 - seedbank>=0.1.0 - tbb - threadpoolctl>=3.0 diff --git a/envs/lenskit-py3.10-dev.yaml b/envs/lenskit-py3.10-dev.yaml index fe53917a9..21e400180 100644 --- a/envs/lenskit-py3.10-dev.yaml +++ b/envs/lenskit-py3.10-dev.yaml @@ -19,7 +19,6 @@ dependencies: - docopt>=0.6 - hypothesis>=6 - invoke>=1 - - ipython - ipython>=7 - matplotlib~=3.4 - myst-nb>=0.13 @@ -27,16 +26,16 @@ dependencies: - nbval>=0.9 - notebook>=6 - numba<0.59,>=0.56 - - numpy>=1.22 - - pandas<2,>=1.4 - - pyproject2conda + - numpy>=1.23 + - pandas<3,>=1.5 + - pyproject2conda~=0.11 - pytest-cov>=2.12 - pytest-doctestplus>=0.9 - pytest==7.* - python-build==1 - ruff>=0.2 - scikit-learn>=1.1 - - scipy>=1.8.0 + - scipy>=1.9.0 - seedbank>=0.1.0 - setuptools>=64 - setuptools_scm>=8 diff --git a/envs/lenskit-py3.10-doc.yaml b/envs/lenskit-py3.10-doc.yaml index c2f9a687a..0dc9b23a4 100644 --- a/envs/lenskit-py3.10-doc.yaml +++ b/envs/lenskit-py3.10-doc.yaml @@ -16,9 +16,9 @@ dependencies: - csr>=0.5 - myst-nb>=0.13 - numba<0.59,>=0.56 - - numpy>=1.22 - - pandas<2,>=1.4 - - scipy>=1.8.0 + - numpy>=1.23 + - pandas<3,>=1.5 + - scipy>=1.9.0 - seedbank>=0.1.0 - sphinx>=4.2 - sphinx_rtd_theme>=0.5 diff --git a/envs/lenskit-py3.10-test.yaml b/envs/lenskit-py3.10-test.yaml index 0f4a6e743..134700e97 100644 --- a/envs/lenskit-py3.10-test.yaml +++ b/envs/lenskit-py3.10-test.yaml @@ -17,12 +17,12 @@ dependencies: - csr>=0.5 - hypothesis>=6 - numba<0.59,>=0.56 - - numpy>=1.22 - - pandas<2,>=1.4 + - numpy>=1.23 + - pandas<3,>=1.5 - pytest-cov>=2.12 - pytest-doctestplus>=0.9 - pytest==7.* - - scipy>=1.8.0 + - scipy>=1.9.0 - seedbank>=0.1.0 - tbb - threadpoolctl>=3.0 diff --git a/envs/lenskit-py3.11-ci.yaml b/envs/lenskit-py3.11-ci.yaml index e6dc81250..feb0fffb7 100644 --- a/envs/lenskit-py3.11-ci.yaml +++ b/envs/lenskit-py3.11-ci.yaml @@ -17,13 +17,13 @@ dependencies: - csr>=0.5 - hypothesis>=6 - numba<0.59,>=0.56 - - numpy>=1.22 - - pandas<2,>=1.4 + - numpy>=1.23 + - pandas<3,>=1.5 - pytest-cov>=2.12 - pytest-doctestplus>=0.9 - pytest==7.* - scikit-learn>=1.1 - - scipy>=1.8.0 + - scipy>=1.9.0 - seedbank>=0.1.0 - tbb - threadpoolctl>=3.0 diff --git a/envs/lenskit-py3.11-dev.yaml b/envs/lenskit-py3.11-dev.yaml index ea9ccccb1..3df3dd880 100644 --- a/envs/lenskit-py3.11-dev.yaml +++ b/envs/lenskit-py3.11-dev.yaml @@ -19,7 +19,6 @@ dependencies: - docopt>=0.6 - hypothesis>=6 - invoke>=1 - - ipython - ipython>=7 - matplotlib~=3.4 - myst-nb>=0.13 @@ -27,16 +26,16 @@ dependencies: - nbval>=0.9 - notebook>=6 - numba<0.59,>=0.56 - - numpy>=1.22 - - pandas<2,>=1.4 - - pyproject2conda + - numpy>=1.23 + - pandas<3,>=1.5 + - pyproject2conda~=0.11 - pytest-cov>=2.12 - pytest-doctestplus>=0.9 - pytest==7.* - python-build==1 - ruff>=0.2 - scikit-learn>=1.1 - - scipy>=1.8.0 + - scipy>=1.9.0 - seedbank>=0.1.0 - setuptools>=64 - setuptools_scm>=8 diff --git a/envs/lenskit-py3.11-doc.yaml b/envs/lenskit-py3.11-doc.yaml index 826294f7a..c5dc1120d 100644 --- a/envs/lenskit-py3.11-doc.yaml +++ b/envs/lenskit-py3.11-doc.yaml @@ -16,9 +16,9 @@ dependencies: - csr>=0.5 - myst-nb>=0.13 - numba<0.59,>=0.56 - - numpy>=1.22 - - pandas<2,>=1.4 - - scipy>=1.8.0 + - numpy>=1.23 + - pandas<3,>=1.5 + - scipy>=1.9.0 - seedbank>=0.1.0 - sphinx>=4.2 - sphinx_rtd_theme>=0.5 diff --git a/envs/lenskit-py3.11-test.yaml b/envs/lenskit-py3.11-test.yaml index 57512ca95..d7b6bd038 100644 --- a/envs/lenskit-py3.11-test.yaml +++ b/envs/lenskit-py3.11-test.yaml @@ -17,12 +17,12 @@ dependencies: - csr>=0.5 - hypothesis>=6 - numba<0.59,>=0.56 - - numpy>=1.22 - - pandas<2,>=1.4 + - numpy>=1.23 + - pandas<3,>=1.5 - pytest-cov>=2.12 - pytest-doctestplus>=0.9 - pytest==7.* - - scipy>=1.8.0 + - scipy>=1.9.0 - seedbank>=0.1.0 - tbb - threadpoolctl>=3.0 From c206378d5086fd03e3acfdbae5a20b51c4c4ec15 Mon Sep 17 00:00:00 2001 From: Michael Ekstrand Date: Sun, 3 Mar 2024 15:32:44 -0500 Subject: [PATCH 3/3] fix disjoint crossfold test for pandas 2 --- tests/test_crossfold.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_crossfold.py b/tests/test_crossfold.py index 4a1b38f48..cfde19283 100644 --- a/tests/test_crossfold.py +++ b/tests/test_crossfold.py @@ -4,16 +4,16 @@ # Licensed under the MIT license, see LICENSE.md for details. # SPDX-License-Identifier: MIT -import itertools as it import functools as ft -import pytest +import itertools as it import math import numpy as np -import lenskit.util.test as lktu +import pytest import lenskit.crossfold as xf +import lenskit.util.test as lktu def test_partition_rows(): @@ -104,7 +104,7 @@ def test_sample_non_disjoint(): # There are enough splits & items we should pick at least one duplicate ipairs = ( - (s1.test.set_index("user", "item").index, s2.test.set_index("user", "item").index) + (s1.test.set_index(["user", "item"]).index, s2.test.set_index(["user", "item"]).index) for (s1, s2) in it.product(splits, splits) ) isizes = [len(i1.intersection(i2)) for (i1, i2) in ipairs]