Skip to content

Commit 204d90f

Browse files
committed
Fixed few mypy warnings, disabling mypy warnings
1 parent 918ec0d commit 204d90f

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

pygdtf/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ def __exit__(self, exc_type, exc_val, exc_tb):
120120
self._package.close()
121121

122122
def _read_xml(self):
123+
assert self._gdtf is not None
124+
assert self._root is not None
123125
self.data_version = self._gdtf.get("DataVersion", 1.2)
124126
self.name = self._root.get("Name")
125127
self.short_name = self._root.get("ShortName")
@@ -312,7 +314,7 @@ def _read_xml(self):
312314
else:
313315
self.ft_presets = []
314316

315-
self.protocols = []
317+
self.protocols: List[BaseNode] = []
316318
protocols_collect = self._root.find("Protocols")
317319
if protocols_collect is not None:
318320
for i in protocols_collect.findall("FTRDM"):
@@ -1275,7 +1277,7 @@ def flattened(self):
12751277

12761278
def by_breaks(self, as_dict=False):
12771279
# this is to unflatten the list
1278-
grouped = {}
1280+
grouped: Dict[int, List] = {}
12791281

12801282
for item in self:
12811283
key = item.dmx_break

pygdtf/geometries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def iterate_geometries(collector):
8282
if hasattr(g, "geometries"):
8383
iterate_geometries(g)
8484

85-
matched = []
85+
matched: List["Geometry"] = []
8686
iterate_geometries(self)
8787
if matched:
8888
return matched[0]

pygdtf/utils/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,8 @@ def calculate_complexity(gdtf_profile: Optional["pygdtf.FixtureType"] = None):
345345
slot
346346
for wheel in gdtf_profile.wheels
347347
for slot in wheel.wheel_slots
348-
if slot.media_file_name.name is not None
348+
if slot.media_file_name is not None
349+
and slot.media_file_name.name is not None
349350
]
350351
)
351352
facets_count = len(

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ dev = [
6464
Repository = "https://github.com/open-stage/python-gdtf.git"
6565
Changelog = "https://github.com/open-stage/python-gdtf/blob/master/CHANGELOG.md"
6666

67+
[tool.mypy]
68+
check_untyped_defs = false
69+
disable_error_code = ["annotation-unchecked"]

0 commit comments

Comments
 (0)