From 220b1dacb55a0f189e0480435bf9162c2cd2a42d Mon Sep 17 00:00:00 2001 From: Anselm Hahn Date: Wed, 23 Oct 2024 21:27:08 +0200 Subject: [PATCH] Fix TypeAlias declaration for Float64Array in matrices.py (#125) * fix: Correct TypeAlias declaration for Float64Array in matrices.py * fix: Update TypeAlias import for compatibility and correct typo in T_3_1_states docstring --- tanabesugano/matrices.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tanabesugano/matrices.py b/tanabesugano/matrices.py index 406801c..d37cf92 100644 --- a/tanabesugano/matrices.py +++ b/tanabesugano/matrices.py @@ -1,7 +1,12 @@ from __future__ import annotations from typing import Dict -# from typing import TypeAlias + + +try: + from typing import TypeAlias +except ImportError: + from typing import Any as TypeAlias import numpy as np @@ -19,8 +24,7 @@ _3sqrt3 = _sqrt3 * 3.0 _3sqrt6 = _sqrt6 * 3.0 -# Float64Array: TypeAlias = NDArray[np.float64] -Float64Array = NDArray[np.float64] +Float64Array: TypeAlias = NDArray[np.float64] class LigandFieldTheory: @@ -332,7 +336,7 @@ def __init__(self, Dq: float = 0.0, B: float = 965.0, C: float = 4449.0) -> None super().__init__(Dq, B, C) def T_3_1_states(self) -> Float64Array: - """Calculate the T_3_1 states.""" + """Calculatee the T_3_1 states.""" # Diagonal elements AA = -16 * self.Dq - 15 * self.B + 5 * self.C BB = -6 * self.Dq - 11 * self.B + 4 * self.C