Skip to content

Commit

Permalink
Fix documentation of pipe base
Browse files Browse the repository at this point in the history
There were a few modules issues with documentation generation,
and some documentation was not being generated at all. This
commit makes sure all the appropriate documentation builds.
  • Loading branch information
natelust committed Oct 21, 2020
1 parent d2eeb1e commit 7ae232a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 29 deletions.
6 changes: 6 additions & 0 deletions doc/lsst.pipe.base/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ Python API reference

.. automodapi:: lsst.pipe.base.testUtils
:no-main-docstr:

.. automodapi:: lsst.pipe.base.connectionTypes
:no-main-docstr:

.. automodapi:: lsst.pipe.base.pipelineIR
:no-main-docstr:
2 changes: 2 additions & 0 deletions python/lsst/pipe/base/connectionTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def __get__(self, inst, klass):
def makeDatasetType(self, universe: DimensionUniverse,
parentStorageClass: Optional[StorageClass] = None):
"""Construct a true `DatasetType` instance with normalized dimensions.
Parameters
----------
universe : `lsst.daf.butler.DimensionUniverse`
Expand Down Expand Up @@ -150,6 +151,7 @@ def __post_init__(self):
def makeDatasetType(self, universe: DimensionUniverse,
parentStorageClass: Optional[StorageClass] = None):
"""Construct a true `DatasetType` instance with normalized dimensions.
Parameters
----------
universe : `lsst.daf.butler.DimensionUniverse`
Expand Down
60 changes: 31 additions & 29 deletions python/lsst/pipe/base/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class IncompatibleGraphError(Exception):


class QuantumGraph:
"""QuantumGraph is a directed acyclic graph of `QuantumNode`s
"""QuantumGraph is a directed acyclic graph of `QuantumNode` objects
This data structure represents a concrete workflow generated from a
`Pipeline`.
Expand Down Expand Up @@ -143,29 +143,29 @@ def taskGraph(self) -> nx.DiGraph:
Returns
-------
taskGraph : `networkx.Digraph`
Internal datastructure that holds relations of `TaskDef`s
Internal datastructure that holds relations of `TaskDef` objects
"""
return self._taskGraph

@property
def graph(self) -> nx.DiGraph:
"""Return a graph representing the relations between all the
`QuantumNode`s. Largely it should be preferred to iterate over, and use
methods of this class, but sometimes direct access to the networkx
object may be helpful
`QuantumNode` objects. Largely it should be preferred to iterate
over, and use methods of this class, but sometimes direct access to
the networkx object may be helpful
Returns
-------
graph : `networkx.Digraph`
Internal datastructure that holds relations of `QuantumNode`s
Internal datastructure that holds relations of `QuantumNode` objects
"""
return self._connectedQuanta

@property
def inputQuanta(self) -> Iterable[QuantumNode]:
"""Make a `list` of all `QuantumNode`s that are 'input' nodes to the
graph, meaning those nodes to not depend on any other nodes in the
graph.
"""Make a `list` of all `QuantumNode` objects that are 'input' nodes
to the graph, meaning those nodes to not depend on any other nodes in
the graph.
Returns
-------
Expand All @@ -176,8 +176,9 @@ def inputQuanta(self) -> Iterable[QuantumNode]:

@property
def outputQuanta(self) -> Iterable[QuantumNode]:
"""Make a `list` of all `QuantumNode`s that are 'output' nodes to the
graph, meaning those nodes have no nodes that depend them in the graph.
"""Make a `list` of all `QuantumNode` objects that are 'output' nodes
to the graph, meaning those nodes have no nodes that depend them in
the graph.
Returns
-------
Expand All @@ -188,8 +189,8 @@ def outputQuanta(self) -> Iterable[QuantumNode]:

@property
def allDatasetTypes(self) -> Tuple[DatasetTypeName, ...]:
"""Return all the `DatasetTypeNames` that are contained inside the
graph.
"""Return all the `DatasetTypeName` objects that are contained inside
the graph.
Returns
-------
Expand Down Expand Up @@ -261,9 +262,9 @@ def findTasksWithInput(self, datasetTypeName: DatasetTypeName) -> Iterable[TaskD
Returns
-------
tasks : iterable of `TaskDef`
`TaskDef`s that have the specified `DatasetTypeName` as an input,
list will be empty if no tasks use specified `DatasetTypeName` as
an input.
`TaskDef` objects that have the specified `DatasetTypeName` as an
input, list will be empty if no tasks use specified
`DatasetTypeName` as an input.
Raises
------
Expand Down Expand Up @@ -310,7 +311,8 @@ def tasksWithDSType(self, datasetTypeName: DatasetTypeName) -> Iterable[TaskDef]
Returns
-------
result : iterable of `TaskDef`
`TaskDef`s that are associated with the specified `DatasetTypeName`
`TaskDef` objects that are associated with the specified
`DatasetTypeName`
Raises
------
Expand All @@ -324,12 +326,12 @@ def tasksWithDSType(self, datasetTypeName: DatasetTypeName) -> Iterable[TaskDef]
return results

def findTaskDefByName(self, taskName: str) -> List[TaskDef]:
"""Determine which `TaskDef`s in this graph are associated with a `str`
representing a task name (looks at the taskName property of
`TaskDef`s).
"""Determine which `TaskDef` objects in this graph are associated
with a `str` representing a task name (looks at the taskName property
of `TaskDef` objects).
Returns a list of `TaskDef`s as a `PipelineTask` may appear multiple
times in a graph with different labels.
Returns a list of `TaskDef` objects as a `PipelineTask` may appear
multiple times in a graph with different labels.
Parameters
----------
Expand All @@ -339,9 +341,9 @@ def findTaskDefByName(self, taskName: str) -> List[TaskDef]:
Returns
-------
result : list of `TaskDef`
List of the `TaskDef`s that have the name specified. Multiple
values are returned in the case that a task is used multiple times
with different labels.
List of the `TaskDef` objects that have the name specified.
Multiple values are returned in the case that a task is used
multiple times with different labels.
"""
results = []
for task in self._quanta.keys():
Expand All @@ -351,8 +353,8 @@ def findTaskDefByName(self, taskName: str) -> List[TaskDef]:
return results

def findTaskDefByLabel(self, label: str) -> Optional[TaskDef]:
"""Determine which `TaskDef`s in this graph are associated with a `str`
representing a tasks label.
"""Determine which `TaskDef` objects in this graph are associated
with a `str` representing a tasks label.
Parameters
----------
Expand All @@ -362,7 +364,7 @@ def findTaskDefByLabel(self, label: str) -> Optional[TaskDef]:
Returns
-------
result : `TaskDef`
`TaskDef`s that has the specified label.
`TaskDef` objects that has the specified label.
"""
for task in self._quanta.keys():
if label == task.label:
Expand All @@ -381,7 +383,7 @@ def findQuantaWithDSType(self, datasetTypeName: DatasetTypeName) -> Set[Quantum]
Returns
-------
result : `set` of `QuantumNode`s
result : `set` of `QuantumNode` objects
A `set` of `QuantumNode`s that contain specified `DatasetTypeName`
Raises
Expand Down

0 comments on commit 7ae232a

Please sign in to comment.