axiom-data-science / extract_model

Facilitates read-in and extraction for ocean model output.
https://extract-model.readthedocs.io/
MIT License
5 stars 4 forks source link

np.bool deprecated #91

Open ChrisBarker-NOAA opened 1 year ago

ChrisBarker-NOAA commented 1 year ago

extract_model does not work with numpy >= 1.24

File ... lib\site-packages\extract_model\grids\triangular_mesh.py:386, in UnstructuredGridSubset._get_intersecting_mask(self, x, y, element, bbox)
    384 """Return a mask for the region subsetted by bbox."""
    385 # The mask that will represent only valid elements
--> 386 mask = np.ones((element.shape[0]), dtype=np.bool)
    388 self._mask_disjoint_triangles(x, y, element, bbox, mask)
    389 submask, _ = self._mask_triangles_with_no_points_in_box(
    390     x, y, element, bbox, mask
    391 )
kthyng commented 1 year ago

I think this is covered already? https://github.com/axiom-data-science/extract_model/blob/c47b718711cfc4d659dc67daf483f0602f9896bd/setup.cfg#L59

ChrisBarker-NOAA commented 1 year ago

did that make it into the conda package? we've had failures.

But we really should get that fixed -- it's an easy change, and pinning numpy can have repercussions ...

-CHB

ChrisBarker-NOAA commented 1 year ago

I jsut looked at the conda-forge recipe, and it is pinned -- no not sure how we got this incompatibility in an environment.

But still good to address this sooner than later.

ChrisBarker-NOAA commented 1 year ago

Now I"m really confused -- I msut have had a brain blip -- you fixed this in January:

85246cf1 (Kristen Thyng 2023-01-23 13:06:05 -0600 386)         mask = np.ones((element.shape[0]), dtype=bool)

So does it need to be pinned anymore? ( lat release Jan 27 -- so the fix should be in there, yes?)

(we must have been working with an old version -- though not sure how that happened)

I'm not going to close this, 'cause you may be able to unpin numpy.

kthyng commented 1 year ago

Hm that is indeed confusing. My concern about unpinning is I recall the numpy version being an issue for several packages but I can't quite remember the details to know if it was as simple as this or more involved.