8000 ENH: Support character and character string arrays by pearu · Pull Request #19388 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Support character and character string arrays #19388

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

Merged
merged 4 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
MAINT,DOC: Fix doc fragments and tests
  • Loading branch information
HaoZeke committed Jun 5, 2022
commit 5c0ecb52890f92d43cf70519cd5491b8415b3710
12 changes: 6 additions & 6 deletions doc/source/f2py/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ For more information, see F2Py source code ``numpy/f2py/capi_maps.py``.
Character strings
=================

Assumed length chararacter strings
Assumed length character strings
-----------------------------------

In Fortran, assumed length character string arguments are declared as
Expand All @@ -125,12 +125,12 @@ extra declaration for the corresponding argument that specifies the
length in character selector part. For example, consider a Fortran
file ``asterisk1.f90``:

.. include:: asterisk1.f90
.. include:: ./code/asterisk1.f90
:literal:

Compile it with ``f2py -c asterisk1.f90 -m asterisk1`` and then in Python:

.. include:: asterisk1_session.dat
.. include:: ./code/results/asterisk1_session.dat
:literal:

Notice that the extra declaration ``character(f2py_len=12) s`` is
Expand All @@ -139,11 +139,11 @@ can use C-expressions as a length value.

In the following example:

.. include:: asterisk2.f90
.. include:: ./code/asterisk2.f90
:literal:

the lenght of output assumed length string depends on an input
the length of the output assumed length string depends on an input
argument ``n``, after wrapping with F2PY, in Python:

.. include:: asterisk2_session.dat
.. include:: ./code/results/asterisk2_session.dat
:literal:
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion numpy/f2py/tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_docdir():
return os.path.abspath(os.path.join(
os.path.dirname(__file__),
'..', '..', '..',
'doc', 'source', 'f2py'))
'doc', 'source', 'f2py', 'code'))


pytestmark = pytest.mark.skipif(
Expand Down
0