Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Numpy 2.0 #58

Open
ngoldbaum opened this issue Feb 9, 2024 · 1 comment
Open

Add support for Numpy 2.0 #58

ngoldbaum opened this issue Feb 9, 2024 · 1 comment
Labels
part: dependencies PRs that update a dependency file

Comments

@ngoldbaum
Copy link
Collaborator

__________________________ TestNumpyAdapter.test_int ___________________________

self = <csp.tests.adapters.test_numpy.TestNumpyAdapter testMethod=test_int>

    def test_int(self):
        raw_vals = [7, -13, 21]
        res = csp.run(g, typ=int, values=np.array(raw_vals), dts=test_dts_ndarray, starttime=test_starttime)
        self.assertEqual(res["out"], list(zip(test_dts, raw_vals)))
    
        for dtype in ("b", "h", "i", "l", "object"):
            res = csp.run(
                g, typ=int, values=np.array(raw_vals, dtype=dtype), dts=test_dts_ndarray, starttime=test_starttime
            )
>           self.assertEqual(res["out"], list(zip(test_dts, raw_vals)))
E           AssertionError: Lists differ: [(dat[61 chars], 1, 2, 1, 0), 243), (datetime.datetime(2000, 1, 2, 2, 0), 21)] != [(dat[61 chars], 1, 2, 1, 0), -13), (datetime.datetime(2000, 1, 2, 2, 0), 21)]
E           
E           First differing element 1:
E           (datetime.datetime(2000, 1, 2, 1, 0), 243)
E           (datetime.datetime(2000, 1, 2, 1, 0), -13)
E           
E             [(datetime.datetime(2000, 1, 1, 1, 0), 7),
E           -  (datetime.datetime(2000, 1, 2, 1, 0), 243),
E           ?                                        ^^
E           
E           +  (datetime.datetime(2000, 1, 2, 1, 0), -13),
E           ?                                        ^^
E           
E              (datetime.datetime(2000, 1, 2, 2, 0), 21)]

csp/tests/adapters/test_numpy.py:34: AssertionError

Not sure exactly what change in numpy caused this. I'm a numpy maintainer and am happy to try to look more closely at this if you'd like me to.

@timkpaine
Copy link
Member

We probably won't support numpy 2 for some time

@timkpaine timkpaine added the part: dependencies PRs that update a dependency file label Feb 10, 2024
@timkpaine timkpaine changed the title NumPy adapter test fails running NumPy 2.0 dev Add support for Numpy 2.0 Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part: dependencies PRs that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants