@@ -22,13 +22,13 @@ def __init__(self, filename: pathlib.Path, year: int):
22
22
super ().__init__ (self .year )
23
23
logging .info (f"Reading { self .filename } from { self .year } " )
24
24
25
- def _read_halflife_value (self , line : str ) -> typing .Union [float , None ]:
25
+ def _read_halflife_value (self , line : str ) -> typing .Optional [float ]:
26
26
"""Slice the string to get the numerical value or None if it's empty."""
27
27
data = line [self .START_HALFLIFEVALUE : self .END_HALFLIFEVALUE ].strip ()
28
28
number = re .sub (r"[<>?~]" , "" , data )
29
29
return float (number ) if number else None
30
30
31
- def _read_halflife_error (self , line : str ) -> typing .Union [float , None ]:
31
+ def _read_halflife_error (self , line : str ) -> typing .Optional [float ]:
32
32
"""Slice the string to get the numerical value or None if it's empty."""
33
33
data = line [self .START_HALFLIFEERROR : self .END_HALFLIFEERROR ].strip ()
34
34
number = re .sub (r"[<>?~a-z]" , "" , data )
@@ -48,7 +48,7 @@ def _read_all_halflife_data(self, line: str) -> tuple:
48
48
self ._read_halflife_error (line )
49
49
)
50
50
51
- def _read_spin (self , line : str ) -> typing .Union [str , None ]:
51
+ def _read_spin (self , line : str ) -> typing .Optional [str ]:
52
52
"""Extract the spin of the isotope and it's level."""
53
53
# 2020 brought in '*' for directly measured. Just remove it for the moment
54
54
# TODO parse the spin parity with the new characters
0 commit comments