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

Method to check if measurement time is at steady-state #124

Merged
merged 1 commit into from
Apr 18, 2022
Merged
Changes from all commits
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
15 changes: 15 additions & 0 deletions petab/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# noqa: F405

import itertools
import math
import numbers
from pathlib import Path
from typing import Dict, List, Union
Expand All @@ -21,6 +22,7 @@
'get_rows_for_condition',
'get_simulation_conditions',
'measurements_have_replicates',
'measurement_is_at_steady_state',
'split_parameter_replacement_list',
'write_measurement_df']

Expand Down Expand Up @@ -342,3 +344,16 @@ def assert_overrides_match_parameter_count(
f'for observable {row[OBSERVABLE_ID]}, but parameter ID '
'or multiple overrides were specified in the '
'noiseParameters column.')


def measurement_is_at_steady_state(time: float) -> bool:
"""Check whether a measurement is at steady state.

Arguments:
time:
The time.

Returns:
Whether the measurement is at steady state.
"""
return math.isinf(time)