Commit e94ea6f
Fix JAXProblem.save()/load() round-trip against current petab.v2 API (#3204)
petab.v2.Problem.to_files() was simplified from a many-keyword-argument
signature to to_files(base_path), which relies on each table/model
already having rel_path/base_path set (normally done by
Problem.from_yaml). JAXProblem.save() still called the old signature
(prefix_path=..., model_file=..., condition_file=..., ...), raising
TypeError. Fixed to set config.filepath = "problem.yaml" (so the
written YAML has the name JAXProblem.load() expects) and call
to_files(base_path=directory).
This was masked by a broader skip-guard in test_serialisation; getting
past that guard also required fixing a prerequisite bug in
import_petab_problem(..., jax=True): it passed the original PEtab v1
problem straight into JAXProblem(), which rejects v1 problems outright.
Upgrade v1->v2 via to_files_generic/from_yaml first, mirroring the
conversion used elsewhere in the codebase.
Removed the now-unneeded try/except skip-guard from test_serialisation
so it actually asserts the round trip. Left the equivalent guard on
test_preequilibration_failure alone, since that covers a separate,
already-known bug in the preequilibration-condition heuristic.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>1 parent 6d10d6f commit e94ea6f
3 files changed
Lines changed: 34 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
| |||
263 | 267 | | |
264 | 268 | | |
265 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
266 | 278 | | |
267 | 279 | | |
268 | | - | |
| 280 | + | |
269 | 281 | | |
270 | 282 | | |
271 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
195 | 192 | | |
196 | 193 | | |
197 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
325 | 324 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
337 | 332 | | |
338 | 333 | | |
339 | 334 | | |
| |||
0 commit comments