Skip to content

Commit

Permalink
Remove type hints using types also in CTF reader file
Browse files Browse the repository at this point in the history
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
  • Loading branch information
hakonanes committed May 11, 2024
1 parent 0b34bc2 commit a68d37e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions orix/io/plugins/ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from io import TextIOWrapper
import re
from typing import Dict, List, Tuple

from diffpy.structure import Lattice, Structure
import numpy as np
Expand Down Expand Up @@ -143,7 +144,7 @@ def file_reader(filename: str) -> CrystalMap:
return CrystalMap(**data_dict)


def _get_header(file: TextIOWrapper) -> tuple[list[str], int, list[str]]:
def _get_header(file: TextIOWrapper) -> Tuple[List[str], int, List[str]]:
"""Return file header, row number of start of data in file, and the
detected vendor(s).
Expand Down Expand Up @@ -193,7 +194,7 @@ def _get_header(file: TextIOWrapper) -> tuple[list[str], int, list[str]]:
return header, i + 1, vendor


def _get_phases_from_header(header: list[str]) -> dict:
def _get_phases_from_header(header: List[str]) -> dict:
"""Return phase names and symmetries detected in a .ctf file header.
Parameters
Expand Down Expand Up @@ -261,7 +262,7 @@ def _get_phases_from_header(header: list[str]) -> dict:
return phases


def _fix_astar_coords(header: list[str], data_dict: dict) -> dict:
def _fix_astar_coords(header: List[str], data_dict: dict) -> dict:
"""Return the data dictionary with coordinate arrays possibly fixed
for ASTAR Index files.
Expand Down Expand Up @@ -301,7 +302,7 @@ def _fix_astar_coords(header: list[str], data_dict: dict) -> dict:
return data_dict


def _get_xy_step(header: list[str]) -> dict[str, float]:
def _get_xy_step(header: List[str]) -> Dict[str, float]:
pattern_step = re.compile(r"(?<=[XY]Step[\t\s])(.*)")
steps = {"x": None, "y": None}
for line in header:
Expand All @@ -315,7 +316,7 @@ def _get_xy_step(header: list[str]) -> dict[str, float]:
return steps


def _get_xy_cells(header: list[str]) -> dict[str, int]:
def _get_xy_cells(header: List[str]) -> Dict[str, int]:
pattern_cells = re.compile(r"(?<=[XY]Cells[\t\s])(.*)")
cells = {"x": None, "y": None}
for line in header:
Expand Down

0 comments on commit a68d37e

Please sign in to comment.