refactor: update Python version and optimize dice configuration parameters

This commit is contained in:
2026-03-24 23:01:45 -03:00
parent 0763c4a9e1
commit 0470200d00
12 changed files with 228 additions and 233 deletions

View File

@@ -6,7 +6,7 @@ import pytest
class TestDiceConfig:
def test_class_instantiation(self):
dice_dto = DiceConfig(
nprocs=1,
nprocs=1,
ljname="test",
outname="test",
dens=1.0,

View File

@@ -4,6 +4,7 @@ from diceplayer.dice.dice_input import (
NPTTerConfig,
NVTEqConfig,
NVTTerConfig,
write_config,
)
import pytest
@@ -60,11 +61,7 @@ class TestDiceInput:
def test_write_dice_config(self, player_config: PlayerConfig, tmp_path: Path):
dice_input = NVTTerConfig.from_config(player_config)
output_file = tmp_path / "nvt_ter.inp"
output_file = tmp_path / dice_input.type
write_config(dice_input, tmp_path)
with open(output_file, "w") as file:
dice_input.write_dice_config(file)
assert output_file.exists()
print(output_file.read_text())
assert output_file.exists()

View File

@@ -1,36 +1,35 @@
from pathlib import Path
from typing import Any
import pytest
from diceplayer.config import PlayerConfig
from diceplayer.environment import System
from diceplayer.utils.potential import read_system_from_phb
import pytest
class TestPotential:
@pytest.fixture
def player_config(self) -> PlayerConfig:
return PlayerConfig.model_validate({
"type": "both",
"mem": 12,
"max_cyc": 100,
"switch_cyc": 50,
"ncores": 4,
"dice": {
"nprocs": 4,
"ljname": "phb.ljc.example",
"outname": "test",
"dens": 1.0,
"nmol": [12, 16],
"nstep": [1, 1],
},
"gaussian": {
"level": "test",
"qmprog": "g16",
"keywords": "test",
},
})
return PlayerConfig.model_validate(
{
"type": "both",
"mem": 12,
"max_cyc": 100,
"switch_cyc": 50,
"ncores": 4,
"dice": {
"nprocs": 4,
"ljname": "phb.ljc.example",
"outname": "test",
"dens": 1.0,
"nmol": [12, 16],
"nstep": [1, 1],
},
"gaussian": {
"level": "test",
"qmprog": "g16",
"keywords": "test",
},
}
)
def test_read_phb(self, player_config: PlayerConfig):
system = read_system_from_phb(player_config)