From 0d5c46ac7049cabc43c798ee35e5c31b2f8cc882 Mon Sep 17 00:00:00 2001 From: orionarcher Date: Thu, 22 Aug 2024 09:42:32 -0400 Subject: [PATCH 1/2] Add dict to ionic_steps typing --- src/atomate2/ase/schemas.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/atomate2/ase/schemas.py b/src/atomate2/ase/schemas.py index a03f3c40f2..23a67c7cef 100644 --- a/src/atomate2/ase/schemas.py +++ b/src/atomate2/ase/schemas.py @@ -69,7 +69,7 @@ class AseResult(BaseModel): ) elapsed_time: Optional[float] = Field( - None, description="The time taken to run the calculation." + None, description="The time taken to run the ASE calculator." ) def __getitem__(self, name: str) -> Any: @@ -144,11 +144,11 @@ class OutputDoc(AseBaseModel): None, description="The stress on the cell in units of kbar (in Voigt notation)." ) - ionic_steps: list[IonicStep] = Field( + ionic_steps: list[IonicStep] | dict = Field( None, description="Step-by-step trajectory of the relaxation." ) - elapsed_time: Optional[float] = Field("The time taken to run the calculation.") + elapsed_time: Optional[float] = Field("The time taken to run the ASE calculator.") n_steps: int = Field( None, description="total number of steps needed in the relaxation." From 9585dc9a45fc6d34fa3390039fabadde7ea3d0f6 Mon Sep 17 00:00:00 2001 From: orionarcher Date: Thu, 22 Aug 2024 13:15:24 -0400 Subject: [PATCH 2/2] Change | to Union in type hints --- src/atomate2/ase/schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atomate2/ase/schemas.py b/src/atomate2/ase/schemas.py index 23a67c7cef..db4e82957c 100644 --- a/src/atomate2/ase/schemas.py +++ b/src/atomate2/ase/schemas.py @@ -144,7 +144,7 @@ class OutputDoc(AseBaseModel): None, description="The stress on the cell in units of kbar (in Voigt notation)." ) - ionic_steps: list[IonicStep] | dict = Field( + ionic_steps: Union[list[IonicStep], dict] = Field( None, description="Step-by-step trajectory of the relaxation." )