Skip to content

Add optimize flag in yacc.yacc calls to allow importing units under python -OO - #10379

Merged
mhvk merged 2 commits into
astropy:masterfrom
dhomeier:units_fix_OO
May 23, 2020
Merged

mhvk merged 2 commits into
astropy:masterfrom
dhomeier:units_fix_OO

Conversation

@dhomeier

Copy link
Copy Markdown
Contributor

Co-authored-by: Marten van Kerkwijk [email protected]

Description

Fixes #10361 – tested as described in #10361 (comment) and with python setup.py -O2.
Changed the call in angle_utilities.py as a cautionary measure, although I could not create a similar failure on importing coordinates.
No idea for a genuine test of the original issue, so I am putting this up as is for discussion.

@pllim pllim added the Bug label May 20, 2020
@pllim pllim added this to the v4.1.1 milestone May 20, 2020
@pllim
pllim requested review from adrn and mhvk May 20, 2020 22:11
@mhvk mhvk added Performance and removed Bug labels May 21, 2020
@mhvk mhvk modified the milestones: v4.1.1, v4.2 May 21, 2020
@mhvk

mhvk commented May 21, 2020

Copy link
Copy Markdown
Contributor

If I understand correctly, what this really changes is how the tables are interpreted, so it should be OK. Given that we already had it on part, I think it should be fine (and should improve startup too).

I don't really want to count this as a bug-fix, though - I don't feel we guaranteed that one could run with python -OO - and also I'd rather have this in master for a bit so possible problems can be shaken out (we'll get most affiliated packages to run the code too). So, I changed the milestone.

Could you add a changelog entry under other changes and additions?

@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.

OK, in it goes!

@mhvk
mhvk merged commit eeb9b7a into astropy:master May 23, 2020
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.

Importing astropy.units fails with python -OO flag

3 participants