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_testgives 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 |
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: