Skip to content

Commit

Permalink
debug dataclass
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Dec 13, 2023
1 parent 89333e3 commit aecbe21
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions atomistics/calculators/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@


@dataclasses.dataclass
class AtomisticsOutput:
class Output:
@classmethod
def fields(cls):
return tuple(field.name for field in dataclasses.fields(cls))

@classmethod
def get(cls, engine, *quantities: str) -> dict:
return {q: getattr(cls, q)(engine) for q in quantities}
def get(self, engine, *quantities: str) -> dict:
return {q: getattr(self, q)(engine) for q in quantities}


@dataclasses.dataclass
class OutputStatic(AtomisticsOutput):
class OutputStatic(Output):
forces: callable
energy: callable
stress: callable


@dataclasses.dataclass
class OutputMolecularDynamics(AtomisticsOutput):
class OutputMolecularDynamics(Output):
positions: callable
cell: callable
forces: callable
Expand Down

0 comments on commit aecbe21

Please sign in to comment.