Skip to content

Commit

Permalink
Update to aas-core-meta, codegen, testgen 77d3442, 4433d092, 61106b572 (
Browse files Browse the repository at this point in the history
#48)

We update the development requirements to and re-generate everything
with:
* [aas-core-meta 77d3442],
* [aas-core-codegen 4433d092] and
* [aas-core3.0-testgen 61106b572].

Notably, we propagate the fix for V3.0 in the meta-model which reverted
the order of ``data_specification`` and ``data_specification_content``.
This was necessary so that the XML schemas for V3.0 remain backwards
compatible.

[aas-core-meta 77d3442]: aas-core-works/aas-core-meta@77d3442
[aas-core-codegen 4433d092]: aas-core-works/aas-core-codegen@4433d092
[aas-core3.0-testgen 61106b572]: aas-core-works/aas-core3.0-testgen@61106b572
  • Loading branch information
mristin authored Nov 6, 2024
1 parent fcaa700 commit 56de3f7
Show file tree
Hide file tree
Showing 1,071 changed files with 9,487 additions and 9,487 deletions.
34 changes: 17 additions & 17 deletions aas_core3/jsonization.py
Original file line number Diff line number Diff line change
Expand Up @@ -6899,32 +6899,32 @@ class _SetterForEmbeddedDataSpecification:

def __init__(self) -> None:
"""Initialize with all the properties unset."""
self.data_specification: Optional[aas_types.Reference] = None
self.data_specification_content: Optional[
aas_types.DataSpecificationContent
] = None
self.data_specification: Optional[aas_types.Reference] = None

def ignore(self, jsonable: Jsonable) -> None:
"""Ignore :paramref:`jsonable` and do not set anything."""
pass

def set_data_specification_content_from_jsonable(self, jsonable: Jsonable) -> None:
def set_data_specification_from_jsonable(self, jsonable: Jsonable) -> None:
"""
Parse :paramref:`jsonable` as the value of :py:attr:`~data_specification_content`.
Parse :paramref:`jsonable` as the value of :py:attr:`~data_specification`.
:param jsonable: input to be parsed
"""
self.data_specification_content = data_specification_content_from_jsonable(
jsonable
)
self.data_specification = reference_from_jsonable(jsonable)

def set_data_specification_from_jsonable(self, jsonable: Jsonable) -> None:
def set_data_specification_content_from_jsonable(self, jsonable: Jsonable) -> None:
"""
Parse :paramref:`jsonable` as the value of :py:attr:`~data_specification`.
Parse :paramref:`jsonable` as the value of :py:attr:`~data_specification_content`.
:param jsonable: input to be parsed
"""
self.data_specification = reference_from_jsonable(jsonable)
self.data_specification_content = data_specification_content_from_jsonable(
jsonable
)


def embedded_data_specification_from_jsonable(
Expand Down Expand Up @@ -6954,18 +6954,18 @@ def embedded_data_specification_from_jsonable(
exception.path._prepend(PropertySegment(jsonable_value, key))
raise exception

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

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

return aas_types.EmbeddedDataSpecification(
setter.data_specification_content, setter.data_specification
setter.data_specification, setter.data_specification_content
)


Expand Down Expand Up @@ -8296,8 +8296,8 @@ def data_specification_iec_61360_from_jsonable(
_SETTER_MAP_FOR_EMBEDDED_DATA_SPECIFICATION: Mapping[
str, Callable[[_SetterForEmbeddedDataSpecification, Jsonable], None]
] = {
"dataSpecificationContent": _SetterForEmbeddedDataSpecification.set_data_specification_content_from_jsonable,
"dataSpecification": _SetterForEmbeddedDataSpecification.set_data_specification_from_jsonable,
"dataSpecificationContent": _SetterForEmbeddedDataSpecification.set_data_specification_content_from_jsonable,
"modelType": _SetterForEmbeddedDataSpecification.ignore,
}

Expand Down Expand Up @@ -9524,12 +9524,12 @@ def transform_embedded_data_specification(
"""Serialize :paramref:`that` to a JSON-able representation."""
jsonable: MutableMapping[str, MutableJsonable] = dict()

jsonable["dataSpecification"] = self.transform(that.data_specification)

jsonable["dataSpecificationContent"] = self.transform(
that.data_specification_content
)

jsonable["dataSpecification"] = self.transform(that.data_specification)

return jsonable

# noinspection PyMethodMayBeStatic
Expand Down
22 changes: 11 additions & 11 deletions aas_core3/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5280,12 +5280,12 @@ class DataSpecificationContent(Class):
class EmbeddedDataSpecification(Class):
"""Embed the content of a data specification."""

#: Actual content of the data specification
data_specification_content: "DataSpecificationContent"

#: Reference to the data specification
data_specification: "Reference"

#: Actual content of the data specification
data_specification_content: "DataSpecificationContent"

def descend_once(self) -> Iterator[Class]:
"""
Iterate over the instances referenced from this instance.
Expand All @@ -5294,24 +5294,24 @@ def descend_once(self) -> Iterator[Class]:
:yield: instances directly referenced from this instance
"""
yield self.data_specification_content

yield self.data_specification

yield self.data_specification_content

def descend(self) -> Iterator[Class]:
"""
Iterate recursively over the instances referenced from this one.
:yield: instances recursively referenced from this instance
"""
yield self.data_specification_content

yield from self.data_specification_content.descend()

yield self.data_specification

yield from self.data_specification.descend()

yield self.data_specification_content

yield from self.data_specification_content.descend()

def accept(self, visitor: "AbstractVisitor") -> None:
"""Dispatch the :paramref:`visitor` on this instance."""
visitor.visit_embedded_data_specification(self)
Expand Down Expand Up @@ -5340,12 +5340,12 @@ def transform_with_context(

def __init__(
self,
data_specification_content: "DataSpecificationContent",
data_specification: "Reference",
data_specification_content: "DataSpecificationContent",
) -> None:
"""Initialize with the given values."""
self.data_specification_content = data_specification_content
self.data_specification = data_specification
self.data_specification_content = data_specification_content


class DataTypeIEC61360(enum.Enum):
Expand Down
8 changes: 4 additions & 4 deletions aas_core3/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -5587,14 +5587,14 @@ def transform_environment(self, that: aas_types.Environment) -> Iterator[Error]:
def transform_embedded_data_specification(
self, that: aas_types.EmbeddedDataSpecification
) -> Iterator[Error]:
for error in self.transform(that.data_specification_content):
error.path._prepend(PropertySegment(that, "data_specification_content"))
yield error

for error in self.transform(that.data_specification):
error.path._prepend(PropertySegment(that, "data_specification"))
yield error

for error in self.transform(that.data_specification_content):
error.path._prepend(PropertySegment(that, "data_specification_content"))
yield error

# noinspection PyMethodMayBeStatic
def transform_level_type(self, that: aas_types.LevelType) -> Iterator[Error]:
# No verification has been defined for LevelType.
Expand Down
40 changes: 20 additions & 20 deletions aas_core3/xmlization.py
Original file line number Diff line number Diff line change
Expand Up @@ -21267,10 +21267,19 @@ class _ReaderAndSetterForEmbeddedDataSpecification:

def __init__(self) -> None:
"""Initialize with all the properties unset."""
self.data_specification: Optional[aas_types.Reference] = None
self.data_specification_content: Optional[
aas_types.DataSpecificationContent
] = None
self.data_specification: Optional[aas_types.Reference] = None

def read_and_set_data_specification(
self, element: Element, iterator: Iterator[Tuple[str, Element]]
) -> None:
"""
Read :paramref:`element` as the property
:py:attr:`.types.EmbeddedDataSpecification.data_specification` and set it.
"""
self.data_specification = _read_reference_as_sequence(element, iterator)

def read_and_set_data_specification_content(
self, element: Element, iterator: Iterator[Tuple[str, Element]]
Expand Down Expand Up @@ -21304,15 +21313,6 @@ def read_and_set_data_specification_content(

self.data_specification_content = result

def read_and_set_data_specification(
self, element: Element, iterator: Iterator[Tuple[str, Element]]
) -> None:
"""
Read :paramref:`element` as the property
:py:attr:`.types.EmbeddedDataSpecification.data_specification` and set it.
"""
self.data_specification = _read_reference_as_sequence(element, iterator)


def _read_embedded_data_specification_as_sequence(
element: Element, iterator: Iterator[Tuple[str, Element]]
Expand Down Expand Up @@ -21384,19 +21384,19 @@ def _read_embedded_data_specification_as_sequence(
exception.path._prepend(ElementSegment(next_element))
raise

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

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

return aas_types.EmbeddedDataSpecification(
reader_and_setter.data_specification_content,
reader_and_setter.data_specification,
reader_and_setter.data_specification_content,
)


Expand Down Expand Up @@ -23615,8 +23615,8 @@ def _read_as_element(
None,
],
] = {
"dataSpecificationContent": _ReaderAndSetterForEmbeddedDataSpecification.read_and_set_data_specification_content,
"dataSpecification": _ReaderAndSetterForEmbeddedDataSpecification.read_and_set_data_specification,
"dataSpecificationContent": _ReaderAndSetterForEmbeddedDataSpecification.read_and_set_data_specification_content,
}


Expand Down Expand Up @@ -26411,14 +26411,14 @@ def _write_embedded_data_specification_as_sequence(

:param that: instance to be serialized
"""
self._write_start_element("dataSpecificationContent")
self.visit(that.data_specification_content)
self._write_end_element("dataSpecificationContent")

self._write_start_element("dataSpecification")
self._write_reference_as_sequence(that.data_specification)
self._write_end_element("dataSpecification")

self._write_start_element("dataSpecificationContent")
self.visit(that.data_specification_content)
self._write_end_element("dataSpecificationContent")

def visit_embedded_data_specification(
self, that: aas_types.EmbeddedDataSpecification
) -> None:
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ pylint==2.15.4
coverage>=6.5.0,<7
pyinstaller>=5,<6
twine
aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@f9cbdb3#egg=aas-core-meta
aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@6df5c9e8#egg=aas-core-codegen
aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@77d3442#egg=aas-core-meta
aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@4433d092#egg=aas-core-codegen
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<administration>
<embeddedDataSpecifications>
<embeddedDataSpecification>
<dataSpecification>
<type>ExternalReference</type>
<keys>
<key>
<type>GlobalReference</type>
<value>urn:something14:18179b7a</value>
</key>
</keys>
</dataSpecification>
<dataSpecificationContent>
<dataSpecificationIec61360>
<preferredName>
Expand All @@ -19,15 +28,6 @@
<value>something_bebf64f0</value>
</dataSpecificationIec61360>
</dataSpecificationContent>
<dataSpecification>
<type>ExternalReference</type>
<keys>
<key>
<type>GlobalReference</type>
<value>urn:something14:18179b7a</value>
</key>
</keys>
</dataSpecification>
</embeddedDataSpecification>
</embeddedDataSpecifications>
<version>1230</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<administration>
<embeddedDataSpecifications>
<embeddedDataSpecification>
<dataSpecification>
<type>ExternalReference</type>
<keys>
<key>
<type>GlobalReference</type>
<value>urn:something14:18179b7a</value>
</key>
</keys>
</dataSpecification>
<dataSpecificationContent>
<dataSpecificationIec61360>
<preferredName>
Expand All @@ -19,15 +28,6 @@
<value>something_bebf64f0</value>
</dataSpecificationIec61360>
</dataSpecificationContent>
<dataSpecification>
<type>ExternalReference</type>
<keys>
<key>
<type>GlobalReference</type>
<value>urn:something14:18179b7a</value>
</key>
</keys>
</dataSpecification>
</embeddedDataSpecification>
</embeddedDataSpecifications>
<version>1230</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<administration>
<embeddedDataSpecifications>
<embeddedDataSpecification>
<dataSpecification>
<type>ExternalReference</type>
<keys>
<key>
<type>GlobalReference</type>
<value>urn:something14:18179b7a</value>
</key>
</keys>
</dataSpecification>
<dataSpecificationContent>
<dataSpecificationIec61360>
<preferredName>
Expand All @@ -19,15 +28,6 @@
<value>something_bebf64f0</value>
</dataSpecificationIec61360>
</dataSpecificationContent>
<dataSpecification>
<type>ExternalReference</type>
<keys>
<key>
<type>GlobalReference</type>
<value>urn:something14:18179b7a</value>
</key>
</keys>
</dataSpecification>
</embeddedDataSpecification>
</embeddedDataSpecifications>
<version>1230</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<administration>
<embeddedDataSpecifications>
<embeddedDataSpecification>
<dataSpecification>
<type>ExternalReference</type>
<keys>
<key>
<type>GlobalReference</type>
<value>urn:something14:18179b7a</value>
</key>
</keys>
</dataSpecification>
<dataSpecificationContent>
<dataSpecificationIec61360>
<preferredName>
Expand All @@ -19,15 +28,6 @@
<value>something_bebf64f0</value>
</dataSpecificationIec61360>
</dataSpecificationContent>
<dataSpecification>
<type>ExternalReference</type>
<keys>
<key>
<type>GlobalReference</type>
<value>urn:something14:18179b7a</value>
</key>
</keys>
</dataSpecification>
</embeddedDataSpecification>
</embeddedDataSpecifications>
<version>1230</version>
Expand Down
Loading

0 comments on commit 56de3f7

Please sign in to comment.