Skip to content

Introduce a pydantic basemodel to manage input and output parameters, results #261

Description

@mikibonacci
class YamboParameters(BaseModel):
    BndsRnXp: t.Optional[t.List[int]] = Field(None, 
        description="Band range for the dynamical screening calculation")
    BndsRnXs: t.Optional[t.List[int]] = Field(None, 
        description="Band range for the static screening calculation")
    
class YamboInputs(BaseModel):
    runlevels: list
    parameters: YamboParameters

so that we can dump the model (defining rules to dump it following yambopy requirements) but also construct it from the parameters Dict, and manage easily all the parameters and so on.

This will improve the code for complex logic in convergences, mainly. But also help the users in define more easily the parameters, and see what he can possibly define.
Moreover, we can use the pydantic data validation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions