Skip to content

Commit

Permalink
Add call operators to docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice committed Dec 10, 2020
1 parent 88d64a0 commit 398770a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,33 @@ Operations and Status
.. autoclass:: flow.project.FlowOperation
:show-inheritance:
:members:
:special-members: __call__

.. autoclass:: flow.project.FlowCmdOperation
:show-inheritance:
:members:
:special-members: __call__

.. autoclass:: flow.project.JobOperation
:members:

.. autoclass:: flow.render_status.Renderer
:members: generate_terminal_output, generate_html_output, render

Labels
------

.. autoclass:: flow.label
:members:
:special-members: __call__

.. autoclass:: flow.staticlabel
:members:
:special-members: __call__

.. autoclass:: flow.classlabel
:members:
:special-members: __call__

@flow.cmd
---------
Expand All @@ -135,6 +151,8 @@ Operations and Status
----------------

.. autoclass:: directives
:members:
:special-members: __call__

flow.run()
----------
Expand All @@ -157,13 +175,18 @@ The FlowGroup
.. autoclass:: flow.project.FlowGroup
:members:

.. autoclass:: flow.project.FlowGroupEntry
:members:
:special-members: __call__

Aggregation
-----------

.. automodule:: flow.aggregates

.. autoclass:: flow.aggregates.aggregator
:members:
:special-members: __call__

.. autofunction:: flow.aggregates.get_aggregate_id

Expand Down
3 changes: 2 additions & 1 deletion flow/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ def __str__(self):
return f"{type(self).__name__}(cmd='{self._cmd}')"

def __call__(self, *jobs, **kwargs):
"""Return the command formatted with the supplied job(s)."""
job = kwargs.pop("job", None)
if kwargs:
raise ValueError(f"Invalid keyword arguments: {', '.join(kwargs)}")
Expand Down Expand Up @@ -734,7 +735,7 @@ def __call__(self, *jobs):
Parameters
----------
\*jobs : One or more instances of :class:`.Job`.
\*jobs : One or more instances of :class:`~signac.contrib.job.Job`.
The jobs passed to the operation.
Returns
Expand Down

0 comments on commit 398770a

Please sign in to comment.