Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed May 8, 2023
1 parent 1261f5d commit dda5034
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,29 @@ def test_check_parameter_df():
lint.check_parameter_df(df=parameter_df)


def test_check_observable_df():
"""Check that we correctly detect errors in observable table"""

observable_df = pd.DataFrame(data={
OBSERVABLE_ID: ['obs1', 'obs2'],
OBSERVABLE_FORMULA: ['x1', 'x2'],
NOISE_FORMULA: ['sigma1', 'sigma2']
}).set_index(OBSERVABLE_ID)

lint.check_observable_df(observable_df)

# Check that duplicated observables ids are detected
bad_observable_df = observable_df.copy()
bad_observable_df.index = ['obs1', 'obs1']
with pytest.raises(AssertionError):
lint.check_observable_df(bad_observable_df)

# Check that missing noiseFormula is detected
bad_observable_df = observable_df.copy()
bad_observable_df.loc['obs1', NOISE_FORMULA] = nan
with pytest.raises(AssertionError):
lint.check_observable_df(bad_observable_df)


def test_condition_ids_are_unique():
condition_df = pd.DataFrame(data={
Expand Down

0 comments on commit dda5034

Please sign in to comment.