Skip to content

Commit

Permalink
Autogenerate artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 14, 2022
1 parent 8119a9d commit 5b9ccc8
Show file tree
Hide file tree
Showing 13 changed files with 903 additions and 781 deletions.
23 changes: 18 additions & 5 deletions artifacts/derived_schema/creation/ghga_creation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from ghga_creation.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-07-11T09:13:31
# Generation date: 2022-07-14T08:38:44
# Schema: GHGA-Metadata-Schema
#
# id: https://w3id.org/GHGA-Metadata-Schema
Expand Down Expand Up @@ -1417,11 +1417,11 @@ class CreateFile(InformationContentEntity):

name: str = None
format: Union[str, "FileFormatEnum"] = None
size: int = None
checksum: str = None
checksum_type: str = None
alias: str = None
drs_uri: Optional[str] = None
size: Optional[int] = None
accession: Optional[str] = None
ega_accession: Optional[str] = None
has_attribute: Optional[Union[Union[dict, Attribute], List[Union[dict, Attribute]]]] = empty_list()
Expand All @@ -1437,6 +1437,11 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if not isinstance(self.format, FileFormatEnum):
self.format = FileFormatEnum(self.format)

if self._is_empty(self.size):
self.MissingRequiredField("size")
if not isinstance(self.size, int):
self.size = int(self.size)

if self._is_empty(self.checksum):
self.MissingRequiredField("checksum")
if not isinstance(self.checksum, str):
Expand All @@ -1455,9 +1460,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self.drs_uri is not None and not isinstance(self.drs_uri, str):
self.drs_uri = str(self.drs_uri)

if self.size is not None and not isinstance(self.size, int):
self.size = int(self.size)

if self.accession is not None and not isinstance(self.accession, str):
self.accession = str(self.accession)

Expand Down Expand Up @@ -2058,6 +2060,7 @@ class CreateSubmission(YAMLRoot):
has_dataset: Optional[Union[Union[dict, CreateDataset], List[Union[dict, CreateDataset]]]] = empty_list()
has_data_access_policy: Optional[Union[Union[dict, CreateDataAccessPolicy], List[Union[dict, CreateDataAccessPolicy]]]] = empty_list()
has_data_access_committee: Optional[Union[Union[dict, CreateDataAccessCommittee], List[Union[dict, CreateDataAccessCommittee]]]] = empty_list()
has_member: Optional[Union[Union[dict, CreateIndividual], List[Union[dict, CreateIndividual]]]] = empty_list()
has_publication: Optional[Union[Union[dict, CreatePublication], List[Union[dict, CreatePublication]]]] = empty_list()
submission_date: Optional[str] = None
submission_status: Optional[Union[str, "SubmissionStatusEnum"]] = None
Expand Down Expand Up @@ -2112,6 +2115,10 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
self.has_data_access_committee = [self.has_data_access_committee] if self.has_data_access_committee is not None else []
self.has_data_access_committee = [v if isinstance(v, CreateDataAccessCommittee) else CreateDataAccessCommittee(**as_dict(v)) for v in self.has_data_access_committee]

if not isinstance(self.has_member, list):
self.has_member = [self.has_member] if self.has_member is not None else []
self.has_member = [v if isinstance(v, CreateIndividual) else CreateIndividual(**as_dict(v)) for v in self.has_member]

if not isinstance(self.has_publication, list):
self.has_publication = [self.has_publication] if self.has_publication is not None else []
self.has_publication = [v if isinstance(v, CreatePublication) else CreatePublication(**as_dict(v)) for v in self.has_publication]
Expand Down Expand Up @@ -3335,6 +3342,9 @@ class slots:
slots.create_file_checksum_type = Slot(uri=GHGA.checksum_type, name="create file_checksum type", curie=GHGA.curie('checksum_type'),
model_uri=GHGA.create_file_checksum_type, domain=CreateFile, range=str)

slots.create_file_size = Slot(uri=GHGA.size, name="create file_size", curie=GHGA.curie('size'),
model_uri=GHGA.create_file_size, domain=CreateFile, range=int)

slots.create_analysis_alias = Slot(uri=GHGA.alias, name="create analysis_alias", curie=GHGA.curie('alias'),
model_uri=GHGA.create_analysis_alias, domain=CreateAnalysis, range=str)

Expand Down Expand Up @@ -3518,6 +3528,9 @@ class slots:
slots.create_submission_has_data_access_committee = Slot(uri=GHGA.has_data_access_committee, name="create submission_has data access committee", curie=GHGA.curie('has_data_access_committee'),
model_uri=GHGA.create_submission_has_data_access_committee, domain=CreateSubmission, range=Optional[Union[Union[dict, CreateDataAccessCommittee], List[Union[dict, CreateDataAccessCommittee]]]])

slots.create_submission_has_member = Slot(uri=GHGA.has_member, name="create submission_has member", curie=GHGA.curie('has_member'),
model_uri=GHGA.create_submission_has_member, domain=CreateSubmission, range=Optional[Union[Union[dict, CreateIndividual], List[Union[dict, CreateIndividual]]]])

slots.create_submission_has_publication = Slot(uri=GHGA.has_publication, name="create submission_has publication", curie=GHGA.curie('has_publication'),
model_uri=GHGA.create_submission_has_publication, domain=CreateSubmission, range=Optional[Union[Union[dict, CreatePublication], List[Union[dict, CreatePublication]]]])

Expand Down
Loading

0 comments on commit 5b9ccc8

Please sign in to comment.