-
Notifications
You must be signed in to change notification settings - Fork 7
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
BUG: fix calling select_clean_data
with default isz
#201
Conversation
…clean_data, updated the show_clean_params function such that it does not crop the images when isz=None
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and fixes a couple bugs at once, thank you !
Would you feel confortable to also include a test or two ?
select_clean_data
with default isz
Sure! I have added a test for The RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 80 from C header, got 96 from PyObject Might be something specific with my installation (Python 3.11 on mac) although on Github it seems to run fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding a test ! looks good after a couple minor changes
Warnings are treated as errors so we don't let deprecation warnings slip through AMICAL :) Now, my guess is that you got a mix of pip-installed and conda-installed packages in there. For instance if you got numpy from conda and astropy from pypi, ABI compatibility is not guaranteed and these kind of warnings can pop up at any point. |
I am only using |
ah, then there's something fishy going on. These warnings may also occur when importing some C extension that was compiled against a newer version of numpy that the one you have installed. Astropy itself systematically uses the oldest version of numpy possible at compile time to prevent this, as do a lot of packages in the scientific Python ecosystem. In fact I do not know off-hand of any package that would not be doing it properly, so it's hard to know exactly what's the problem without digging into your env ! |
Updating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one issue with your test: it also passes on the main branch ! This means the test is not properly capturing the problem(s) your patch solved !
I think that might be because the images in |
If you have such a real dataset and it's small enough to be added to the repo (a couple MB at most), it'd be very useful to use that instead |
A typical dataset is much larger than a few MB. The simplest solution might be to use the images from |
This sounds like a reasonable approach. Thanks! |
Many thanks, @tomasstolker and @neutrinoceros; indeed, it's more consistent now 🙂. I agree, too, with implementing a new test to capture the centering issue that an inappropriate |
This PR implements a bit more consistent use of the
isz
parameter when the argument is set toNone
.Currently, the value could be set to
None
inselect_clean_data
, in which case the original image size is used without searching for a new image center.The
show_clean_params
did however still search for a new image center withisz=None
. I have changed the way this is implemented, so the original image center is used in that case.I have also added/changed the default value of
isz
inshow_clean_params
andselect_clean_data
toNone
. Before, the default value ofisz
was only set toNone
inclean_data
.