- Replace atomsymb and atommass tuples with AtomInfo dataclass and PTable enum for atomic data - Refactor all usages to access atomic symbol and mass via PTable methods - Remove nptyping dependency, switch to numpy.typing for type annotations - Update molecule and atom classes to use new typing and atomic data access - Bump numpy version to 2.x and remove nptyping from dependencies
24 lines
424 B
Python
24 lines
424 B
Python
from diceplayer.utils.ptable import PTable
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class Atom:
|
|
"""
|
|
Atom class declaration. This class is used throughout the DicePlayer program to represent atoms.
|
|
"""
|
|
|
|
lbl: int
|
|
na: int
|
|
rx: float
|
|
ry: float
|
|
rz: float
|
|
chg: float
|
|
eps: float
|
|
sig: float
|
|
|
|
@property
|
|
def mass(self) -> float:
|
|
return PTable.get_atomic_mass(self.na)
|