Open adehecq opened 3 months ago
@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.
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!
@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 https://github.com/nasa-jpl/autoRIFT/compare/master...relativeorbit:autoRIFT:condaInstall.
The PR above fixes the lingering np.asscalar
s . 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)
@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.
Since version 1.24, numpy has deprecated the aliases
np.bool
andnp.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 ofnp.bool
withbool
andnp.int
withint
.Also
np.asscalar
has also been removed in version 1.23. I think it can be safely replaced by callingint()
instead.