Skip to content

Commit

Permalink
Update to meta-model V3.0.1 (#11)
Browse files Browse the repository at this point in the history
We patch the Python SDK which has been updated to the meta-model V3.0.1.
  • Loading branch information
mristin authored Aug 25, 2024
1 parent 1db67ab commit 6711efb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
8 changes: 6 additions & 2 deletions aas_core3/jsonization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5312,6 +5312,11 @@ def embedded_data_specification_from_jsonable(
"The required property 'dataSpecificationContent' is missing"
)

if setter.data_specification is None:
raise DeserializationException(
"The required property 'dataSpecification' is missing"
)

return aas_types.EmbeddedDataSpecification(
setter.data_specification_content, setter.data_specification
)
Expand Down Expand Up @@ -7563,8 +7568,7 @@ def transform_embedded_data_specification(self, that):
that.data_specification_content
)

if that.data_specification is not None:
jsonable["dataSpecification"] = self.transform(that.data_specification)
jsonable["dataSpecification"] = self.transform(that.data_specification)

return jsonable

Expand Down
10 changes: 4 additions & 6 deletions aas_core3/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3501,19 +3501,17 @@ def descend_once(self):

yield self.data_specification_content

if self.data_specification is not None:
yield self.data_specification
yield self.data_specification

def descend(self):

yield self.data_specification_content

yield from self.data_specification_content.descend()

if self.data_specification is not None:
yield self.data_specification
yield self.data_specification

yield from self.data_specification.descend()
yield from self.data_specification.descend()

def accept(self, visitor):

Expand All @@ -3540,7 +3538,7 @@ def transform_with_context(
def __init__(
self,
data_specification_content,
data_specification=None,
data_specification,
):

self.data_specification_content = data_specification_content
Expand Down
4 changes: 2 additions & 2 deletions aas_core3/types.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3554,7 +3554,7 @@ class EmbeddedDataSpecification(Class):
data_specification_content: "DataSpecificationContent"

#: Reference to the data specification
data_specification: Optional["Reference"]
data_specification: "Reference"

def descend_once(self) -> Iterator[Class]:
"""
Expand Down Expand Up @@ -3601,7 +3601,7 @@ class EmbeddedDataSpecification(Class):
def __init__(
self,
data_specification_content: "DataSpecificationContent",
data_specification: Optional["Reference"] = None,
data_specification: "Reference",
) -> None:
"""Initialize with the given values."""
...
Expand Down
7 changes: 3 additions & 4 deletions aas_core3/xmlization.py
Original file line number Diff line number Diff line change
Expand Up @@ -1991,10 +1991,9 @@ def _write_embedded_data_specification_as_sequence(self, that):
self.visit(that.data_specification_content)
self._write_end_element("dataSpecificationContent")

if that.data_specification is not None:
self._write_start_element("dataSpecification")
self._write_reference_as_sequence(that.data_specification)
self._write_end_element("dataSpecification")
self._write_start_element("dataSpecification")
self._write_reference_as_sequence(that.data_specification)
self._write_end_element("dataSpecification")

def visit_embedded_data_specification(self, that):

Expand Down

0 comments on commit 6711efb

Please sign in to comment.