feat: improved implementation and validations of configs

This commit is contained in:
2026-02-26 08:35:59 -03:00
parent e5c6282c86
commit c51d07cff2
11 changed files with 84 additions and 57 deletions

View File

@@ -1,10 +1,9 @@
from typing import Literal
from diceplayer.shared.utils.dataclass_protocol import Dataclass
from pydantic import BaseModel, Field
from diceplayer.shared.utils.dataclass_protocol import Dataclass
from dataclasses import dataclass, fields
from typing import Literal
class GaussianConfig(BaseModel):
@@ -13,9 +12,18 @@ class GaussianConfig(BaseModel):
"""
level: str = Field(..., description="Level of theory for the QM calculations")
qmprog: Literal["g03", "g09", "g16"] = Field("g16", description="QM program to use for the calculations")
qmprog: Literal["g03", "g09", "g16"] = Field(
"g16", description="QM program to use for the calculations"
)
chgmult: list[int] = Field(default_factory=lambda: [0, 1], description="List of charge and multiplicity for the QM calculations")
pop: str = Field("chelpg", description="Population analysis method for the QM calculations")
chgmult: list[int] = Field(
default_factory=lambda: [0, 1],
description="List of charge and multiplicity for the QM calculations",
)
pop: str = Field(
"chelpg", description="Population analysis method for the QM calculations"
)
chg_tol: float = Field(0.01, description="Charge tolerance for the QM calculations")
keywords: str = Field(None, description="Additional keywords for the QM calculations")
keywords: str = Field(
None, description="Additional keywords for the QM calculations"
)