pbrod / nvector

Nvector is a suite of tools written in Python to solve geographical position calculations.
Other
58 stars 7 forks source link

NumPy version 2 fix for deprecation warnings #20

Closed mhogan-nwra closed 1 month ago

mhogan-nwra commented 4 months ago

NumPy version 2 eliminated the deprecation function. See the below link.

https://github.com/numpy/numpy/blob/c21ac104e544e24c88dbf625b6dccdbe7b90e39e/numpy/_expired_attrs_2_0.py#L61

The changes include:

  1. A new util module function deprecate that recreates the core aspects of the numpy.deprecate function.
  2. Replace all instances of np.deprecate with deprecate

Tested on:

An alternative solution is to reject this pull request and update the requirements to a more restrictive value like "numpy<2".

mhogan-nwra commented 4 months ago

I would like to add that the CI pipeline does not check my revisions. The "pytest --doctest-modules" succeeded with Numpy version 1.26, but many failed in 2.0 due to a change in the repr of numpy.bool types from "True/False" to "np.True/np.False_", respectively.

mhogan-nwra commented 2 months ago

Since this issue has not been resolved in nearly two months, I have taken matters into my own hands.

I created a new PyPI package with the name envector with a new GitHub repository with pure Python3 and NumPy 2 support.

I am making an honest effort at acknowledgement of this project moving forward. I would appreciate any comments.

pbrod commented 1 month ago

@mhogan-nwra. I have just released a new major version on nvector based on your "envector" so this is no longer an issue. Thank you for putting in the effort in envector, which showed me how to modernize nvector.

Fixed in e6596f541080a126534cecc00912ce790e14d078.