Read Potentials and Initial Testing
This commit is contained in:
24
diceplayer/shared/config/player_dto.py
Normal file
24
diceplayer/shared/config/player_dto.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from diceplayer.shared.utils.dataclass_protocol import Dataclass
|
||||
|
||||
from dataclasses import dataclass
|
||||
from dacite import from_dict
|
||||
|
||||
|
||||
@dataclass
|
||||
class PlayerDTO(Dataclass):
|
||||
opt: bool
|
||||
maxcyc: int
|
||||
nprocs: int
|
||||
|
||||
qmprog: str = 'g16'
|
||||
altsteps: int = 20000
|
||||
simulation_dir = 'simfiles'
|
||||
|
||||
def __post_init__(self):
|
||||
MIN_STEP = 20000
|
||||
# altsteps value is always the nearest multiple of 1000
|
||||
self.altsteps = round(max(MIN_STEP, self.altsteps) / 1000) * 1000
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, param: dict):
|
||||
return from_dict(PlayerDTO, param)
|
||||
Reference in New Issue
Block a user