-
Notifications
You must be signed in to change notification settings - Fork 876
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
build against NPY2 #3894
build against NPY2 #3894
Changes from all commits
75ebb33
308e6e4
1e5829b
bc1c73e
862c454
f002973
669169a
9f4b730
33f0d52
a65192f
f171fe4
a411c4b
d1a4c80
dc1d719
b272664
c979ff8
2e0940c
23e62f1
dbd0289
88a496d
d6b1307
062fd55
16f3cf4
3c4695e
f0865f0
17b325f
1dfc9e4
33d521c
9daedbb
ddef216
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,8 @@ class LinearAssignment: | |
""" | ||
|
||
def __init__(self, costs, epsilon=1e-13): | ||
self.orig_c = np.array(costs, dtype=np.float_, copy=False, order="C") | ||
# https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @janosh This doesn't look like something we should keep inside the code (it's pretty easy to find)? What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm generally in favor of linking relevant docs. even if easy to find, people might not think to look for them. but no strong opinion in this case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one looks more like a "disposable" migration guide which we would only do once :) |
||
self.orig_c = np.asarray(costs, dtype=np.float64, order="C") | ||
self.nx, self.ny = self.orig_c.shape | ||
self.n = self.ny | ||
|
||
|
@@ -63,7 +64,7 @@ class LinearAssignment: | |
if self.nx == self.ny: | ||
self.c = self.orig_c | ||
else: | ||
self.c = np.zeros((self.n, self.n), dtype=np.float_) | ||
self.c = np.zeros((self.n, self.n), dtype=np.float64) | ||
self.c[:self.nx] = self.orig_c | ||
|
||
# initialize solution vectors | ||
|
@@ -76,15 +77,15 @@ class LinearAssignment: | |
|
||
@cython.boundscheck(False) | ||
@cython.wraparound(False) | ||
cdef np.float_t compute(int size, np.float_t[:, :] c, np.int_t[:] x, np.int_t[:] y, np.float_t eps) nogil: | ||
cdef np.float_t compute(int size, np.float_t[:, :] c, np.int64_t[:] x, np.int64_t[:] y, np.float_t eps) nogil: | ||
|
||
# augment | ||
cdef int i, j, k, i1, j1, f, f0, cnt, low, up, z, last, nrr | ||
cdef int n = size | ||
cdef bint b | ||
cdef np.int_t * col = <np.int_t *> malloc(n * sizeof(np.int_t)) | ||
cdef np.int_t * fre = <np.int_t *> malloc(n * sizeof(np.int_t)) | ||
cdef np.int_t * pred = <np.int_t *> malloc(n * sizeof(np.int_t)) | ||
cdef np.int64_t * col = <np.int64_t *> malloc(n * sizeof(np.int64_t)) | ||
cdef np.int64_t * fre = <np.int64_t *> malloc(n * sizeof(np.int64_t)) | ||
cdef np.int64_t * pred = <np.int64_t *> malloc(n * sizeof(np.int64_t)) | ||
cdef np.float_t * v = <np.float_t *> malloc(n * sizeof(np.float_t)) | ||
cdef np.float_t * d = <np.float_t *> malloc(n * sizeof(np.float_t)) | ||
cdef np.float_t h, m, u1, u2, cost | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janosh Janosh can I have a quick comment on this bump of
netcdf4
version here from commit 1dfc9e4?It seems to cause CI failure (more details on #4128 (comment)) in Ubuntu CI runner for
netcdf4>=1.7.1.post1
(1.7.1 is yanked),1.6.5
seems to work thoughI also tried to install
delvewheel
but doesn't seem to helpThere seem to be a lot of discussion around this error but didn't see a solid solution yet. And the issue for me is that I cannot recreate this with my local Ubuntu machine (with exactly the same dependency versions).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
netcdf
needed to be bumped in #3894 to fix the following CI errors:if it's causing problems again and this time downgrading helps, by all means let's do it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current
pymatgen
dependency declare has duplicate (would be fixed #4128), you must have been mislead too :)The
netcdf4
bumped is not really the one installed in CI (the one inoptional
section is the one actually installed in CI, surely you know):pymatgen/.github/workflows/test.yml
Lines 41 to 44 in 3ee17e2
pymatgen/pyproject.toml
Line 95 in 3ee17e2
pymatgen/pyproject.toml
Lines 100 to 113 in 3ee17e2
So it still installed:
+ netcdf4==1.6.5
I looked into the error log again, and turns out it's
+ netcdf4==1.7.1.post1
causing the following error:So I might revert that pin to
<1.7.1.post1
and (1.7.1.post2 also triggers error), same for latest 1.7.2It's a huge headache because I cannot recreate these errors locally, which make things very hard.