Skip to content

Commit 4b55a40

Browse files
committed
add molecular dynamics attributes to Key enum
- breaking: in ML section, rename momentum to optimizer_momentum; in dft section, rename kpoints to k_points - with metadata in keys.yml - adjust keys-schema.yml to support more complex symbols and units - throw in few new attributes for phonon frequencies, mode weights, q-points - add units for all existing properties that have them (some keys are just concepts, not measurable quantities)
1 parent dbd3815 commit 4b55a40

File tree

5 files changed

+419
-20
lines changed

5 files changed

+419
-20
lines changed

pymatviz/enums.py

+58-2
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ def __reduce_ex__(self, proto: object) -> tuple[type, tuple[str]]:
279279
# Crystal Symmetry Properties
280280
crystal_system = "crystal_system"
281281
spg_num = "spg_num"
282+
init_spg_num = "init_spg_num"
283+
final_spg_num = "final_spg_num"
282284
spg_symbol = "spg_symbol"
283285
choice_symbol = "choice_symbol"
284286
hall_num = "hall_num"
@@ -417,6 +419,7 @@ def __reduce_ex__(self, proto: object) -> tuple[type, tuple[str]]:
417419
# Mechanical
418420
forces = "forces"
419421
stress = "stress"
422+
max_stress = "max_stress"
420423
virial = "virial"
421424
stress_trace = "stress_trace"
422425
voigt_stress = "voigt_stress"
@@ -459,6 +462,9 @@ def __reduce_ex__(self, proto: object) -> tuple[type, tuple[str]]:
459462
# Phonon
460463
ph_band_structure = "ph_band_structure"
461464
ph_dos = "ph_dos"
465+
ph_freqs = "ph_freqs"
466+
mode_weights = "mode_weights"
467+
q_points = "q_points"
462468
ph_dos_mae = "ph_dos_mae"
463469
ph_dos_rmse = "ph_dos_rmse"
464470
has_imag_ph_gamma_modes = "has_imag_ph_gamma_modes"
@@ -530,7 +536,7 @@ def __reduce_ex__(self, proto: object) -> tuple[type, tuple[str]]:
530536
xc_functional = "xc_functional"
531537
convergence_electronic = "convergence_electronic"
532538
convergence_ionic = "convergence_ionic"
533-
kpoints = "kpoints"
539+
k_points = "k_points"
534540
pseudo_potential = "pseudo_potential"
535541
pseudo_potential_type = "pseudo_potential_type"
536542
u_correction = "u_correction"
@@ -563,6 +569,56 @@ def __reduce_ex__(self, proto: object) -> tuple[type, tuple[str]]:
563569
collinear = "collinear"
564570
non_collinear = "non_collinear"
565571

572+
# Molecular Dynamics
573+
trajectory = "trajectory"
574+
frames = "frames"
575+
frame = "frame"
576+
diffusivity = "diffusivity"
577+
diffusion_tensor = "diffusion_tensor"
578+
msd = "msd" # mean squared displacement
579+
velocity_autocorr = "velocity_autocorr" # velocity autocorrelation function
580+
ensemble = "ensemble"
581+
nvt = "nvt" # canonical ensemble
582+
nve = "nve" # microcanonical ensemble
583+
npt = "npt" # isothermal-isobaric ensemble
584+
nvp = "nvp" # isoenthalpic-isobaric ensemble
585+
micro_canonical = "micro_canonical"
586+
canonical = "canonical"
587+
grand_canonical = "grand_canonical"
588+
isothermal_isobaric = "isothermal_isobaric"
589+
time_step = "time_step"
590+
time_steps = "time_steps"
591+
integration_time = "integration_time"
592+
equilibration_time = "equilibration_time"
593+
production_time = "production_time"
594+
thermostat = "thermostat"
595+
barostat = "barostat"
596+
langevin_damping = "langevin_damping"
597+
nose_hoover = "nose_hoover"
598+
berendsen = "berendsen"
599+
andersen = "andersen"
600+
velocity_verlet = "velocity_verlet"
601+
verlet = "verlet"
602+
leap_frog = "leap_frog"
603+
kinetic_energy = "kinetic_energy"
604+
potential_energy = "potential_energy"
605+
total_energy = "total_energy"
606+
conserved_energy = "conserved_energy"
607+
temperature_avg = "temperature_avg"
608+
pressure_avg = "pressure_avg"
609+
volume_avg = "volume_avg"
610+
density_avg = "density_avg"
611+
rdf = "rdf" # radial distribution function
612+
velocity = "velocity"
613+
acceleration = "acceleration"
614+
momentum = "momentum"
615+
angular_momentum = "angular_momentum"
616+
gyration_radius = "gyration_radius"
617+
drift = "drift"
618+
flux = "flux"
619+
correlation_time = "correlation_time"
620+
correlation_length = "correlation_length"
621+
566622
# ML
567623
train_task = "train_task"
568624
test_task = "test_task"
@@ -582,7 +638,7 @@ def __reduce_ex__(self, proto: object) -> tuple[type, tuple[str]]:
582638
epochs = "epochs"
583639
batch_size = "batch_size"
584640
learning_rate = "learning_rate"
585-
momentum = "momentum"
641+
optimizer_momentum = "optimizer_momentum"
586642
weight_decay = "weight_decay"
587643
early_stopping = "early_stopping"
588644
n_folds = "n_folds"

pymatviz/io.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class TqdmDownload(tqdm):
3737
"""Progress bar for urllib.request.urlretrieve file download.
3838
3939
Adapted from official TqdmUpTo example.
40-
See https://github.com/tqdm/tqdm/blob/4c956c20b83be4312460fc0c4812eeb3fef5e7df/README.rst#hooks-and-callbacks
40+
See https://github.com/tqdm/tqdm/blob/4c956c2/README.rst#hooks-and-callbacks
4141
"""
4242

4343
def __init__(self, *args: Any, **kwargs: Any) -> None:

0 commit comments

Comments
 (0)