Skip to content

Commit

Permalink
Declare EDMList as bool, converted to False from None
Browse files Browse the repository at this point in the history
  • Loading branch information
eudoxos committed Nov 21, 2024
1 parent 3485a05 commit a7a08db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mupifDB/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
Str_EmptyFromNone=Annotated[str,BeforeValidator(lambda x: '' if x is None else x)]
# opposite: saved as empty string, but should be loaded as None if empty
None_FromEmptyStr=Annotated[None,BeforeValidator(lambda x: None if x=='' else x)]
# bool which can be loaded from None (and becomes False)
Bool_FalseFromNone=Annotated[bool,BeforeValidator(lambda x: False if x is None else x)]


ExecutionStatus_Literal=Literal['Created','Pending','Scheduled','Running','Finished','Failed']
Expand Down Expand Up @@ -172,7 +174,7 @@ class Input_Model(InputOutputBase_Model):
Compulsory: bool = Field(...,validation_alias='Required')
Set_at: Literal['timestep','initialization']='timestep'
class Output_Model(InputOutputBase_Model):
EDMList: bool=False # XXX: document
EDMList: Bool_FalseFromNone=False # XXX: document
Inputs: List[Input_Model]
Outputs: List[Output_Model]
wid: str
Expand Down

0 comments on commit a7a08db

Please sign in to comment.