Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplification of PEtab problems #172

Merged
merged 9 commits into from
Aug 4, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove O
  • Loading branch information
dweindl committed Aug 4, 2022
commit 925ebf0d564b04e6b019cc1c732c6410a5aa407b
9 changes: 4 additions & 5 deletions petab/simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import pandas as pd

import petab
from . import Problem
from .C import * # noqa: F403
from .lint import lint_problem
Expand Down Expand Up @@ -72,12 +73,10 @@ def condition_parameters_to_parameter_table(problem: Problem):
continue

series = problem.condition_df[parameter_id]
if series.dtype == 'o':
# We don't touch parametric overrides
continue
value = petab.to_float_if_float(series[0])

# same value for all conditions?
if len(series.unique()) == 1:
# same value for all conditions and no parametric overrides (str)?
if isinstance(value, float) and len(series.unique()) == 1:
replacements[parameter_id] = series[0]

if not replacements:
Expand Down