diff --git a/aas_core3/verification.py b/aas_core3/verification.py index a22e2025..6f4b1e93 100644 --- a/aas_core3/verification.py +++ b/aas_core3/verification.py @@ -122,6 +122,9 @@ def __init__(self, cause: str) -> None: self.cause = cause self.path = Path() + def __repr__(self) -> str: + return f"Error(path={self.path}, cause={self.cause})" + # noinspection SpellCheckingInspection def _construct_matches_id_short() -> Pattern[str]: @@ -2238,15 +2241,12 @@ def transform_asset_information( ( ( (that.global_asset_id is not None) - and (that.specific_asset_ids is None) + or (that.specific_asset_ids is not None) ) ) - or ( - ( - (that.global_asset_id is None) - and (that.specific_asset_ids is not None) - and len(that.specific_asset_ids) >= 1 - ) + and ( + not (that.specific_asset_ids is not None) + or (len(that.specific_asset_ids) >= 1) ) ) ): @@ -5676,18 +5676,7 @@ def transform_lang_string_definition_type_iec_61360( def transform_data_specification_iec_61360( self, that: aas_types.DataSpecificationIEC61360 ) -> Iterator[Error]: - if not ( - ( - (((that.value is not None) and (that.value_list is None))) - or ( - ( - (that.value is None) - and (that.value_list is not None) - and len(that.value_list.value_reference_pairs) >= 1 - ) - ) - ) - ): + if not (not (((that.value is not None) and (that.value_list is not None)))): yield Error( "Constraint AASc-3a-010: If value is not empty then value " + "list shall be empty and vice versa." diff --git a/requirements-dev.txt b/requirements-dev.txt index 2531abe5..c625ce6f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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@44756fb#egg=aas-core-meta -aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@607f65c#egg=aas-core-codegen +aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@4d7e59e#egg=aas-core-meta +aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@18986a0#egg=aas-core-codegen diff --git a/test_data/Json/ContainedInEnvironment/Unexpected/MinLengthViolation/ValueList/valueReferencePairs.json.errors b/test_data/Json/ContainedInEnvironment/Unexpected/MinLengthViolation/ValueList/valueReferencePairs.json.errors index b07c67bb..a247a3f2 100644 --- a/test_data/Json/ContainedInEnvironment/Unexpected/MinLengthViolation/ValueList/valueReferencePairs.json.errors +++ b/test_data/Json/ContainedInEnvironment/Unexpected/MinLengthViolation/ValueList/valueReferencePairs.json.errors @@ -1,2 +1 @@ -.asset_administration_shells[0].embedded_data_specifications[0].data_specification_content: Constraint AASc-3a-010: If value is not empty then value list shall be empty and vice versa. .asset_administration_shells[0].embedded_data_specifications[0].data_specification_content.value_list: Value reference pair types must contain at least one item. \ No newline at end of file diff --git a/test_data/Xml/ContainedInEnvironment/Unexpected/MinLengthViolation/valueList/valueReferencePairs.xml.errors b/test_data/Xml/ContainedInEnvironment/Unexpected/MinLengthViolation/valueList/valueReferencePairs.xml.errors index b07c67bb..a247a3f2 100644 --- a/test_data/Xml/ContainedInEnvironment/Unexpected/MinLengthViolation/valueList/valueReferencePairs.xml.errors +++ b/test_data/Xml/ContainedInEnvironment/Unexpected/MinLengthViolation/valueList/valueReferencePairs.xml.errors @@ -1,2 +1 @@ -.asset_administration_shells[0].embedded_data_specifications[0].data_specification_content: Constraint AASc-3a-010: If value is not empty then value list shall be empty and vice versa. .asset_administration_shells[0].embedded_data_specifications[0].data_specification_content.value_list: Value reference pair types must contain at least one item. \ No newline at end of file