Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
that for each group an amici.ExpData can be generated.
Returns
-------
(grouping_cols, simulation_conditions): tuple
Here, grouping_cols is the columns according to which the grouping
was done, and simulation_conditions are the identified conditions.
"""
# make sure index is reset
condition_df = condition_df.reset_index()
# find columns to group by (i.e. if not all nans).
# number of amici simulations will be number of unique
# (preequilibrationCondition, simulationCondition) pairs.
# can be improved by checking for identical condition vectors.
grouping_cols = petab.core.get_notnull_columns(
measurement_df,
['simulationConditionId', 'preequilibrationConditionId'])
# group by cols and return dataframe containing each combination
# of those rows only once (and an additional counting row)
simulation_conditions = measurement_df.groupby(
grouping_cols).size().reset_index()
return grouping_cols, simulation_conditions