Skip to content

MNT: Drop Numpy 1.16 - #10664

Merged
mhvk merged 3 commits into
astropy:masterfrom
pllim:drop-np-1.16
Aug 21, 2020
Merged

mhvk merged 3 commits into
astropy:masterfrom
pllim:drop-np-1.16

Conversation

@pllim

@pllim pllim commented Aug 17, 2020 •

Copy link
Copy Markdown
Member

Description

This pull request is to bump minimum supported version of Numpy from 1.16 to 1.17. This also adds CI for Numpy 1.19.

This is a prerequisite for #10644 .

cc @astropy/coordinators

@pllim

pllim commented Aug 17, 2020 •

Copy link
Copy Markdown
Member Author

Oooo... Failures with Numpy 1.19!

UPDATE: Looks like just mpl tests that seem to pull Numpy 1.19 but a very old Scipy (1.1).

@pllim

pllim commented Aug 17, 2020

Copy link
Copy Markdown
Member Author

@astrofrog or @Cadair , how do I upgrade Scipy version in the failed mpl jobs?

@dhomeier

Copy link
Copy Markdown
Contributor

Possibly of interest: SciPy is currently having a discussion about dropping Python 3.6 and NumPy 1.14 / 1.15 support – so slightly offset to this plan, but some arguments e.g. about available versions in the various Linux distros might apply.

@mhvk

mhvk commented Aug 17, 2020

Copy link
Copy Markdown
Contributor

I think a good point being made in that thread is that when a user updates astropy, updating numpy at the same time is essentially trivial (if not already automatic), but for python itself one is much more dependent on OS, etc.
So, 👍 on this PR - after all, we do offer 4.0-lts for those who prefer sticking to older versions.

@pllim

pllim commented Aug 17, 2020

Copy link
Copy Markdown
Member Author

Dropping Python is more controversial indeed. Hoping to discuss at astropy/astropy-APEs#62

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good - nice to see it does really simplify things! But some comments...


out[out_name] = col_cls.info.new_like(cols, n_out, metadata_conflicts, out_name)

if not NUMPY_LT_1_17 or issubclass(col_cls, (Column, Time)):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not NUMPY_LT_1_17 will now always be true, so I think we can de-indent what follows and remove the else clause! (I always wondered why we didn't use NUMPY_GE_<something>!)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Comment thread astropy/units/quantity.py Outdated
raise NotImplementedError('__array_wrap__ should not be used '
'with a context any more, since we require '
'numpy >=1.16. Please raise an issue on '
'numpy >=1.17. Please raise an issue on '

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the version here - maybe "since all use should go through array_function. Please ..."

Comment thread astropy/utils/iers/iers.py Outdated
table = cls._substitute_iers_b(table)

q_where = cls._quantity_where if NUMPY_LT_1_17 else np.where
q_where = np.where

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we'd just replace q_where with np.where... (sorry to have set up this extra work for you!)

@pllim

This comment has been minimized.

@pllim

pllim commented Aug 20, 2020

Copy link
Copy Markdown
Member Author

I hacked around the CircleCI failures. The one remote data failure is unrelated and hopefully will go away when numpy nightly is refreshed.

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good to me! Thanks!

@mhvk

mhvk commented Aug 20, 2020

Copy link
Copy Markdown
Contributor

Before I merge, I think there was consensus that dropping 1.16 was OK, right?

@pllim

pllim commented Aug 20, 2020

Copy link
Copy Markdown
Member Author

I haven't heard much feedback. No feedback is good feedback? 🤷

@adrn

adrn commented Aug 21, 2020 •

Copy link
Copy Markdown
Member

I'm 👍 on this!

@mhvk

mhvk commented Aug 21, 2020

Copy link
Copy Markdown
Contributor

OK, let's get it in! Thanks, @pllim!

@mhvk
mhvk merged commit abd73b5 into astropy:master Aug 21, 2020
@pllim
pllim deleted the drop-np-1.16 branch August 21, 2020 17:54
eerovaher added a commit to eerovaher/astropy that referenced this pull request Jun 22, 2021
The oldest version of NumPy that Astropy supports is 1.17 (see pull
request astropy#10664), but the documentation still contains several remarks
about older NumPy versions. This commit removes such obsolete
references.
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