Skip to content

Commit d753f24

Browse files
committed
Add unused / bad practice imports (F4)
1 parent fcf7c1d commit d753f24

12 files changed

Lines changed: 35 additions & 16 deletions

File tree

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ select = [
1818
"D204", "D211", "D201", "D300", # basic docstring formatting
1919
"I", # isort
2020
"F8", # pyflakes: undefined/unused names
21+
"F4", # pyflakes: imports/__future__
2122
]
2223

2324
# TODO: Revisit these
@@ -31,7 +32,6 @@ ignore = [
3132
"A", # prevent shadowing of python builtins
3233
"FIX", # prevent the creation of T0DO / F1XME comments
3334
# Checked, need manual work:
34-
"F4", # pyflakes: imports/__future__
3535
"PIE", # small readability improvements
3636
"PYI", # typing best practices
3737
# Evaluate if we want to use:

sdk/basyx/aas/adapter/json/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,16 @@
3131
object_store_to_json,
3232
write_aas_json_file,
3333
)
34+
35+
__all__ = [
36+
"AASFromJsonDecoder",
37+
"StrictAASFromJsonDecoder",
38+
"StrictStrippedAASFromJsonDecoder",
39+
"StrippedAASFromJsonDecoder",
40+
"read_aas_json_file",
41+
"read_aas_json_file_into",
42+
"AASToJsonEncoder",
43+
"StrippedAASToJsonEncoder",
44+
"object_store_to_json",
45+
"write_aas_json_file",
46+
]

sdk/basyx/aas/adapter/json/json_serialization.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
import base64
3131
import contextlib
32-
import inspect
3332
import io
3433
import json
3534
from typing import (

sdk/basyx/aas/adapter/xml/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,18 @@
2626
write_aas_xml_element,
2727
write_aas_xml_file,
2828
)
29+
30+
__all__ = [
31+
"AASFromXmlDecoder",
32+
"StrictAASFromXmlDecoder",
33+
"StrictStrippedAASFromXmlDecoder",
34+
"StrippedAASFromXmlDecoder",
35+
"XMLConstructables",
36+
"read_aas_xml_element",
37+
"read_aas_xml_file",
38+
"read_aas_xml_file_into",
39+
"object_store_to_xml_element",
40+
"object_to_xml_element",
41+
"write_aas_xml_element",
42+
"write_aas_xml_file",
43+
]

sdk/basyx/aas/adapter/xml/xml_serialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"""
3333

3434
import base64
35-
from typing import Callable, Dict, Optional, Type
35+
from typing import Dict, Optional, Type
3636

3737
from lxml import etree
3838

sdk/basyx/aas/model/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from basyx.aas.model import AssetAdministrationShell, Submodel, Property
99
"""
1010

11-
from . import datatypes
11+
import inspect
12+
1213
from .aas import *
1314
from .base import *
1415
from .concept import ConceptDescription

sdk/basyx/aas/model/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"""
1111

1212
import abc
13-
import inspect
1413
import itertools
1514
import re
1615
from enum import Enum, unique
@@ -927,7 +926,6 @@ def _set_id_short(self, id_short: Optional[NameType]):
927926
f"id_short of {self!r} cannot be unset, since it is already "
928927
f"contained in {self.parent!r}",
929928
)
930-
from .submodel import SubmodelElementList
931929

932930
for set_ in self.parent.namespace_element_sets:
933931
if set_.contains_id("id_short", id_short):

sdk/basyx/aas/model/submodel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
Iterable,
1717
List,
1818
Optional,
19-
Set,
2019
Type,
2120
TypeVar,
2221
Union,

sdk/test/adapter/aasx/test_aasx.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from basyx.aas.examples.data import (
2020
_helper,
2121
example_aas,
22-
example_aas_mandatory_attributes,
2322
)
2423

2524

sdk/test/backend/test_couchdb.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# SPDX-License-Identifier: MIT
77
import unittest
88
import unittest.mock
9-
import urllib.error
109

1110
from basyx.aas.backend import couchdb
1211
from basyx.aas.examples.data.example_aas import *

0 commit comments

Comments
 (0)