From 50d13f3918be3b2c94bb476115f9325ba21ac635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20M=C3=B6ller?= Date: Tue, 30 Apr 2024 17:04:51 +0200 Subject: [PATCH] backend, model: remove calls to trivial super().__init__() methods These are unsafe, according to mypy: error: Call to abstract method "__init__" of "DataSpecificationContent" with trivial body via super() is unsafe [safe-super] --- basyx/aas/backend/couchdb.py | 1 - basyx/aas/backend/local_file.py | 1 - basyx/aas/model/base.py | 1 - basyx/aas/model/provider.py | 1 - 4 files changed, 4 deletions(-) diff --git a/basyx/aas/backend/couchdb.py b/basyx/aas/backend/couchdb.py index b59186d97..a3a1e5e32 100644 --- a/basyx/aas/backend/couchdb.py +++ b/basyx/aas/backend/couchdb.py @@ -246,7 +246,6 @@ def __init__(self, url: str, database: str): :param url: URL to the CouchDB :param database: Name of the Database inside the CouchDB """ - super().__init__() self.url: str = url self.database_name: str = database diff --git a/basyx/aas/backend/local_file.py b/basyx/aas/backend/local_file.py index f5176dbc7..5a2c93f11 100644 --- a/basyx/aas/backend/local_file.py +++ b/basyx/aas/backend/local_file.py @@ -77,7 +77,6 @@ def __init__(self, directory_path: str): :param directory_path: Path to the local file backend (the path where you want to store your AAS JSON files) """ - super().__init__() self.directory_path: str = directory_path.rstrip("/") # A dictionary of weak references to local replications of stored objects. Objects are kept in this cache as diff --git a/basyx/aas/model/base.py b/basyx/aas/model/base.py index 51112c9b5..34003af9d 100644 --- a/basyx/aas/model/base.py +++ b/basyx/aas/model/base.py @@ -2377,7 +2377,6 @@ def __init__(self, value: Optional[ValueTypeIEC61360] = None, level_types: Iterable[IEC61360LevelType] = ()): - super().__init__() self.preferred_name: PreferredNameTypeIEC61360 = preferred_name self.short_name: Optional[ShortNameTypeIEC61360] = short_name self.data_type: Optional[DataTypeIEC61360] = data_type diff --git a/basyx/aas/model/provider.py b/basyx/aas/model/provider.py index c1bc4bdb8..fd26e8d0a 100644 --- a/basyx/aas/model/provider.py +++ b/basyx/aas/model/provider.py @@ -86,7 +86,6 @@ class DictObjectStore(AbstractObjectStore[_IT], Generic[_IT]): :class:`~basyx.aas.model.base.Identifier` → :class:`~basyx.aas.model.base.Identifiable` """ def __init__(self, objects: Iterable[_IT] = ()) -> None: - super().__init__() self._backend: Dict[Identifier, _IT] = {} for x in objects: self.add(x)