refactor: unify and modernize periodic table utilities and typing

- 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
This commit is contained in:
2026-02-27 17:56:11 -03:00
parent b6e57bc1c5
commit d400970e8f
8 changed files with 242 additions and 356 deletions

View File

@@ -2,7 +2,7 @@ from diceplayer import VERSION, logger
from diceplayer.config.player_config import PlayerConfig
from diceplayer.environment import Atom, Molecule, System
from diceplayer.interface import DiceInterface, GaussianInterface
from diceplayer.utils import atomsymb, weekday_date_time
from diceplayer.utils import PTable, weekday_date_time
import yaml
from pydantic import BaseModel
@@ -289,7 +289,7 @@ class Player:
file.write(f"Cycle # {cycle}\n")
for atom in self.system.molecule[0].atom:
symbol = atomsymb[atom.na]
symbol = PTable.get_atomic_symbol(atom.na)
file.write(
f"{symbol:<2s} {atom.rx:>10.6f} {atom.ry:>10.6f} {atom.rz:>10.6f}\n"
)