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

Deprecated numpy functions #97

Open
adehecq opened this issue May 23, 2024 · 4 comments
Open

Deprecated numpy functions #97

adehecq opened this issue May 23, 2024 · 4 comments
Milestone

Comments

@adehecq
Copy link

adehecq commented May 23, 2024

Since version 1.24, numpy has deprecated the aliases np.bool and np.int, which are still used at numerous occasions in autorift, leaving the user with an AttributeError.
It can be easily fixed by replacing all occurrence of np.bool with bool and np.int with int.

Also np.asscalar has also been removed in version 1.23. I think it can be safely replaced by calling int() instead.

@adehecq adehecq changed the title Deprecated numpy function Deprecated numpy functions May 23, 2024
@jhkennedy
Copy link
Contributor

@adehecq this was largely done in #88, but some of the un-distributed scripts were missed, and I don't think np.assscalar was checked for either.

If you have time, I'll happily review a PR, merge, and cut a new release. Otherwise, it will take me a bit to get to this.

@adehecq
Copy link
Author

adehecq commented May 27, 2024

Hi @jhkennedy,

yes, I was thinking about submitting a PR, but I was working on the conda install directly, not on a clone of the repository.
I tried cloning the repository and running python setup.py install as recommended in the installation notes but I get the following error:
"geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp:43:10: fatal error: opencv2/imgproc/imgproc.hpp: No such file or directory"
(also the setup.py raises a DeprecationWarning).
Note that I'm installing directly in the conda environment that I created for installing autorift in the first place, and that already installed all dependencies, as I could not find an environment file in this repository.
Could you please indicate the way to go forward?
Thanks!

@scottyhq
Copy link

scottyhq commented May 29, 2024

@adehecq @jhkennedy looks like setup.py is assuming a linux machine with paths to library files that don't necessarily match opencv installed from conda. We were recently working around this by adding a path to the hpp files under the conda environment directory, see master...relativeorbit:autoRIFT:condaInstall.

The PR above fixes the lingering np.asscalars . Would be great to have a release on pypi (and conda-forge) to simplify installing and compatible with numpy>1.23 (and soon-to-be-released numpy2)

@jhkennedy
Copy link
Contributor

jhkennedy commented May 30, 2024

@adehecq to install into an existing conda environment, I think you can do:

python -m pip install --global-option=build_ext --global-option="-I${CONDA_PREFIX}/include/opencv4" .

based on the conda-forge recipe:
https://github.com/conda-forge/autorift-feedstock/blob/main/recipe/meta.yaml#L18

@scottyhq I agree we should add an environment.yml file, and I'd be happy to review a PR for that.

Really, the entire build and packaging system needs to be reworked, and quite a bit of geogrid/autorift could be refactored for usability. I'm planning later this summer or maybe early fall to start in on that.

@jhkennedy jhkennedy added this to the v1.6.0 milestone Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants