molparse.reconcile_nucleus

molparse.reconcile_nucleus

Forms consistent set of nucleus descriptors from all information from arguments, supplemented by the periodic table. At the least, must provide element identity somehow. Defaults to most-abundant isotope.

Parameters
  • A (int, optional) – Mass number, number of protons and neutrons.

  • Z (int, optional) – Atomic number, number of protons.

  • E (str, optional) – Element symbol from periodic table.

  • mass (float, optional) – Atomic mass [u].

  • real (bool, optional) – Whether real or ghost/absent.

  • label (str, optional) – Atom label according to qcelemental.molparse.regex.NUCLEUS.

  • speclabel (bool, optional) – If True, interpret label as potentially full nucleus spec including ghosting, isotope, mass, tagging information, e.g., @13C_mine or He4@4.01. If False, interpret label as only the user/tagging extension to nucleus label, e.g. _mine or 4 in the previous examples.

  • nonphysical (bool, optional) – When True, turns off sanity checking that prevents periodic table violations (e.g, light uranium: 1U@1.007).

  • mtol (float, optional) – How different mass can be from a known nuclide mass and still merit the mass number assignment. Note that for elements dominated by a single isotope, the default may not be tight enough to prevent standard atomic weight (abundance-average of isotopes) from being labeled as the dominant isotope for A.

  • verbose (int, optional) – Quantity of printing.

Returns

A, Z, E, mass, real, userlabel – mass number, unless clues don’t point to a known nuclide, in which case -1. atomic number. element symbol, capitalized. mass value [u]. real/ghost. user portion of label if present, else ‘’.

Return type

int, int, str, float, bool, str

Raises

Examples

>>> reconcile_nucleus(E='co')
>>> reconcile_nucleus(Z=27)
>>> reconcile_nucleus(A=59, Z=27)
>>> reconcile_nucleus(E='cO', mass=58.933195048)
>>> reconcile_nucleus(A=59, Z=27, E='CO')
>>> reconcile_nucleus(A=59, E='cO', mass=58.933195048)
>>> reconcile_nucleus(label='co')
>>> reconcile_nucleus(label='59co')
>>> reconcile_nucleus(label='[email protected]')
>>> reconcile_nucleus(A=59, Z=27, E='cO', mass=58.933195048, label='[email protected]')
>>> reconcile_nucleus(A=59, Z=27, E='cO', mass=58.933195048, label='[email protected]')
>>> reconcile_nucleus(label='27')
59, 27, 'Co', 58.933195048, True, ''
>>> reconcile_nucleus(label='co_miNe')
>>> reconcile_nucleus(label='[email protected]')
59, 27, 'Co', 58.933195048, True, '_mine'
>>> reconcile_nucleus(E='cO', mass=58.933)
>>> reconcile_nucleus(label='[email protected]')
59, 27, 'Co', 58.933, True, ''
>>> assert 59, 27, 'Co', 58.933, True, '' == reconcile_nucleus(E='cO', mass=58.933, mtol=1.e-4))
AssertionError
>>> reconcile_nucleus(E='Co', A=60)
>>> reconcile_nucleus(Z=27, A=60, real=True)
>>> reconcile_nucleus(E='Co', A=60)
>>> reconcile_nucleus(Z=27, mass=59.933817059)
>>> reconcile_nucleus(A=60, Z=27, mass=59.933817059)
>>> reconcile_nucleus(label='60Co')
>>> reconcile_nucleus(label='27', mass=59.933817059)
>>> reconcile_nucleus(label='Co', mass=59.933817059)
>>> reconcile_nucleus(A=60, label='Co')
60, 27, 'Co', 59.933817059, True, ''
>>> reconcile_nucleus(E='Co', A=60, real=False))
>>> reconcile_nucleus(A=60, Z=27, mass=59.933817059, real=0))
>>> reconcile_nucleus(label='@60Co'))
>>> reconcile_nucleus(label='Gh(27)', mass=59.933817059))
>>> reconcile_nucleus(label='@Co', mass=59.933817059))
>>> reconcile_nucleus(A=60, label='Gh(Co)'))
60, 27, 'Co', 59.933817059, False, ''
>>> reconcile_nucleus(Z=27, mass=200, nonphysical=True)
60, 27, 'Co', 200.00000000, True, ''
>>> reconcile_nucleus(mass=60.6, Z=27)
>>> reconcile_nucleus(mass=60.6, E='Co')
>>> reconcile_nucleus(mass=60.6, label='27')
>>> reconcile_nucleus(label='[email protected]')
-1, 27, 'Co', 60.6, True, ''
>>> reconcile_nucleus(mass=60.6, Z=27, A=61))
>>> reconcile_nucleus(A=80, Z=27)
>>> reconcile_nucleus(Z=27, mass=200)
>>> reconcile_nucleus(Z=27, mass=-200, nonphysical=True)
>>> reconcile_nucleus(Z=-27, mass=200, nonphysical=True)
>>> reconcile_nucleus(Z=1, label='he')
>>> reconcile_nucleus(A=4, label='3he')
>>> reconcile_nucleus(label='@U', real=True)
>>> reconcile_nucleus(label='U', real=False)
ValidationError