Skip to content

Commit

Permalink
Apply numpy 2 migrations for _ types in tests (#61)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Bump oldest numpy to first one with macos arm wheels

---------

Co-authored-by: Bradley Dice <[email protected]>
  • Loading branch information
cbkerr and bdice authored Jun 21, 2024
1 parent 4d50cac commit 6d6c83d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-oldest-reqs.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Changelog

The **synced_collections** package follows `semantic versioning <https://semver.org/>`_.

[1.0.1] -- 2024-xx-xx
---------------------

Fixed
+++++

- Tests run with numpy 2.0.

[1.0.0] -- 2023-05-17
=====================
Expand Down
5 changes: 5 additions & 0 deletions contributors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
...
2 changes: 1 addition & 1 deletion requirements/requirements-test-optional.txt
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 0 additions & 2 deletions tests/synced_collection_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
numpy.longdouble,
numpy.float32,
numpy.float64,
numpy.float_,
)

NUMPY_COMPLEX_TYPES: Tuple[Type, ...] = (
Expand All @@ -62,7 +61,6 @@
numpy.clongdouble,
numpy.complex64,
numpy.complex128,
numpy.complex_,
)
NUMPY_SHAPES: Tuple[Any, ...] = (None, (1,), (2,), (2, 2))

Expand Down
6 changes: 3 additions & 3 deletions tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6d6c83d

Please sign in to comment.