Skip to content

Commit 869b3ca

Browse files
committed
add some missing docstrings
1 parent a17329f commit 869b3ca

File tree

7 files changed

+17
-4
lines changed

7 files changed

+17
-4
lines changed

cwltool/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ def setup_loadingContext(
729729
def make_template(
730730
tool: Process,
731731
) -> None:
732+
"""Make a template CWL input object for the give Process."""
733+
732734
def my_represent_none(
733735
self: Any, data: Any
734736
) -> Any: # pylint: disable=unused-argument
@@ -750,7 +752,7 @@ def choose_target(
750752
tool: Process,
751753
loadingContext: LoadingContext,
752754
) -> Optional[Process]:
753-
755+
"""Walk the given Workflow and find the process that matches args.target."""
754756
if loadingContext.loader is None:
755757
raise Exception("loadingContext.loader cannot be None")
756758

@@ -783,6 +785,7 @@ def choose_target(
783785
def check_working_directories(
784786
runtimeContext: RuntimeContext,
785787
) -> Optional[int]:
788+
"""Make any needed working directories."""
786789
for dirprefix in ("tmpdir_prefix", "tmp_outdir_prefix", "cachedir"):
787790
if (
788791
getattr(runtimeContext, dirprefix)

cwltool/mpi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Experimental support for MPI."""
12
import inspect
23
import os
34
import re

cwltool/pathmapper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ def reversemap(
219219
self,
220220
target: str,
221221
) -> Optional[Tuple[str, str]]:
222+
"""Find the (source, resolved_path) for the given target, if any."""
222223
for k, v in self._pathmap.items():
223224
if v[1] == target:
224225
return (k, v[0])

cwltool/provenance.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def __init__(self, research_object: "ResearchObject", rel_path: str) -> None:
130130
super(WritableBagFile, self).__init__(path, mode="w")
131131

132132
def write(self, b: Any) -> int:
133+
"""Write some content to the Bag."""
133134
real_b = b if isinstance(b, (bytes, mmap, array)) else b.encode("utf-8")
134135
total = 0
135136
length = len(real_b)

cwltool/workflow_job.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ def setTotal(
119119
total: int,
120120
steps: List[Optional[JobsGeneratorType]],
121121
) -> None:
122+
"""
123+
Set the total number of expected outputs along with the steps.
124+
125+
This is necessary to finish the setup.
126+
"""
122127
self.total = total
123128
self.steps = steps
124129
if self.completed == self.total:

tests/test_mpi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Tests of the experimental MPI extension."""
12
import json
23
import os.path
34
import sys

tests/util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ def get_data(filename: str) -> str:
6767
)
6868

6969
needs_singularity_3_or_newer = pytest.mark.skipif(
70-
(not bool(distutils.spawn.find_executable("singularity"))) or (not is_version_3_or_newer()),
71-
reason="Requires that version 3.x of singularity executable version is on the system path.",
72-
)
70+
(not bool(distutils.spawn.find_executable("singularity")))
71+
or (not is_version_3_or_newer()),
72+
reason="Requires that version 3.x of singularity executable version is on the system path.",
73+
)
7374

7475

7576
windows_needs_docker = pytest.mark.skipif(

0 commit comments

Comments
 (0)