Skip to content

Commit cb512ce

Browse files
committed
Merge branch 'master' into 2846_rename_inlined_routines
2 parents 7afb48f + 7bf5591 commit cb512ce

61 files changed

Lines changed: 516 additions & 663 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/python-package.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,11 @@ jobs:
8383
# Uncomment the below to use the submodule version of fparser rather
8484
# than the latest release from pypi.
8585
# pip install external/fparser
86-
pip install .[doc]
86+
pip install -e .[test,doc]
8787
# Now we can check for warnings and broken links
88+
- run: cd doc; make doctest
8889
- run: cd doc; make html SPHINXOPTS="-W --keep-going"
8990
- run: cd doc; make linkcheck
90-
# TODO #2936: There are many doctest issues, so commenting out for now
91-
# - run: cd doc; make doctest
9291
build:
9392
if: ${{ github.repository != 'stfc/PSyclone-mirror' }}
9493
runs-on: ubuntu-latest
@@ -142,12 +141,12 @@ jobs:
142141
if: ${{ !(matrix.python-version == '3.9') }}
143142
run: |
144143
locale
145-
pytest -n auto --cov=psyclone --cov-report=xml src/psyclone/tests
144+
pytest -n auto --doctest-modules --cov=psyclone --cov-report=xml src/psyclone
146145
- name: Test with pytest and C Locale
147146
if: ${{ matrix.python-version == '3.9' }}
148147
run: |
149148
locale
150-
pytest -n auto --cov=psyclone --cov-report=xml src/psyclone/tests
149+
pytest -n auto --doctest-modules --cov=psyclone --cov-report=xml src/psyclone
151150
env:
152151
LC_ALL: C
153152
LANG: C

changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
4) PR #3441 for #2936, #1220 and #2088. Fixes the doctests and adds
2+
them to the GHA CI.
3+
14
3) PR #3456 for #3446. Fix issues with CodeBlocks and routine names
25
in the presence of comments.
36

doc/developer_guide/dependency.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ thread-private. Note that this code does not handle the usage of
461461
# the access information as well as from the symbol table
462462
# into account.
463463
access_sequence = var_accesses[signature]
464-
if symbol.is_array_access(access_info=access_info):
464+
if symbol.is_array_access(access_info=access_sequence):
465465
# It's not a scalar variable, so it will not be private
466466
continue
467467

@@ -504,7 +504,7 @@ until we find accesses that would prevent parallelisation:
504504
for next_statement in statements:
505505
# Add the variable accesses of the next statement to
506506
# the existing accesses:
507-
next_statement.reference_accesses(accesses)
507+
accesses = next_statement.reference_accesses()
508508
# Stop when the next statement can not be parallelised
509509
# together with the previous accesses:
510510
if not can_be_parallelised(accesses):
@@ -581,7 +581,7 @@ can be parallelised:
581581
.. testoutput::
582582
:hide:
583583

584-
Error: The write access to 'a(i,i)' and the read access to 'a(i + 1,i + 1)' are dependent and cannot be parallelised. Variable: 'a'.
584+
Error: The write access to 'a(i,i)' in 'a(i,i) = j + k' and the read access to 'a(i + 1,i + 1)' in 'a(i,i) = a(i + 1,i + 1)' are dependent and cannot be parallelised. Variable: 'a'.
585585

586586
.. _defusechain:
587587

doc/developer_guide/interface_example.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,4 @@ def some_function(filename, kernel_path, node=None):
3535
it can be raised by different errors.
3636
:raises GenerationError: same exception, raised by a different error.
3737
38-
For example:
39-
40-
>>> from psyclone.generator import generate
41-
>>> API="gocean"
42-
>>> alg, psy = generate(SOURCE_FILE, api=API)
43-
>>> alg, psy = generate(SOURCE_FILE, api=API, kernel_paths=[KERNEL_PATH])
44-
4538
'''

doc/developer_guide/module_manager.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ which prints the filenames of all modules used in ``tl_testkern_mod``:
121121
.. testcode ::
122122
123123
mod_manager = ModuleManager.get()
124-
# Add the path to the PSyclone LFRic example codes:
124+
# Add the path to the LFRic module directories:
125+
mod_manager.add_search_path("../external/lfric_infrastructure/")
125126
mod_manager.add_search_path("../src/psyclone/tests/test_files/"
126127
"lfric")
127128
@@ -134,15 +135,14 @@ which prints the filenames of all modules used in ``tl_testkern_mod``:
134135
mod_info = mod_manager.get_module_info(module_name)
135136
print("Module:", module_name, os.path.basename(mod_info.filename))
136137
138+
137139
.. testoutput::
138140

139141
Module: argument_mod argument_mod.f90
140142
Module: constants_mod constants_mod.f90
141143
Module: fs_continuity_mod fs_continuity_mod.f90
142144
Module: kernel_mod kernel_mod.f90
143145

144-
145-
146146
FileInfo
147147
========
148148

doc/developer_guide/psyir_symbols.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ specialisations are possible:
337337
>>> # The following statement would fail because the initial_value doesn't
338338
>>> # match the datatype of the symbol:
339339
>>> # sym2.specialise(DataSymbol, datatype=ScalarType.integer_type(),
340-
... initial_value=3.14)
340+
>>> # initial_value=3.14)
341341
>>> # The following statement is valid and initial_value is set to 3
342342
>>> # (and is_constant will default to False):
343343
>>> sym2.specialise(DataSymbol, datatype=ScalarType.integer_type(), initial_value=3)

doc/developer_guide/transformations.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@
3333
.. -----------------------------------------------------------------------------
3434
.. Written by R. W. Ford, A. R. Porter, S. Siso and N. Nobre, STFC Daresbury Lab
3535
36-
.. testsetup::
37-
38-
# Define GOCEAN_SOURCE_FILE to point to an existing gocean 1.0 file.
39-
GOCEAN_SOURCE_FILE = ("../src/psyclone/tests/test_files/"
40-
"gocean1p0/test11_different_iterates_over_one_invoke.f90")
41-
# Define NEMO_SOURCE_FILE to point to an existing nemo file.
42-
NEMO_SOURCE_FILE = ("../examples/nemo/code/tra_adv.F90")
43-
4436
4537
Transformations
4638
###############

doc/user_guide/gocean1p0.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ Example
196196
+++++++
197197

198198
PSyclone is distributed with a full example of the use of the
199-
GOcean Library. See ``<PSYCLONEHOME>/examples/gocean/shallow_alg.f90``. In what
200-
follows we will walk through a slightly cut-down example for a
199+
GOcean Library. See ``<PSYCLONEHOME>/examples/gocean/eg1/shallow_alg.f90``.
200+
In what follows we will walk through a slightly cut-down example for a
201201
different program.
202202

203203
The following code illustrates the use of dl_esm_inf for constructing an

doc/user_guide/psyir.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
.. testsetup::
4141

4242
from psyclone.psyir.symbols import DataSymbol, ScalarType, ArrayType
43-
from psyclone.psyir.nodes import Reference
43+
from psyclone.psyir.nodes import Reference
4444

4545
.. _psyir-ug:
4646

@@ -268,7 +268,7 @@ example:
268268
... ScalarType.Precision.SINGLE)
269269
>>> bool_type = ScalarType(ScalarType.Intrinsic.BOOLEAN, 4)
270270
>>> symbol = DataSymbol("rdef", int_type, initial_value=4)
271-
>>> scalar_type = ScalarType(ScalarType.Intrinsic.REAL, symbol)
271+
>>> scalar_type = ScalarType(ScalarType.Intrinsic.REAL, Reference(symbol))
272272

273273
For convenience ScalarType has static methods to create a number of
274274
common scalar datatypes:

src/psyclone/alg_gen.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,16 @@ class Alg:
7272
latter allows consistent names to be generated between the
7373
algorithm (calling) and psy (callee) layers.
7474
75-
For example:
76-
77-
>>> from psyclone.algorithm.parse import parse
78-
>>> parse_tree, info = parse("argspec.F90")
79-
>>> from psyclone.psyGen import PSy
80-
>>> psy = PSy(info)
81-
>>> from psyclone.alg_gen import Alg
82-
>>> alg = Alg(parse_tree, psy)
83-
>>> print(alg.gen)
84-
85-
:param parse_tree: an object containing a parse tree of the \
86-
algorithm specification which was produced by the function \
87-
:func:`psyclone.parse.algorithm.parse`. Assumes the algorithm \
88-
will be parsed by fparser2 and expects a valid program unit, \
75+
:param parse_tree: an object containing a parse tree of the
76+
algorithm specification which was produced by the function
77+
:func:`psyclone.parse.algorithm.parse`. Assumes the algorithm
78+
will be parsed by fparser2 and expects a valid program unit,
8979
program, module, subroutine or function.
9080
:type parse_tree: :py:class:`fparser.two.utils.Base`
9181
:param psy: an object containing information about the PSy layer.
9282
:type psy: :py:class:`psyclone.psyGen.PSy`
93-
:param str invoke_name: the name that the algorithm layer uses to \
94-
indicate an invoke call. This is an optional argument that \
83+
:param str invoke_name: the name that the algorithm layer uses to
84+
indicate an invoke call. This is an optional argument that
9585
defaults to the name "invoke".
9686
9787
'''

0 commit comments

Comments
 (0)