Skip to content

Commit 1bfd95f

Browse files
committed
more doc strings
1 parent 3ac366a commit 1bfd95f

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

cwlprov/prov.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ def derivations(self) -> Iterable["Derivation"]:
383383
return self._records(ProvDerivation, Derivation, PROV_ATTR_USED_ENTITY)
384384

385385
def secondary_files(self) -> list[Any]:
386+
"""Return any SecondaryFiles for this Entity."""
386387
return [
387388
d.generated_entity()
388389
for d in self.derivations()

cwlprov/ro.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,20 @@ def _uriref(
183183

184184
@property
185185
def conformsTo(self) -> set[str]:
186+
"""Find which things this RO conforms to."""
186187
resource = self._uriref()
187188
return set(map(str, self.manifest.objects(resource, DCTERMS.conformsTo)))
188189

189190
@property
190191
def createdBy(self) -> set["Agent"]:
192+
"""Find the set of Agents who created this RO."""
191193
resource = self._uriref()
192194
new_agent = partial(Agent, self.manifest)
193195
return set(map(new_agent, self.manifest.objects(resource, PAV.createdBy)))
194196

195197
@property
196198
def authoredBy(self) -> set["Agent"]:
199+
"""Find the set of Agents who authored this RO."""
197200
resource = self._uriref()
198201
new_agent = partial(Agent, self.manifest)
199202
return set(map(new_agent, self.manifest.objects(resource, PAV.authoredBy)))

cwlprov/tool.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class Status(IntEnum):
130130

131131

132132
def parse_args(args: Optional[list[str]] = None) -> argparse.Namespace:
133+
"""Parse the command line arguments."""
133134
parser = argparse.ArgumentParser(
134135
description="cwlprov explores Research Objects containing provenance of "
135136
"Common Workflow Language executions. <https://w3id.org/cwl/prov/>"
@@ -485,8 +486,10 @@ def _set_log_level(quiet: Optional[bool] = None, verbose: int = 0) -> None:
485486

486487

487488
class Tool(ContextManager["Tool"]):
489+
"""The cwlprov-py tool."""
490+
488491
def __init__(self, args: Optional[list[str]] = None) -> None:
489-
"""Create a Tool and open the output stream."""
492+
"""Open the output stream."""
490493
self.args = parse_args(args)
491494
if self.args.output != "-":
492495
self.output: Optional[TextIO] = open(
@@ -1505,6 +1508,7 @@ def run(self) -> int:
15051508

15061509

15071510
def main(args: Optional[list[str]] = None) -> int:
1511+
"""Run the cwlprov-py tool."""
15081512
with Tool(args) as tool:
15091513
try:
15101514
return tool.main()

0 commit comments

Comments
 (0)