Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BUG: Fix multiple modules in F2PY and COMMON handling#27695

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mattip merged 2 commits intonumpy:mainfromHaoZeke:fixModuleF2PYdat
Nov 4, 2024

Conversation

HaoZeke
Copy link
Member

@HaoZekeHaoZeke commentedNov 4, 2024
edited
Loading

Closes#27622. The issue stemmed from#25186 which was patched in#25361,#26156, and#25337 but really the original change should have been scoped better.
Essentially:

@HaoZeke
Copy link
MemberAuthor

@2sn could you confirm that this patch works? You can test by checking out this PR and setting upnumpy viaspin run $SHELL and then going on to build the code you are using.

@2sn
Copy link
Contributor

2sn commentedNov 4, 2024
edited
Loading

@HaoZeke Thank you very much for the fix!

I installed using

pip install git+https://github.com/numpy/numpy.git@refs/pull/27695/merge

Yes, it is including thelanedata module. Interestingly, the allocatable module variabletheta, however, is not listed bydir

In [9]: dir(laneemden._solver.lanedata)Out[9]: ['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'maxdata', 'ndata']

but it is accessible, and returnsNone if not allocated and returns the array when allocated. Even when allocated, however, it is not listed.

In [11]: laneemden._solver.lanedata.<TAB>maxdata ndata   In [11]:

This may not be new behaviour (I do not recall having tried this before), but is a bit curious, and might be confusing.

Before allocating

In [5]: laneemden._solver.lanedata.thetaIn [6]:

and after allocating (laneemden.solver.test())

In [10]: laneemden._solver.lanedata.thetaOut[10]: array([[ 1.00000000e+00,  0.00000000e+00],       [ 9.99999999e-01, -2.03450521e-05],       [ 9.99999998e-01, -4.06901040e-05],       ...,       [ 5.09606183e-06, -4.24312354e-02],       [ 2.50628767e-06, -4.24304844e-02],       [-8.34406605e-08, -4.24297334e-02]])In [11]:
HaoZeke reacted with hooray emoji

@HaoZeke
Copy link
MemberAuthor

HaoZeke commentedNov 4, 2024
edited
Loading

Awesome, thanks for the quick confirmation.

That is kind of odd. I see its because allocatable arrays get proxied into a dimension helpercall f2pysetupfunc(maxdata,f2py_lanedata_getdims_theta,ndata).

This shouldn't be new behavior, but it is definitely worth reporting (and fixing).

2sn reacted with thumbs up emoji

@mattip
Copy link
Member

@HaoZeke should we merge this as a fix toCOMMON handling and leave the other part for later?

@HaoZeke
Copy link
MemberAuthor

@HaoZeke should we merge this as a fix toCOMMON handling and leave the other part for later?

Yup this fixes thecommon and backwards compatibility. There's an issue for the additional issue so this should be good to go.

@mattipmattip merged commitfdeb79a intonumpy:mainNov 4, 2024
68 checks passed
@mattip
Copy link
Member

Thanks@HaoZeke. It might be nice to backport this, and it probably deserves a mention in the release notes

HaoZeke reacted with rocket emoji

@HaoZeke
Copy link
MemberAuthor

@charris a backport would be great, since this also fixes#27167

I'll add a release note in a new PR.

EDIT: Done in#27730

@HaoZekeHaoZeke deleted the fixModuleF2PYdat branchNovember 10, 2024 19:45
@charrischarris added the 09 - Backport-CandidatePRs tagged should be backported labelNov 16, 2024
@charrischarris removed the 09 - Backport-CandidatePRs tagged should be backported labelNov 17, 2024
ArvidJB pushed a commit to ArvidJB/numpy that referenced this pull requestJan 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

BUG: Modules from Fortran interface not accessible in Numpy 2.x (current 2.1.2)
4 participants
@HaoZeke@2sn@mattip@charris

[8]ページ先頭

©2009-2025 Movatter.jp