We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When executing this example from the f2py docs, we get the following:
>>> import mystring >>> print(mystring.foo.__doc__) foo(a,b,c,d) Wrapper for ``foo``. Parameters ---------- a : input string(len=5) b : in/output rank-0 array(string(len=5),'c') c : input string(len=-1) d : in/output rank-0 array(string(len=-1),'c') >>> from numpy import array >>> a = array(b'123') >>> b = array(b'123') >>> c = array(b'123') >>> d = array(b'123') >>> mystring.foo(a, b, c, d) A=123K� B=123K� C=123 D=D2 CHANGE A,B,C,D A=A23K� B=B23K� C=C23 D=D2 >>> a.tostring(), b.tostring(), c.tostring(), d.tostring() (b'123', b'B2\x00', b'123', b'D2\x00')
a and b are expected to be of length 5. f2py should raise a ValueError when the input has a smaller byte-size than expected by array argument.
a
b
f2py
ValueError
1.19.0.dev0+b7d0258 3.6.7 | packaged by conda-forge | (default, Jul 2 2019, 02:18:42) [GCC 7.3.0]
The text was updated successfully, but these errors were encountered:
With #18759, the example works as documented:
>>> import mystring >>> print(mystring.foo.__doc__) foo(a,b,c,d) Wrapper for ``foo``. Parameters ---------- a : input string(len=5) b : in/output rank-0 array(string(len=5),'c') c : input string(len=-1) d : in/output rank-0 array(string(len=-1),'c') >>> from numpy import array >>> a = array(b'123\0\0') >>> b = array(b'123\0\0') >>> c = array(b'123') >>> d = array(b'123') >>> mystring.foo(a, b, c, d) A=123 B=123 C=123 D=123 CHANGE A,B,C,D A=A23 B=B23 C=C23 D=D23 >>> a[()], b[()], c[()], d[()] (b'123', b'B23 ', b'123', b'D23')
Sorry, something went wrong.
Well, almost. The documentation has the following output:
(b'123', b'B23', b'123', b'D2')
The last item is wrong in the documentation.
Closing as fixed.
melissawm
Successfully merging a pull request may close this issue.
When executing this example from the f2py docs, we get the following:
a
andb
are expected to be of length 5.f2py
should raise aValueError
when the input has a smaller byte-size than expected by array argument.The text was updated successfully, but these errors were encountered: