2424 MissingAtomicDataError ,
2525)
2626
27- import numbers
27+ from numbers import (
28+ Integral ,
29+ Real ,
30+ )
2831
2932__all__ = [
3033 "atomic_number" ,
4851
4952
5053@particle_input
51- def atomic_number (element : Particle ) -> numbers . Integral :
54+ def atomic_number (element : Particle ) -> Integral :
5255 """
5356 Return the number of protons in an atom, isotope, or ion.
5457
@@ -95,7 +98,7 @@ def atomic_number(element: Particle) -> numbers.Integral:
9598
9699
97100@particle_input
98- def mass_number (isotope : Particle ) -> numbers . Integral :
101+ def mass_number (isotope : Particle ) -> Integral :
99102 """Get the mass number (the number of protons and neutrons) of an
100103 isotope.
101104
@@ -207,8 +210,8 @@ def standard_atomic_weight(element: Particle) -> u.Quantity:
207210def particle_mass (
208211 particle : Particle ,
209212 * ,
210- Z : numbers . Integral = None ,
211- mass_numb : numbers . Integral = None ) -> u .Quantity :
213+ Z : Integral = None ,
214+ mass_numb : Integral = None ) -> u .Quantity :
212215 """
213216 Return the mass of a particle.
214217
@@ -261,7 +264,7 @@ def particle_mass(
261264
262265
263266@particle_input
264- def isotopic_abundance (isotope : Particle , mass_numb : Optional [numbers . Integral ] = None ) -> numbers . Real :
267+ def isotopic_abundance (isotope : Particle , mass_numb : Optional [Integral ] = None ) -> Real :
265268 """
266269 Return the isotopic abundances if known, and otherwise zero.
267270
@@ -313,7 +316,7 @@ def isotopic_abundance(isotope: Particle, mass_numb: Optional[numbers.Integral]
313316
314317
315318@particle_input (any_of = {'charged' , 'uncharged' })
316- def integer_charge (particle : Particle ) -> numbers . Integral :
319+ def integer_charge (particle : Particle ) -> Integral :
317320 """Return the integer charge of a particle.
318321
319322 Parameters
@@ -423,7 +426,7 @@ def electric_charge(particle: Particle) -> u.Quantity:
423426
424427
425428@particle_input
426- def is_stable (particle : Particle , mass_numb : Optional [numbers . Integral ] = None ) -> bool :
429+ def is_stable (particle : Particle , mass_numb : Optional [Integral ] = None ) -> bool :
427430 """
428431 Return `True` for stable isotopes and particles and `False` for
429432 unstable isotopes.
@@ -477,7 +480,7 @@ def is_stable(particle: Particle, mass_numb: Optional[numbers.Integral] = None)
477480
478481
479482@particle_input (any_of = {'stable' , 'unstable' , 'isotope' })
480- def half_life (particle : Particle , mass_numb : Optional [numbers . Integral ] = None ) -> u .Quantity :
483+ def half_life (particle : Particle , mass_numb : Optional [Integral ] = None ) -> u .Quantity :
481484 """
482485 Return the half-life in seconds for unstable isotopes and particles,
483486 and numpy.inf in seconds for stable isotopes and particles.
@@ -532,7 +535,7 @@ def half_life(particle: Particle, mass_numb: Optional[numbers.Integral] = None)
532535 return particle .half_life
533536
534537
535- def known_isotopes (argument : Union [str , numbers . Integral ] = None ) -> List [str ]:
538+ def known_isotopes (argument : Union [str , Integral ] = None ) -> List [str ]:
536539 """Return a list of all known isotopes of an element, or a list
537540 of all known isotopes of every element if no input is provided.
538541
@@ -622,7 +625,7 @@ def known_isotopes_for_element(argument):
622625
623626
624627def common_isotopes (
625- argument : Union [str , numbers . Integral ] = None ,
628+ argument : Union [str , Integral ] = None ,
626629 most_common_only : bool = False ) -> List [str ]:
627630 """
628631 Return a list of isotopes of an element with an isotopic abundances
@@ -741,7 +744,7 @@ def common_isotopes_for_element(
741744 return isotopes_list
742745
743746
744- def stable_isotopes (argument : Union [str , numbers . Integral ] = None ,
747+ def stable_isotopes (argument : Union [str , Integral ] = None ,
745748 unstable : bool = False ) -> List [str ]:
746749 """
747750 Return a list of all stable isotopes of an element, or if no input is
@@ -915,7 +918,7 @@ def get_particle_mass(particle) -> u.Quantity:
915918 return (test_mass * target_mass ) / (test_mass + target_mass )
916919
917920
918- def periodic_table_period (argument : Union [str , numbers . Integral ]) -> numbers . Integral :
921+ def periodic_table_period (argument : Union [str , Integral ]) -> Integral :
919922 """
920923 Return the periodic table period.
921924
@@ -956,7 +959,7 @@ def periodic_table_period(argument: Union[str, numbers.Integral]) -> numbers.Int
956959
957960 """
958961 # TODO: Implement @particle_input
959- if not isinstance (argument , (str , numbers . Integral )):
962+ if not isinstance (argument , (str , Integral )):
960963 raise TypeError (
961964 "The argument to periodic_table_period must be either a "
962965 "string representing the element or its symbol, or an "
@@ -966,7 +969,7 @@ def periodic_table_period(argument: Union[str, numbers.Integral]) -> numbers.Int
966969 return period
967970
968971
969- def periodic_table_group (argument : Union [str , numbers . Integral ]) -> numbers . Integral :
972+ def periodic_table_group (argument : Union [str , Integral ]) -> Integral :
970973 """
971974 Return the periodic table group.
972975
@@ -1013,7 +1016,7 @@ def periodic_table_group(argument: Union[str, numbers.Integral]) -> numbers.Inte
10131016
10141017 """
10151018 # TODO: Implement @particle_input
1016- if not isinstance (argument , (str , numbers . Integral )):
1019+ if not isinstance (argument , (str , Integral )):
10171020 raise TypeError (
10181021 "The argument to periodic_table_group must be "
10191022 "either a string representing the element or its "
@@ -1023,7 +1026,7 @@ def periodic_table_group(argument: Union[str, numbers.Integral]) -> numbers.Inte
10231026 return group
10241027
10251028
1026- def periodic_table_block (argument : Union [str , numbers . Integral ]) -> str :
1029+ def periodic_table_block (argument : Union [str , Integral ]) -> str :
10271030 """
10281031 Return the periodic table block.
10291032
@@ -1070,7 +1073,7 @@ def periodic_table_block(argument: Union[str, numbers.Integral]) -> str:
10701073
10711074 """
10721075 # TODO: Implement @particle_input
1073- if not isinstance (argument , (str , numbers . Integral )):
1076+ if not isinstance (argument , (str , Integral )):
10741077 raise TypeError (
10751078 "The argument to periodic_table_block must be "
10761079 "either a string representing the element or its "
@@ -1080,7 +1083,7 @@ def periodic_table_block(argument: Union[str, numbers.Integral]) -> str:
10801083 return block
10811084
10821085
1083- def periodic_table_category (argument : Union [str , numbers . Integral ]) -> str :
1086+ def periodic_table_category (argument : Union [str , Integral ]) -> str :
10841087 """
10851088 Return the periodic table category.
10861089
@@ -1125,7 +1128,7 @@ def periodic_table_category(argument: Union[str, numbers.Integral]) -> str:
11251128
11261129 """
11271130 # TODO: Implement @particle_input
1128- if not isinstance (argument , (str , numbers . Integral )):
1131+ if not isinstance (argument , (str , Integral )):
11291132 raise TypeError (
11301133 "The argument to periodic_table_category must be "
11311134 "either a string representing the element or its "
0 commit comments