Commit 179dc82
authored
Fix flatten_timepoint_specific_output_overrides (#239)
... again.
Fixes an error when trying to apply re.sub to numeric values:
```
petab.flatten_timepoint_specific_output_overrides(problem)
build/venv/lib/python3.9/site-packages/petab/core.py:290: in flatten_timepoint_specific_output_overrides
observable[target] = re.sub(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pattern = 'observableParameter([0-9]+)_obs_a'
repl = 'observableParameter\\1_obs_a__10__c0', string = 1, count = 0, flags = 0
def sub(pattern, repl, string, count=0, flags=0):
"""Return the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in string by the
replacement repl. repl can be either a string or a callable;
if a string, backslash escapes in it are processed. If it is
a callable, it's passed the Match object and must return
a replacement string to be used."""
> return _compile(pattern, flags).sub(repl, string, count)
E TypeError: cannot use a string pattern on a bytes-like object
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/re.py:210: TypeError
```1 parent eb08318 commit 179dc82
2 files changed
+41
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
285 | 290 | | |
286 | 291 | | |
287 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | | - | |
| 354 | + | |
| 355 | + | |
355 | 356 | | |
356 | 357 | | |
357 | | - | |
| 358 | + | |
| 359 | + | |
358 | 360 | | |
359 | 361 | | |
360 | 362 | | |
| |||
366 | 368 | | |
367 | 369 | | |
368 | 370 | | |
369 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
373 | 380 | | |
| 381 | + | |
374 | 382 | | |
375 | 383 | | |
376 | 384 | | |
| |||
379 | 387 | | |
380 | 388 | | |
381 | 389 | | |
| 390 | + | |
382 | 391 | | |
383 | 392 | | |
384 | 393 | | |
| |||
387 | 396 | | |
388 | 397 | | |
389 | 398 | | |
390 | | - | |
| 399 | + | |
391 | 400 | | |
392 | 401 | | |
393 | 402 | | |
394 | 403 | | |
395 | 404 | | |
| 405 | + | |
396 | 406 | | |
397 | | - | |
398 | | - | |
399 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
400 | 410 | | |
401 | 411 | | |
402 | 412 | | |
403 | 413 | | |
404 | 414 | | |
| 415 | + | |
405 | 416 | | |
406 | 417 | | |
407 | 418 | | |
408 | 419 | | |
409 | 420 | | |
410 | 421 | | |
| 422 | + | |
411 | 423 | | |
412 | 424 | | |
413 | 425 | | |
414 | 426 | | |
415 | 427 | | |
416 | 428 | | |
417 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
418 | 436 | | |
419 | 437 | | |
420 | 438 | | |
421 | 439 | | |
422 | 440 | | |
| 441 | + | |
423 | 442 | | |
424 | | - | |
425 | | - | |
426 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
427 | 446 | | |
428 | 447 | | |
429 | 448 | | |
430 | 449 | | |
431 | 450 | | |
| 451 | + | |
432 | 452 | | |
433 | 453 | | |
434 | 454 | | |
435 | 455 | | |
436 | 456 | | |
437 | 457 | | |
| 458 | + | |
438 | 459 | | |
439 | 460 | | |
440 | 461 | | |
| |||
483 | 504 | | |
484 | 505 | | |
485 | 506 | | |
486 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
487 | 510 | | |
488 | 511 | | |
489 | 512 | | |
| |||
0 commit comments