@@ -861,9 +861,10 @@ class Parameter(BaseModel):
861861 prior_distribution : PriorDistribution | None = Field (
862862 alias = C .PRIOR_DISTRIBUTION , default = None
863863 )
864-
865- # TODO priors
866- # pydantic vs. petab.v1.priors.Prior
864+ #: Prior distribution parameters.
865+ prior_parameters : list [float ] = Field (
866+ alias = C .PRIOR_PARAMETERS , default_factory = list
867+ )
867868
868869 #: :meta private:
869870 model_config = ConfigDict (
@@ -882,13 +883,22 @@ def _validate_id(cls, v):
882883 raise ValueError (f"Invalid ID: { v } " )
883884 return v
884885
886+ @field_validator ("prior_parameters" , mode = "before" )
887+ @classmethod
888+ def _validate_prior_parameters (cls , v ):
889+ if isinstance (v , str ):
890+ v = v .split (C .PARAMETER_SEPARATOR )
891+ elif not isinstance (v , Sequence ):
892+ v = [v ]
893+
894+ return [float (x ) for x in v ]
895+
885896 @field_validator ("estimate" , mode = "before" )
886897 @classmethod
887898 def _validate_estimate_before (cls , v ):
888899 if isinstance (v , bool ):
889900 return v
890901
891- # TODO: clarify whether extra whitespace is allowed
892902 if isinstance (v , str ):
893903 v = v .strip ().lower ()
894904 if v == "true" :
@@ -932,8 +942,6 @@ def _validate(self) -> Self:
932942 ):
933943 raise ValueError ("Lower bound must be less than upper bound." )
934944
935- # TODO parameterScale?
936-
937945 # TODO priorType, priorParameters
938946
939947 return self
0 commit comments