-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: fix for f2py string scalars #23194
Conversation
Thanks! @2sn could you please also add a very basic tests to |
OK, let me have a look. |
The tests that are present are unlike my usage, I defined in a module. How do I execute a test? |
Hmmm, I would suspect you can add it to the initial
Inside the test class the module with that code is available as I.e. insert the code here: https://github.com/numpy/numpy/blob/main/numpy/f2py/tests/test_character.py#L20 and add a test using (Sorry, I am just trying to throw breadcrumbs that might help you, I don't have deep knowledge of f2py/Fortran to be sure this makes sense.) |
I created a module test, but do I call (test) it? |
well, with the old code my test of MODULE string_test
character(len=8) :: string
END MODULE string_test gives
but runs fine with the fix
|
I am not sure the failed checks (32bit azure pipeline) are due to my code, at least I can't see any details.
|
Don't worry about it. Some heisenbug may related to openblas, maybe not, it happens occasionally (and has been for a very long time). |
Also, thanks a ton for looking into fixing this @2sn |
@HaoZeke The code needs to remain with As you write if you set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
in previous version, any string scalar was converted to a string array of dimension len, i.e., a definition character(len=N) :: X effectively became character(len=NNN), dimension(NNN) :: X from the point of few of the numpy (python) interface: X.shape == (NNN,) X.dtype == '|SNNN' Closes numpygh-23192
BUG: fix for f2py string scalars (#23194)
proposed fix for #23192
in previous version, any string scalar was converted to a string array of dimension len, i.e., a definition
effectively became
from the point of few of the numpy (python) interface: