Skip to content

Commit 06813e9

Browse files
author
Vasileios Karakasis
committed
Docs fine tuning
1 parent fa2c92a commit 06813e9

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

docs/deferrable_functions_reference.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The key characteristic of these functions is that they store their arguments whe
1010
ReFrame provides an ample set of deferrable utilities and it also allows users to write their own deferrable functions when needed.
1111
Please refer to ":doc:`deferrables`" for a hands-on explanation on how deferrable functions work and how to create custom deferrable functions.
1212

13+
1314
Explicit evaluation of deferrable functions
1415
-------------------------------------------
1516

@@ -18,7 +19,8 @@ These :func:`evaluate` functions take an optional :class:`bool` argument ``cache
1819
Hence, if caching is enabled on a given deferrable function, any subsequent calls to :func:`evaluate` will simply return the previously cached results.
1920

2021
.. versionchanged:: 3.8.0
21-
Support cached evaluation.
22+
Support of cached evaluation is added.
23+
2224

2325
Implicit evaluation of deferrable functions
2426
-------------------------------------------
@@ -58,16 +60,19 @@ Currently ReFrame provides three broad categories of deferrable functions:
5860

5961
.. _deferrable-performance-functions:
6062

63+
64+
--------------------------------
6165
Deferrable performance functions
62-
................................
66+
--------------------------------
67+
68+
.. versionadded:: 3.8.0
6369

6470
Deferrable performance functions are a special type of deferrable functions which are intended for measuring a given quantity.
6571
Therefore, this kind of deferrable functions have an associated unit that can be used to interpret the return values from these functions.
6672
The unit of a deferrable performance function can be accessed through the public member :attr:`unit`.
6773
Regular deferrable functions can be promoted to deferrable performance functions using the :func:`~reframe.utility.sanity.make_performance_function` utility.
6874
Also, this utility allows to create performance functions directly from any callable.
6975

70-
.. versionadded:: 3.8.0
7176

7277
List of deferrable functions and utilities
7378
------------------------------------------

docs/regression_test_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ Built-in functions
326326
327327
Decorate a member function as a performance function of the test.
328328

329-
This decorator converts the decorated method into a performance deferrable function (see :ref:`deferrable-performance-functions`) whose evaluation is deferred to the performance stage of the regression test.
329+
This decorator converts the decorated method into a performance deferrable function (see ":ref:`deferrable-performance-functions`" for more details) whose evaluation is deferred to the performance stage of the regression test.
330330
The decorated function must take a single argument without a default value (i.e. ``self``) and any number of arguments with default values.
331331
A test may decorate multiple member functions as performance functions, where each of the decorated functions must be provided with the units of the performance quantitites to be extracted from the test.
332332
These performance units must be of type :class:`str`.

reframe/core/pipeline.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,10 @@ def pipeline_hooks(cls):
657657
#:
658658
#: By default, ReFrame will populate this field during the test's
659659
#: instantiation with all the member functions decorated with the
660-
#: :func:`performance_function` decorator. If no performance functions
661-
#: are present in the class, no performance checking or reporting will be
662-
#: carried out.
660+
#: :func:`@performance_function
661+
#: <reframe.core.pipeline.RegressionMixin.performance_function>` decorator.
662+
#: If no performance functions are present in the class, no performance
663+
#: checking or reporting will be carried out.
663664
#:
664665
#: This mapping may be extended or replaced by other performance variables
665666
#: that may be defined in any pipeline hook executing before the
@@ -677,6 +678,8 @@ def pipeline_hooks(cls):
677678
#: the member functions decorated with the :func:`@performance_function
678679
#: <reframe.core.pipeline.RegressionMixin.performance_function>`
679680
#: decorator.
681+
#:
682+
#: .. versionadded:: 3.8.0
680683
perf_variables = variable(typ.Dict[str, _DeferredPerformanceExpression],
681684
value={})
682685

reframe/utility/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def attrs(obj):
305305

306306

307307
def is_trivially_callable(fn, *, non_def_args=0):
308-
'''Assert that a callable object is trivially callable.
308+
'''Check that a callable object is trivially callable.
309309
310310
An object is trivially callable when it can be invoked by providing just
311311
an expected number of non-default arguments to its call method. For
@@ -319,9 +319,9 @@ def is_trivially_callable(fn, *, non_def_args=0):
319319
:param fn: A callable to be tested if its trivially callable.
320320
:param non_def_args: The number of non-default arguments the callable
321321
``fn`` expects when invoked.
322-
:return: This function returns ``True`` if the expected number of
322+
:return: This function returns :obj:`True` if the expected number of
323323
arguments matches the value of ``non_def_args``. Otherwise, it returns
324-
``False``.
324+
:obj:`False`.
325325
'''
326326

327327
if not callable(fn):

reframe/utility/sanity.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,9 @@ def evaluate(expr, cache=False):
919919
to :func:`evaluate` on this deferred expression (when ``cache=False``)
920920
will simply return the previously cached result.
921921
922+
:param expr: The expression to be evaluated.
923+
:param cache: Cache the result of this evaluation.
924+
922925
.. note::
923926
When the ``cache`` argument is passed as ``True``, a deferred
924927
expression will always be evaluated and its results will be re-cached.
@@ -928,8 +931,9 @@ def evaluate(expr, cache=False):
928931
.. versionadded:: 2.21
929932
930933
.. versionchanged:: 3.8.0
931-
Add support for evaluation caching.
934+
The ``cache`` argument is added.
932935
'''
936+
933937
if isinstance(expr, _DeferredExpression):
934938
return expr.evaluate(cache=cache)
935939
else:

0 commit comments

Comments
 (0)