Skip to content

BUG: Fix KeyError in crackfortran operator support#21890

Merged
charris merged 1 commit intonumpy:mainfrom
HaoZeke:fixSylcotRegression
Jul 8, 2022
Merged

BUG: Fix KeyError in crackfortran operator support#21890
charris merged 1 commit intonumpy:mainfrom
HaoZeke:fixSylcotRegression

Conversation

@HaoZeke
Copy link
Copy Markdown
Member

@HaoZeke HaoZeke commented Jun 30, 2022

Closes #21889 by simply using the safer .get() variant which returns None instead of a KeyError. This in turn allows the rest of the check to pass due to not None evaluating to True and keeping the rest of the intended logic.

Note that there isn't actually any handling of operator() or even implementedby in the rest of F2PY yet (it was an enhancement done for sphinx-fortran I think).

@seberg
Copy link
Copy Markdown
Member

seberg commented Jun 30, 2022

Makes sense, should there be a test?

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Jun 30, 2022
@HaoZeke
Copy link
Copy Markdown
Member Author

HaoZeke commented Jun 30, 2022

Makes sense, should there be a test?

Perhaps, but also not much use at this stage since it isn't actually implemented in any meaningful way (and we don't test crackfortran much). To be fair though, I'm also having trouble reproducing this outside of Slycot.

EDIT: @bnavigator isolated a test! Will update this ASAP.

@charris charris added this to the 1.23.1 release milestone Jul 6, 2022
@charris
Copy link
Copy Markdown
Member

charris commented Jul 8, 2022

Thanks @HaoZeke I'm going to put this in for the 1.23.1 release. Please make another PR to add the test.

@charris charris merged commit b89a1d2 into numpy:main Jul 8, 2022
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 8, 2022
@charris charris removed this from the 1.23.1 release milestone Jul 8, 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.

BUG: f2py crackfortran: missing dict key 'implementedby'

3 participants