From 6d6c83d0c19d137af99cab2882fea3081a1d4852 Mon Sep 17 00:00:00 2001 From: Corwin Kerr Date: Fri, 21 Jun 2024 15:08:11 -0400 Subject: [PATCH] Apply numpy 2 migrations for _ types in tests (#61) * Apply numpy 2 migrations for _ types in tests * Bump numpy to 2.0.0 in optional tests * Add Corwin to contributors * Update changelog * Remove double listing of types Co-authored-by: Bradley Dice * Bump oldest numpy to first one with macos arm wheels --------- Co-authored-by: Bradley Dice --- .github/workflows/ci-oldest-reqs.txt | 2 +- changelog.txt | 7 +++++++ contributors.yaml | 5 +++++ requirements/requirements-test-optional.txt | 2 +- tests/synced_collection_test.py | 2 -- tests/test_validators.py | 6 +++--- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-oldest-reqs.txt b/.github/workflows/ci-oldest-reqs.txt index 5032aa5..a2a2dd6 100644 --- a/.github/workflows/ci-oldest-reqs.txt +++ b/.github/workflows/ci-oldest-reqs.txt @@ -1,5 +1,5 @@ coverage==5.3.1 -numpy==1.19.0 +numpy==1.21.0 pymongo==3.10.0 pytest==6.2.1 pytest-cov==2.10.1 diff --git a/changelog.txt b/changelog.txt index 314d335..f4c0284 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,13 @@ Changelog The **synced_collections** package follows `semantic versioning `_. +[1.0.1] -- 2024-xx-xx +--------------------- + +Fixed ++++++ + +- Tests run with numpy 2.0. [1.0.0] -- 2023-05-17 ===================== diff --git a/contributors.yaml b/contributors.yaml index 4011bac..de3eda0 100644 --- a/contributors.yaml +++ b/contributors.yaml @@ -42,4 +42,9 @@ contributors: family-names: Mahapatra given-names: Onkar affiliation: "Cluster Innovation Centre, New Delhi" + - + family-names: Kerr + given-names: "Corwin B." + affiliation: "University of Michigan" + orcid: "https://orcid.org/0000-0003-0776-2596" ... diff --git a/requirements/requirements-test-optional.txt b/requirements/requirements-test-optional.txt index c6dbb07..ec670aa 100644 --- a/requirements/requirements-test-optional.txt +++ b/requirements/requirements-test-optional.txt @@ -1,4 +1,4 @@ -numpy==1.26.4 +numpy==2.0.0 pymongo==4.6.3; implementation_name=='cpython' redis==5.0.3 zarr==2.17.1; platform_system!='Windows' diff --git a/tests/synced_collection_test.py b/tests/synced_collection_test.py index c64efd5..e088e3c 100644 --- a/tests/synced_collection_test.py +++ b/tests/synced_collection_test.py @@ -53,7 +53,6 @@ numpy.longdouble, numpy.float32, numpy.float64, - numpy.float_, ) NUMPY_COMPLEX_TYPES: Tuple[Type, ...] = ( @@ -62,7 +61,6 @@ numpy.clongdouble, numpy.complex64, numpy.complex128, - numpy.complex_, ) NUMPY_SHAPES: Tuple[Any, ...] = (None, (1,), (2,), (2, 2)) diff --git a/tests/test_validators.py b/tests/test_validators.py index 9cb1040..2600eb7 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -79,12 +79,12 @@ def test_dict_data(self, testdata): def test_numpy_data(self): data = numpy.random.rand(3, 4) json_format_validator(data) - json_format_validator(numpy.float_(3.14)) + json_format_validator(numpy.float64(3.14)) # numpy data as dict value json_format_validator({"test": data}) - json_format_validator({"test": numpy.float_(1.0)}) + json_format_validator({"test": numpy.float64(1.0)}) # numpy data in list - json_format_validator([data, numpy.float_(1.0), 1, "test"]) + json_format_validator([data, numpy.float64(1.0), 1, "test"]) def test_invalid_data(self): class A: