Skip to content

Commit

Permalink
Update to aas-core-meta, codegen, testgen 44756fb, e2b793f, bf3720d7 (#…
Browse files Browse the repository at this point in the history
…18)

We update the development requirements to and re-generate everything
with:
* [aas-core-meta 44756fb],
* [aas-core-codegen e2b793f] and
* [aas-core3.0-testgen bf3720d7].

This is an important patch propagating in particular the following fixes
which affected the constraints and their documentation:

* Pull requests in aas-core-meta [#271], [#272] and [#273] which affect the
  nullability checks in constraints,
* Pull request in aas-core-meta [#275] which affects the documentation
  of many constraints.

This patch also includes a propagation of improved test data:

* Pull request in aas-core3.0-testgen [#12] which makes the
  errors in XML more meaningful and easier to debug, and
* Pull request in aas-core3.0-testgen [#13] which makes the type
  violations of enumerations more explicit and thus easier to debug.

[aas-core-meta 44756fb]: aas-core-works/aas-core-meta@44756fb
[aas-core-codegen e2b793f]: aas-core-works/aas-core-codegen@e2b793f
[aas-core3.0-testgen bf3720d7]: aas-core-works/aas-core3.0-testgen@bf3720d7

[#271]: aas-core-works/aas-core-meta#271
[#272]: aas-core-works/aas-core-meta#272
[#273]: aas-core-works/aas-core-meta#273
[#275]: aas-core-works/aas-core-meta#275

[#12]: aas-core-works/aas-core3.0-testgen#12
[#13]: aas-core-works/aas-core3.0-testgen#13
  • Loading branch information
mristin authored Jun 24, 2023
1 parent 99870fd commit 0689460
Show file tree
Hide file tree
Showing 200 changed files with 486 additions and 1,322 deletions.
2 changes: 1 addition & 1 deletion dev_scripts/aas_core3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
This copy is necessary so that we can decouple from ``aas-core*-python`` repository.
The revision of aas-core-codegen was: a8a510e
The revision of aas-core-codegen was: e2b793f
"""
134 changes: 88 additions & 46 deletions dev_scripts/aas_core3/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,17 +680,17 @@ class Qualifiable(Class):
The value of a qualifiable element may be further qualified by one or more
qualifiers.
.. note::
This constraint is checked at :py:class:`Submodel`.
:constraint AASd-119:
.. _constraint_AASd-119:
If any :py:attr:`Qualifier.kind` value of :py:attr:`qualifiers` is
equal to :py:attr:`QualifierKind.TEMPLATE_QUALIFIER` and the qualified element
inherits from :py:class:`HasKind` then the qualified element shall be of
kind Template (:py:attr:`HasKind.kind` = :py:attr:`ModellingKind.TEMPLATE`).
.. note::
This constraint is checked at :py:class:`Submodel`.
"""

#: Additional qualification of a qualifiable element.
Expand Down Expand Up @@ -1063,29 +1063,29 @@ class AssetInformation(Class):
does not already exist, the corresponding attribute :py:attr:`global_asset_id` is
optional.
.. note::
:ref:`Constraint AASd-116 <constraint_AASd-116>` is important to enable a generic search across global
and specific asset IDs.
.. note::
In the book, :ref:`Constraint AASd-116 <constraint_AASd-116>` imposes a
case-insensitive equality against ``globalAssetId``. This is
culturally-dependent, and depends on the system settings.
For example, the case-folding for the letters "i" and "I" is
different in Turkish from English.
We implement the constraint as case-sensitive instead to allow
for interoperability across different culture settings.
:constraint AASd-116:
.. _constraint_AASd-116:
``globalAssetId`` is a reserved key. If used as value for
:py:attr:`SpecificAssetID.name` then :py:attr:`SpecificAssetID.value` shall be
identical to :py:attr:`global_asset_id`.
.. note::
:ref:`Constraint AASd-116 <constraint_AASd-116>` is important to enable a generic search across
global and specific asset IDs.
.. note::
In the book, :ref:`Constraint AASd-116 <constraint_AASd-116>` imposes a
case-insensitive equality against ``globalAssetId``. This is
culturally-dependent, and depends on the system settings.
For example, the case-folding for the letters "i" and "I" is
different in Turkish from English.
We implement the constraint as case-sensitive instead to allow
for interoperability across different culture settings.
:constraint AASd-131:
.. _constraint_AASd-131:
Expand Down Expand Up @@ -4585,25 +4585,60 @@ class ConceptDescription(Identifiable, HasDataSpecification):
The description of the concept should follow a standardized schema (realized as
data specification template).
.. note::
:constraint AASc-3a-004:
.. _constraint_AASc-3a-004:
Note: categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
For a :py:class:`ConceptDescription` with :py:attr:`category` ``PROPERTY`` or
``VALUE`` using data specification IEC61360,
the :py:attr:`DataSpecificationIEC61360.data_type` is mandatory and shall be
one of: ``DATE``, ``STRING``, ``STRING_TRANSLATABLE``, ``INTEGER_MEASURE``,
``INTEGER_COUNT``, ``INTEGER_CURRENCY``, ``REAL_MEASURE``, ``REAL_COUNT``,
``REAL_CURRENCY``, ``BOOLEAN``, ``RATIONAL``, ``RATIONAL_MEASURE``,
``TIME``, ``TIMESTAMP``.
.. note::
.. note::
Note: categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
Note: categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
.. note::
:constraint AASc-3a-005:
.. _constraint_AASc-3a-005:
Categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
For a :py:class:`ConceptDescription` with :py:attr:`category` ``REFERENCE``
using data specification template IEC61360,
the :py:attr:`DataSpecificationIEC61360.data_type` shall be
one of: ``STRING``, ``IRI``, ``IRDI``.
.. note::
.. note::
Note: categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
:constraint AASc-3a-006:
.. _constraint_AASc-3a-006:
For a :py:class:`ConceptDescription` with :py:attr:`category` ``DOCUMENT``
using data specification IEC61360,
the :py:attr:`DataSpecificationIEC61360.data_type` shall be one of ``FILE``,
``BLOB``, ``HTML``
.. note::
Categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
Categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
:constraint AASc-3a-007:
.. _constraint_AASc-3a-007:
For a :py:class:`ConceptDescription` with :py:attr:`category` ``QUALIFIER_TYPE``
using data specification IEC61360,
the :py:attr:`DataSpecificationIEC61360.data_type` is mandatory and shall be
defined.
.. note::
Categories are deprecated since V3.0 of Part 1a of the document series
"Details of the Asset Administration Shell".
:constraint AASc-3a-008:
.. _constraint_AASc-3a-008:
Expand Down Expand Up @@ -6187,20 +6222,6 @@ class DataSpecificationIEC61360(DataSpecificationContent):
Content of data specification template for concept descriptions for properties,
values and value lists conformant to IEC 61360.
.. note::
It is also possible that both :py:attr:`value` and :py:attr:`value_list` are empty.
This is the case for concept descriptions that define the semantics of a
property but do not have an enumeration (:py:attr:`value_list`) as data type.
.. note::
Although it is possible to define a :py:class:`ConceptDescription` for a
:attr:´value_list`,
it is not possible to reuse this :py:attr:`value_list`.
It is only possible to directly add a :py:attr:`value_list` as data type
to a specific semantic definition of a property.
.. note::
IEC61360 requires also a globally unique identifier for a concept
Expand All @@ -6218,6 +6239,27 @@ class DataSpecificationIEC61360(DataSpecificationContent):
:py:attr:`preferred_name`. Same holds for
:py:attr:`ConceptDescription.description` and :py:attr:`definition`.
:constraint AASc-3a-010:
.. _constraint_AASc-3a-010:
If :py:attr:`value` is not empty then :py:attr:`value_list` shall be empty
and vice versa.
.. note::
It is also possible that both :py:attr:`value` and :py:attr:`value_list` are
empty. This is the case for concept descriptions that define the semantics
of a property but do not have an enumeration (:py:attr:`value_list`) as
data type.
.. note::
Although it is possible to define a :py:class:`ConceptDescription` for a
:attr:´value_list`,
it is not possible to reuse this :py:attr:`value_list`.
It is only possible to directly add a :py:attr:`value_list` as data type
to a specific semantic definition of a property.
:constraint AASc-3a-009:
.. _constraint_AASc-3a-009:
Expand Down
7 changes: 4 additions & 3 deletions dev_scripts/aas_core3/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,8 @@ def transform_asset_information(
specific_asset_id.name != 'globalAssetId'
or (
(
specific_asset_id.name == 'globalAssetId'
(that.global_asset_id is not None)
and specific_asset_id.name == 'globalAssetId'
and specific_asset_id.value == that.global_asset_id
)
)
Expand Down Expand Up @@ -2784,7 +2785,7 @@ def transform_submodel(
if not (
not (that.submodel_elements is not None)
or (
not (that.kind != aas_types.ModellingKind.TEMPLATE)
not (that.kind_or_default() != aas_types.ModellingKind.TEMPLATE)
or (
all(
not (submodel_element.qualifiers is not None)
Expand Down Expand Up @@ -8085,7 +8086,7 @@ def transform_data_specification_iec_61360(
if not (
not (
(
(that.data_type is None)
(that.data_type is not None)
and (that.data_type in aas_constants.IEC_61360_DATA_TYPES_WITH_UNIT)
)
)
Expand Down
4 changes: 2 additions & 2 deletions dev_scripts/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
keywords="asset administration shell code generation industry 4.0 industrie i4.0",
packages=find_packages(exclude=["tests", "continuous_integration", "dev_scripts"]),
install_requires=[
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@0b256cc#egg=aas-core-meta",
"aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@a8a510e#egg=aas-core-codegen",
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@44756fb#egg=aas-core-meta",
"aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@e2b793f#egg=aas-core-codegen",
],
py_modules=["test_codegen"],
)
Loading

0 comments on commit 0689460

Please sign in to comment.