diff --git a/csa_header/__init__.py b/csa_header/__init__.py index ec9d558..0677a72 100644 --- a/csa_header/__init__.py +++ b/csa_header/__init__.py @@ -6,6 +6,7 @@ `_ `NiBabel `_ article. """ + from csa_header.header import CsaHeader __all__ = ["CsaHeader"] diff --git a/csa_header/ascii/ascconv.py b/csa_header/ascii/ascconv.py index 2b2aa19..e2ae9f7 100644 --- a/csa_header/ascii/ascconv.py +++ b/csa_header/ascii/ascconv.py @@ -37,6 +37,7 @@ We deal with this by dropping any assignments containing ``__attribute__``. """ + from __future__ import annotations import ast diff --git a/csa_header/ascii/header.py b/csa_header/ascii/header.py index 1c01874..2c51372 100644 --- a/csa_header/ascii/header.py +++ b/csa_header/ascii/header.py @@ -1,6 +1,7 @@ """ Definition of the :class:`CsaAsciiHeader`. """ + from typing import Union from csa_header.ascii.ascconv import parse_ascconv diff --git a/csa_header/ascii/messages.py b/csa_header/ascii/messages.py index b1cc79c..64125d3 100644 --- a/csa_header/ascii/messages.py +++ b/csa_header/ascii/messages.py @@ -1,6 +1,7 @@ """ Messages for the :mod:`~csa_header.ascii` module. """ + AST_N_TARGETS: str = "Invalid number of AST assignment targets! Expected 1, got {n_targets}." BAD_ASCCONV_TYPE: str = "Atom {el} has type {maker}, but expecting type {expected_type}" UNEXPECTED_LHS: str = "Unexpected LHS element: {target}" diff --git a/csa_header/header.py b/csa_header/header.py index a44c120..ce77c45 100644 --- a/csa_header/header.py +++ b/csa_header/header.py @@ -1,4 +1,5 @@ """Definition of the :class:`CsaHeader` class.""" + from collections.abc import Iterable from typing import Any diff --git a/csa_header/messages.py b/csa_header/messages.py index 3773213..499c162 100644 --- a/csa_header/messages.py +++ b/csa_header/messages.py @@ -1,6 +1,7 @@ """ Messages for the :mod:`csa_header` library. """ + INVALID_CHECK_BIT: str = ( "CSA element #{i_tag} has an invalid check bit value: {check_bit}!\nValid values are {valid_values}" ) diff --git a/csa_header/unpacker.py b/csa_header/unpacker.py index ee78dd8..27b1d9b 100644 --- a/csa_header/unpacker.py +++ b/csa_header/unpacker.py @@ -5,6 +5,7 @@ ---------- * https://github.com/nipy/nibabel/blob/4703f4d8e32be4cec30e829c2d93ebe54759bb62/nibabel/nicom/structreader.py """ + from __future__ import annotations from struct import Struct diff --git a/csa_header/utils.py b/csa_header/utils.py index 1ec745f..b661e0a 100644 --- a/csa_header/utils.py +++ b/csa_header/utils.py @@ -1,6 +1,7 @@ """ Utilities for the :mod:`csa_header` library. """ + # DICOM VR code to Python type VR_TO_TYPE = { "FL": float, # float diff --git a/tests/ascii/fixtures.py b/tests/ascii/fixtures.py index 11efb5f..67174d2 100644 --- a/tests/ascii/fixtures.py +++ b/tests/ascii/fixtures.py @@ -1,4 +1,5 @@ """Comparison values to test ascconv parsing.""" + from tests.fixtures import TEST_FILES_DIR RAW_ELEMENTS = """ diff --git a/tests/ascii/test_ascconv_sample.py b/tests/ascii/test_ascconv_sample.py index bffba78..f7407b7 100644 --- a/tests/ascii/test_ascconv_sample.py +++ b/tests/ascii/test_ascconv_sample.py @@ -1,6 +1,7 @@ """ Tests for the the Siemens "ASCCONV" parser. """ + import ast from collections import OrderedDict diff --git a/tests/fixtures.py b/tests/fixtures.py index 315ef0d..0644e1e 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -1,4 +1,5 @@ """Fixtures for tests.""" + from pathlib import Path TEST_FILES_DIR: Path = Path(__file__).parent / "files"