File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ properties:
2323 - type : integer
2424 description : Version of the PEtab format
2525
26+ id :
27+ type : string
28+ description : |
29+ Identifier of the PEtab problem.
30+
31+ This is optional and has no effect on the PEtab problem itself.
32+ pattern : " ^[a-zA-Z_]\\ w*|^$"
33+
2634 parameter_files :
2735 type : array
2836 description : |
Original file line number Diff line number Diff line change @@ -1630,6 +1630,18 @@ def mappings(self) -> list[Mapping]:
16301630 chain .from_iterable (mt .mappings for mt in self .mapping_tables )
16311631 )
16321632
1633+ @property
1634+ def id (self ) -> str :
1635+ """The ID of the PEtab problem if set, ``None`` otherwise."""
1636+ return self .config .id if self .config else None
1637+
1638+ @id .setter
1639+ def id (self , value : str ):
1640+ """Set the ID of the PEtab problem."""
1641+ if self .config is None :
1642+ self .config = ProblemConfig (format_version = "2.0.0" )
1643+ self .config .id = value
1644+
16331645 def get_optimization_parameters (self ) -> list [str ]:
16341646 """
16351647 Get the list of optimization parameter IDs from parameter table.
@@ -2327,6 +2339,10 @@ class ProblemConfig(BaseModel):
23272339 )
23282340 #: The PEtab format version.
23292341 format_version : str = "2.0.0"
2342+
2343+ #: The problem ID.
2344+ id : str = ""
2345+
23302346 #: The path to the parameter file, relative to ``base_path``.
23312347 # TODO https://github.com/PEtab-dev/PEtab/pull/641:
23322348 # rename to parameter_files in yaml for consistency with other files?
You can’t perform that action at this time.
0 commit comments