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

failed import in zoom.py on Python 3.9 #50

Open
emolter opened this issue Sep 22, 2023 · 4 comments
Open

failed import in zoom.py on Python 3.9 #50

emolter opened this issue Sep 22, 2023 · 4 comments

Comments

@emolter
Copy link

emolter commented Sep 22, 2023

This line causes an import error in Python 3.9 when trying to import chi2_shift. Simply removing it in my local Conda installation allows me to run chi2_shift, but I'm not sure what it was originally used for.

By the way, would you please be willing to publish a release of e.g. 0.2.7 soon? I've been building some packages that rely on your (amazing) tools, but pypi will not allow me to publish a release with dependencies that download directly from a GitHub page instead of from pypi. I'd be happy to help by submitting a PR if there are outstanding issues that need to be resolved before you can make a release.

@keflavich
Copy link
Owner

@emolter If you want to PR fixes like this, they're welcome. The link you posted went to the anchor #L4C33-L4C33, which doesn't actually bring me to a line. I'll try to hunt down the issue though.

Also, yes, if I can get tests passing (...I don't have much hope for getting CI running), I'll issue a new release

@keflavich
Copy link
Owner

I don't see any import error myself. Could you provide a traceback?

$ python -c "import sys, image_registration; print(sys.version, image_registration.__version__); from image_registration import chi2_shift"
3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)
[Clang 14.0.6 ] 0.2.7.dev22+ged3ea3b

@emolter
Copy link
Author

emolter commented Oct 10, 2023

I will go ahead and submit PRs for stuff like this in the future, sorry about that - I'm still getting used to the contribution workflow. It looks like you already solved this, but here is the traceback for reference:

from image_registration.chi2_shifts import chi2_shift

../../../../anaconda/envs/py39/lib/python3.9/site-packages/image_registration/init.py:14: in
from .cross_correlation_shifts import cross_correlation_shifts, cross_correlation_shifts_FITS
../../../../anaconda/envs/py39/lib/python3.9/site-packages/image_registration/cross_correlation_shifts.py:2: in
from .fft_tools import correlate2d
../../../../anaconda/envs/py39/lib/python3.9/site-packages/image_registration/fft_tools/init.py:5: in
from .upsample import dftups,upsample_image
../../../../anaconda/envs/py39/lib/python3.9/site-packages/image_registration/fft_tools/upsample.py:5: in
from . import zoom
../../../../anaconda/envs/py39/lib/python3.9/site-packages/image_registration/fft_tools/zoom.py:4: in
from matplotlib import docstring
E ImportError: cannot import name 'docstring' from 'matplotlib' (/Users/emolter/anaconda/envs/py39/lib/python3.9/site-packages/matplotlib/init.py)

@keflavich
Copy link
Owner

Yep, looks like #52 fixed it - so PRs like that are totally welcome. I now have #53 open to try to fix CI, but I can only look at it... post-JWST-deadline

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

2 participants