Skip to content

Commit c0a3e87

Browse files
committed
TYPE_CHECKING blocks where relevant
1 parent d66da94 commit c0a3e87

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

sdds/classes.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@
77
https://ops.aps.anl.gov/manuals/SDDStoolkit/SDDStoolkitsu2.html
88
"""
99

10+
from __future__ import annotations
11+
1012
import logging
1113
import warnings
12-
from collections.abc import Iterator
1314
from dataclasses import dataclass, fields
14-
from typing import Any, ClassVar
15+
from typing import TYPE_CHECKING, Any, ClassVar
16+
17+
if TYPE_CHECKING:
18+
from collections.abc import Iterator
1519

1620
LOGGER = logging.getLogger(__name__)
1721

sdds/reader.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
It provides a high-level function to read SDDS files in different formats, and a series of helpers.
77
"""
88

9+
from __future__ import annotations
10+
911
import gzip
1012
import os
1113
import pathlib

sdds/writer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
It provides a high-level function to write SDDS files in different formats, and a series of helpers.
77
"""
88

9+
from __future__ import annotations
10+
911
import pathlib
1012
import struct
11-
from collections.abc import Iterable
12-
from typing import IO, Any
13+
from typing import IO, TYPE_CHECKING, Any
1314

1415
import numpy as np
1516

@@ -25,6 +26,9 @@
2526
get_dtype_str,
2627
)
2728

29+
if TYPE_CHECKING:
30+
from collections.abc import Iterable
31+
2832

2933
def write_sdds(sdds_file: SddsFile, output_path: pathlib.Path | str) -> None:
3034
"""

0 commit comments

Comments
 (0)