|
12 | 12 | from .. import v1, v2
|
13 | 13 | from ..v1 import Problem as ProblemV1
|
14 | 14 | from ..v1.yaml import get_path_prefix, load_yaml, validate, write_yaml
|
15 |
| -from ..v2.models import MODEL_TYPE_SBML |
16 | 15 | from ..versions import get_major_version
|
| 16 | +from .models import MODEL_TYPE_SBML |
17 | 17 |
|
18 | 18 | __all__ = ["petab1to2"]
|
19 | 19 |
|
@@ -70,7 +70,6 @@ def petab1to2(yaml_config: Path | str, output_dir: Path | str = None):
|
70 | 70 | # Update YAML file
|
71 | 71 | new_yaml_config = _update_yaml(yaml_config)
|
72 | 72 |
|
73 |
| - # Write new YAML file |
74 | 73 | output_dir = Path(output_dir)
|
75 | 74 | output_dir.mkdir(parents=True, exist_ok=True)
|
76 | 75 |
|
@@ -179,10 +178,8 @@ def create_experiment_id(sim_cond_id: str, preeq_cond_id: str) -> str:
|
179 | 178 | # add pre-eq condition id if not present or convert to string
|
180 | 179 | # for simplicity
|
181 | 180 | if v1.C.PREEQUILIBRATION_CONDITION_ID in measurement_df.columns:
|
182 |
| - measurement_df[ |
183 |
| - v1.C.PREEQUILIBRATION_CONDITION_ID |
184 |
| - ] = measurement_df[v1.C.PREEQUILIBRATION_CONDITION_ID].fillna( |
185 |
| - "" |
| 181 | + measurement_df.fillna( |
| 182 | + {v1.C.PREEQUILIBRATION_CONDITION_ID: ""}, inplace=True |
186 | 183 | )
|
187 | 184 | else:
|
188 | 185 | measurement_df[v1.C.PREEQUILIBRATION_CONDITION_ID] = ""
|
@@ -223,6 +220,7 @@ def create_experiment_id(sim_cond_id: str, preeq_cond_id: str) -> str:
|
223 | 220 | measurement_df, get_dest_path(measurement_file)
|
224 | 221 | )
|
225 | 222 |
|
| 223 | + # Write new YAML file |
226 | 224 | new_yaml_file = output_dir / Path(yaml_file).name
|
227 | 225 | write_yaml(new_yaml_config, new_yaml_file)
|
228 | 226 |
|
|
0 commit comments