Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docstrings to functions in ro.py #2002

Merged
merged 2 commits into from
May 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
"""Initialize 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."""
mr-c marked this conversation as resolved.
Show resolved Hide resolved
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
Loading