@@ -106,6 +106,7 @@ def __str__(self) -> str:
106
106
return f"ResearchObject <{ self .ro_uuid } > in <{ self .folder } >"
107
107
108
108
def _initialize (self ) -> None :
109
+ """Initializes the bagit folder structure."""
109
110
for research_obj_folder in (
110
111
METADATA ,
111
112
DATA ,
@@ -359,6 +360,7 @@ def add_annotation(
359
360
return uri
360
361
361
362
def _ro_annotations (self ) -> List [Annotation ]:
363
+ """Append base RO and provenance annotations to the list of annotations."""
362
364
annotations : List [Annotation ] = []
363
365
annotations .append (
364
366
{
@@ -414,6 +416,7 @@ def _ro_annotations(self) -> List[Annotation]:
414
416
415
417
def _authored_by (self ) -> Optional [AuthoredBy ]:
416
418
authored_by : AuthoredBy = {}
419
+ """Returns the authoredBy metadata if it was supplied on CLI"""
417
420
if self .orcid :
418
421
authored_by ["orcid" ] = self .orcid
419
422
if self .full_name :
@@ -542,6 +545,7 @@ def add_to_manifest(self, rel_path: str, checksums: Dict[str, str]) -> None:
542
545
checksum_file .write (line )
543
546
544
547
def _add_to_bagit (self , rel_path : str , ** checksums : str ) -> None :
548
+ """Computes file size and checksums and adds to bagit manifest."""
545
549
if PurePosixPath (rel_path ).is_absolute ():
546
550
raise ValueError (f"rel_path must be relative: { rel_path } " )
547
551
lpath = os .path .join (self .folder , local_path (rel_path ))
0 commit comments