diff options
author | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-09-08 14:24:39 +0100 |
---|---|---|
committer | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-09-09 17:21:48 +0100 |
commit | f5b293d0927506c2a979a091bf0d07ecc78fa181 (patch) | |
tree | 4de585b7cb6ed34da8237063752270189a730a41 /src/mlia/backend/system.py | |
parent | cde0c6ee140bd108849bff40467d8f18ffc332ef (diff) | |
download | mlia-f5b293d0927506c2a979a091bf0d07ecc78fa181.tar.gz |
MLIA-386 Simplify typing in the source code
- Enable deferred annotations evaluation
- Use builtin types for type hints whenever possible
- Use | syntax for union types
- Rename mlia.core._typing into mlia.core.typing
Change-Id: I3f6ffc02fa069c589bdd9e8bddbccd504285427a
Diffstat (limited to 'src/mlia/backend/system.py')
-rw-r--r-- | src/mlia/backend/system.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mlia/backend/system.py b/src/mlia/backend/system.py index ff85bf3..0e51ab2 100644 --- a/src/mlia/backend/system.py +++ b/src/mlia/backend/system.py @@ -1,12 +1,12 @@ # SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. # SPDX-License-Identifier: Apache-2.0 """System backend module.""" +from __future__ import annotations + from pathlib import Path from typing import Any from typing import cast -from typing import Dict from typing import List -from typing import Tuple from mlia.backend.common import Backend from mlia.backend.common import ConfigurationException @@ -33,7 +33,7 @@ class System(Backend): def _setup_reporting(self, config: SystemConfig) -> None: self.reporting = config.get("reporting") - def run(self, command: str) -> Tuple[int, bytearray, bytearray]: + def run(self, command: str) -> tuple[int, bytearray, bytearray]: """ Run command on the system. @@ -63,7 +63,7 @@ class System(Backend): return super().__eq__(other) and self.name == other.name - def get_details(self) -> Dict[str, Any]: + def get_details(self) -> dict[str, Any]: """Return a dictionary with all relevant information of a System.""" output = { "type": "system", @@ -76,12 +76,12 @@ class System(Backend): return output -def get_available_systems_directory_names() -> List[str]: +def get_available_systems_directory_names() -> list[str]: """Return a list of directory names for all avialable systems.""" return [entry.name for entry in get_backend_directories("systems")] -def get_available_systems() -> List[System]: +def get_available_systems() -> list[System]: """Return a list with all available systems.""" available_systems = [] for config_json in get_backend_configs("systems"): |