achael / eht-imaging

Imaging, analysis, and simulation software for radio interferometry
https://achael.github.io/eht-imaging/
GNU General Public License v3.0
5.29k stars 496 forks source link

remove deprecated numpy bool dtype import #163

Closed dkloving closed 1 year ago

dkloving commented 1 year ago

This PR removes unneeded import of bool from numpy which is now deprecated. The change allows installation and use of eht-imaging in environments that require numpy >= 1.24.

Note: see here for where the breaking numpy change was made.

wumpus commented 1 year ago

What happens with old numpy versions and this patch? Is there some numpy version way earlier than 1.24 where np.bool behaves differently from the builtin bool?

dkloving commented 1 year ago

What happens with old numpy versions and this patch? Is there some numpy version way earlier than 1.24 where np.bool behaves differently from the builtin bool?

Sorry for the delayed response.

I looked into this and as far as I can tell np.bool has always been an alias for Python's built-in bool datatype, so the proposed change should have no effect on users of earlier versions.

wumpus commented 1 year ago

I did some googling and it appears that the (lack of?) wisdom of the Internet agrees with you -- it's a safe change even on older software.

wumpus commented 1 year ago

Oh, just noticed -- you should do your PR against the "dev" branch from your dev branch.

achael commented 1 year ago

I changed the base branch to "dev." This PR is a good reminder that we should revisit the whole oifits i/o in ehtim - it is not often used and is probably out of date.