Implements Refactoring in Player Class and Initial Working Version
This commit is contained in:
32
diceplayer/shared/config/gaussian_config.py
Normal file
32
diceplayer/shared/config/gaussian_config.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from diceplayer.shared.utils.dataclass_protocol import Dataclass
|
||||
|
||||
from dataclasses import dataclass
|
||||
from dacite import from_dict
|
||||
|
||||
|
||||
@dataclass
|
||||
class GaussianDTO(Dataclass):
|
||||
"""
|
||||
Data Transfer Object for the Gaussian configuration.
|
||||
"""
|
||||
level: str
|
||||
qmprog: str
|
||||
|
||||
chgmult = [0, 1]
|
||||
pop: str = 'chelpg'
|
||||
chg_tol: float = 0.01
|
||||
keywords: str = None
|
||||
|
||||
def __post_init__(self):
|
||||
if self.qmprog not in ("g03", "g09", "g16"):
|
||||
raise ValueError(
|
||||
"Error: invalid qmprog value."
|
||||
)
|
||||
if self.level is None:
|
||||
raise ValueError(
|
||||
"Error: 'level' keyword not specified in config file."
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, param: dict):
|
||||
return from_dict(GaussianDTO, param)
|
||||
Reference in New Issue
Block a user