Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion petab/v2/petab1to2.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def _update_yaml(yaml_config: dict) -> dict:
yaml_config[v2.C.FORMAT_VERSION] = "2.0.0"

# Add extensions
yaml_config[v2.C.EXTENSIONS] = []
yaml_config[v2.C.EXTENSIONS] = {}

# Move models and set IDs (filename for now)
for problem in yaml_config[v2.C.PROBLEMS]:
Expand Down
9 changes: 4 additions & 5 deletions petab/v2/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ def validate(

validation_results = ValidationResultList()
if self.config.extensions:
extensions = ",".join(e.name for e in self.config.extensions)
extensions = ",".join(self.config.extensions.keys())
validation_results.append(
ValidationIssue(
ValidationIssueSeverity.WARNING,
Expand Down Expand Up @@ -1116,7 +1116,7 @@ def model_dump(self, **kwargs) -> dict[str, Any]:
>>> p += core.Parameter(id="par", lb=0, ub=1)
>>> pprint(p.model_dump())
{'conditions': [],
'config': {'extensions': [],
'config': {'extensions': {},
'format_version': '2.0.0',
'parameter_file': None,
'problems': []},
Expand Down Expand Up @@ -1168,7 +1168,6 @@ class SubProblem(BaseModel):
class ExtensionConfig(BaseModel):
"""The configuration of a PEtab extension."""

name: str
version: str
config: dict

Expand All @@ -1194,8 +1193,8 @@ class ProblemConfig(BaseModel):
parameter_file: str | AnyUrl | None = None
#: The list of problems in the configuration.
problems: list[SubProblem] = []
#: Extensiions used by the problem.
extensions: list[ExtensionConfig] = []
#: Extensions used by the problem.
extensions: dict[str, ExtensionConfig] = {}

def to_yaml(self, filename: str | Path):
"""Write the configuration to a YAML file.
Expand Down
Loading