Skip to content

Commit

Permalink
Enable potcar single validation in task doc (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed Oct 3, 2022
1 parent e0bf827 commit e5fd206
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions emmet-core/emmet/core/tasks.py
@@ -1,6 +1,6 @@
from datetime import datetime
from enum import Enum
from typing import List, Dict, Union
from typing import List, Dict, Union, Any

from emmet.core.vasp.task_valid import TaskState

Expand Down Expand Up @@ -56,10 +56,18 @@ class OrigInputs(BaseModel):
None, description="Pymatgen object representing the KPOINTS file.",
)

potcar: Union[Potcar, List[VaspPotcarSingle], VaspPotcar] = Field(
potcar: Union[Potcar, VaspPotcar, List[Any]] = Field(
None, description="Pymatgen object representing the POTCAR file.",
)

# Make sure that the datetime field is properly formatted
@validator("potcar", pre=True)
def potcar_ok(cls, v):
if isinstance(v, list):
return [i for i in v]

return v

class Config:
arbitrary_types_allowed = True

Expand Down

0 comments on commit e5fd206

Please sign in to comment.