Skip to content

Remove unnecessary scipy imports - #13657

Merged
pllim merged 1 commit into
astropy:mainfrom
pllim:rm-dup-imports
Sep 13, 2022
Merged

pllim merged 1 commit into
astropy:mainfrom
pllim:rm-dup-imports

Conversation

@pllim

@pllim pllim commented Sep 13, 2022 •

Copy link
Copy Markdown
Member

Description

This pull request is to address comment from @dhomeier at https://github.com/astropy/astropy/pull/13654/files#r968968361 . This is a direct follow-up of #13651 .

Very uncontroversial. If CI passes, I might just YOLO-merge it.

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Do the proposed changes need the code-style fixed?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see "When to rebase and squash commits".
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the Extra CI label.
  • Is a change log needed? If yes, did the change log check pass? If no, add the no-changelog-entry-needed label. If this is a manual backport, use the skip-changelog-checks label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • Is a milestone set? Milestone must be set but astropy-bot check might be missing; do not let the green checkmark fool you.
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate backport-X.Y.x label(s) before merge.

@pllim pllim added this to the v5.0.5 milestone Sep 13, 2022
@pllim
pllim marked this pull request as ready for review September 13, 2022 13:55
@pllim
pllim requested a review from saimn as a code owner September 13, 2022 13:55
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@pllim

pllim commented Sep 13, 2022

Copy link
Copy Markdown
Member Author

Restarting the CI to see if the failure is transient.

@saimn

saimn commented Sep 13, 2022 •

Copy link
Copy Markdown
Contributor

This would work only with scipy >= 1.9.0 I think.

@pllim

pllim commented Sep 13, 2022

Copy link
Copy Markdown
Member Author

@saimn , but the oldest deps CI job passed with Scipy: 1.3.3.

@pllim

pllim commented Sep 13, 2022

Copy link
Copy Markdown
Member Author

This just cleans up something else that's already merged, so I am merging this too. If you disagree on the actual fix, please submit a follow-up PR. Thanks!

@saimn

saimn commented Sep 13, 2022

Copy link
Copy Markdown
Contributor

@saimn , but the oldest deps CI job passed with Scipy: 1.3.3.

That's a bit surprising. Lazy loading was added in scipy 1.9.0:

In [1]: import scipy

In [2]: scipy.__version__
Out[2]: '1.8.1'

In [3]: scipy.misc.ascent
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 scipy.misc.ascent

AttributeError: module 'scipy' has no attribute 'misc'

@dhomeier

Copy link
Copy Markdown
Contributor

That's a bit surprising. Lazy loading was added in scipy 1.9.0:

Yes, thought I had tested it, but now confirmed with 1.8.1 it doesn't work on its own.
I guess in the tests scipy.misc has already been imported sometime earlier, but to run that test by itself, it's probably safer to keep that first import.

@pllim

pllim commented Sep 13, 2022

Copy link
Copy Markdown
Member Author

Ohhhh... right. We marked it as remote data, so it is skipped in oldest deps. 🤦

Maybe I should revert...

pllim added a commit that referenced this pull request Sep 13, 2022
@pllim

pllim commented Sep 13, 2022 •

Copy link
Copy Markdown
Member Author

Partially reverted on main at 975abba . I also manually backported the non-broken version of this at cedb4ad and c53877e to each of the active release branches, respectively.

pllim added a commit that referenced this pull request Sep 13, 2022
pllim added a commit that referenced this pull request Sep 13, 2022
@pllim

pllim commented Sep 13, 2022

Copy link
Copy Markdown
Member Author

Good catch, @saimn . Thanks!

dhomeier pushed a commit to dhomeier/astropy that referenced this pull request Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants