From 493d5d32f40a5f417de241db82383ef278ff714a Mon Sep 17 00:00:00 2001 From: Sebastian Heppner Date: Fri, 11 Aug 2023 13:49:57 +0200 Subject: [PATCH] model.KeyTypes: Ignore mypy errors for abstract classes to be compliant Mypy appears to not like abstract classes in a context where only concrete classes should be given: ``` Only concrete class can be given where "tuple[type[Referable], KeyTypes]" is expected ``` However, the spec demands the three abstract classes - `EventElement` - `DataElement` - `SubmodelElement` to appear inside the `model.KeyTypes` Enum. Therefore, we ignore these errors via `# type: ignore`. --- basyx/aas/model/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/basyx/aas/model/__init__.py b/basyx/aas/model/__init__.py index 985457f24..0e7cad672 100644 --- a/basyx/aas/model/__init__.py +++ b/basyx/aas/model/__init__.py @@ -44,7 +44,7 @@ Submodel: KeyTypes.SUBMODEL, Entity: KeyTypes.ENTITY, BasicEventElement: KeyTypes.BASIC_EVENT_ELEMENT, - EventElement: KeyTypes.EVENT_ELEMENT, + EventElement: KeyTypes.EVENT_ELEMENT, # type: ignore Blob: KeyTypes.BLOB, File: KeyTypes.FILE, Operation: KeyTypes.OPERATION, @@ -53,10 +53,10 @@ MultiLanguageProperty: KeyTypes.MULTI_LANGUAGE_PROPERTY, Range: KeyTypes.RANGE, ReferenceElement: KeyTypes.REFERENCE_ELEMENT, - DataElement: KeyTypes.DATA_ELEMENT, + DataElement: KeyTypes.DATA_ELEMENT, # type: ignore SubmodelElementCollection: KeyTypes.SUBMODEL_ELEMENT_COLLECTION, SubmodelElementList: KeyTypes.SUBMODEL_ELEMENT_LIST, AnnotatedRelationshipElement: KeyTypes.ANNOTATED_RELATIONSHIP_ELEMENT, RelationshipElement: KeyTypes.RELATIONSHIP_ELEMENT, - SubmodelElement: KeyTypes.SUBMODEL_ELEMENT, + SubmodelElement: KeyTypes.SUBMODEL_ELEMENT, # type: ignore }