Skip to content

Commit

Permalink
MAINT,DOC: Fix doc fragments and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Jun 5, 2022
1 parent f20d90c commit 5c0ecb5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions doc/source/f2py/advanced.rst
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.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion numpy/f2py/tests/test_docs.py
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 comments on commit 5c0ecb5

Please sign in to comment.