@@ -992,16 +992,13 @@ def _validate(self) -> Self:
992992 "Estimated parameter must have lower and upper bounds set"
993993 )
994994
995- # TODO: also if not estimated?
996- if (
997- self .estimate
998- and self .lb is not None
999- and self .ub is not None
1000- and self .lb >= self .ub
1001- ):
1002- raise ValueError ("Lower bound must be less than upper bound." )
995+ if self .lb is not None and self .ub is not None and self .lb > self .ub :
996+ raise ValueError (
997+ "Lower bound must be less than or equal to upper bound."
998+ )
1003999
1004- # TODO priorType, priorParameters
1000+ # NOTE: priorType and priorParameters are currently checked in
1001+ # `CheckPriorDistribution`
10051002
10061003 return self
10071004
@@ -1294,50 +1291,6 @@ def from_yaml(
12941291 mapping_tables = mapping_tables ,
12951292 )
12961293
1297- @staticmethod
1298- def from_dfs (
1299- model : Model = None ,
1300- condition_df : pd .DataFrame = None ,
1301- experiment_df : pd .DataFrame = None ,
1302- measurement_df : pd .DataFrame = None ,
1303- parameter_df : pd .DataFrame = None ,
1304- observable_df : pd .DataFrame = None ,
1305- mapping_df : pd .DataFrame = None ,
1306- config : ProblemConfig = None ,
1307- ):
1308- """
1309- Construct a PEtab problem from dataframes.
1310-
1311- Parameters:
1312- condition_df: PEtab condition table
1313- experiment_df: PEtab experiment table
1314- measurement_df: PEtab measurement table
1315- parameter_df: PEtab parameter table
1316- observable_df: PEtab observable table
1317- mapping_df: PEtab mapping table
1318- model: The underlying model
1319- config: The PEtab problem configuration
1320- """
1321- # TODO: do we really need this?
1322-
1323- observable_table = ObservableTable .from_df (observable_df )
1324- condition_table = ConditionTable .from_df (condition_df )
1325- experiment_table = ExperimentTable .from_df (experiment_df )
1326- measurement_table = MeasurementTable .from_df (measurement_df )
1327- mapping_table = MappingTable .from_df (mapping_df )
1328- parameter_table = ParameterTable .from_df (parameter_df )
1329-
1330- return Problem (
1331- models = [model ],
1332- condition_tables = [condition_table ],
1333- experiment_tables = [experiment_table ],
1334- observable_tables = [observable_table ],
1335- measurement_tables = [measurement_table ],
1336- parameter_tables = [parameter_table ],
1337- mapping_tables = [mapping_table ],
1338- config = config ,
1339- )
1340-
13411294 @staticmethod
13421295 def from_combine (filename : Path | str ) -> Problem :
13431296 """Read PEtab COMBINE archive (http://co.mbine.org/documents/archive).
@@ -2235,6 +2188,7 @@ def model_dump(self, **kwargs) -> dict[str, Any]:
22352188 'experiment_files': [],
22362189 'extensions': {},
22372190 'format_version': '2.0.0',
2191+ 'id': None,
22382192 'mapping_files': [],
22392193 'measurement_files': [],
22402194 'model_files': {},
@@ -2343,19 +2297,25 @@ class ProblemConfig(BaseModel):
23432297 #: The problem ID.
23442298 id : str | None = None
23452299
2346- #: The path to the parameter file, relative to ``base_path``.
2347- # TODO https://github.com/PEtab-dev/PEtab/pull/641:
2348- # rename to parameter_files in yaml for consistency with other files?
2349- # always a list?
2350- parameter_files : list [AnyUrl | Path ] = Field (
2351- default = [], alias = C .PARAMETER_FILES
2352- )
2353-
2300+ #: The paths to the parameter tables.
2301+ # Absolute or relative to `base_path`.
2302+ parameter_files : list [AnyUrl | Path ] = []
2303+ #: The model IDs and files used by the problem (`id->ModelFile`).
23542304 model_files : dict [str , ModelFile ] | None = {}
2305+ #: The paths to the measurement tables.
2306+ # Absolute or relative to `base_path`.
23552307 measurement_files : list [AnyUrl | Path ] = []
2308+ #: The paths to the condition tables.
2309+ # Absolute or relative to `base_path`.
23562310 condition_files : list [AnyUrl | Path ] = []
2311+ #: The paths to the experiment tables.
2312+ # Absolute or relative to `base_path`.
23572313 experiment_files : list [AnyUrl | Path ] = []
2314+ #: The paths to the observable tables.
2315+ # Absolute or relative to `base_path`.
23582316 observable_files : list [AnyUrl | Path ] = []
2317+ #: The paths to the mapping tables.
2318+ # Absolute or relative to `base_path`.
23592319 mapping_files : list [AnyUrl | Path ] = []
23602320
23612321 #: Extensions used by the problem.
0 commit comments