Skip to content

Commit

Permalink
Added some docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
AGoetzee committed May 17, 2024
1 parent 270f9c6 commit 678a554
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cwltool/cwlprov/ro.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def __str__(self) -> str:
return f"ResearchObject <{self.ro_uuid}> in <{self.folder}>"

def _initialize(self) -> None:
"""Initializes the bagit folder structure."""
for research_obj_folder in (
METADATA,
DATA,
Expand Down Expand Up @@ -359,6 +360,7 @@ def add_annotation(
return uri

def _ro_annotations(self) -> List[Annotation]:
"""Append base RO and provenance annotations to the list of annotations."""
annotations: List[Annotation] = []
annotations.append(
{
Expand Down Expand Up @@ -414,6 +416,7 @@ def _ro_annotations(self) -> List[Annotation]:

def _authored_by(self) -> Optional[AuthoredBy]:
authored_by: AuthoredBy = {}
"""Returns the authoredBy metadata if it was supplied on CLI"""
if self.orcid:
authored_by["orcid"] = self.orcid
if self.full_name:
Expand Down Expand Up @@ -542,6 +545,7 @@ def add_to_manifest(self, rel_path: str, checksums: Dict[str, str]) -> None:
checksum_file.write(line)

def _add_to_bagit(self, rel_path: str, **checksums: str) -> None:
"""Computes file size and checksums and adds to bagit manifest."""
if PurePosixPath(rel_path).is_absolute():
raise ValueError(f"rel_path must be relative: {rel_path}")
lpath = os.path.join(self.folder, local_path(rel_path))
Expand Down

0 comments on commit 678a554

Please sign in to comment.