Esempio n. 1
0
def test_condition_table_is_parameter_free():
    with patch('petab.get_parametric_overrides') \
            as mock_get_parametric_overrides:
        mock_get_parametric_overrides.return_value = []
        assert lint.condition_table_is_parameter_free(pd.DataFrame()) is True
        mock_get_parametric_overrides.assert_called_once()

        mock_get_parametric_overrides.reset_mock()
        mock_get_parametric_overrides.return_value = ['p1']
        assert lint.condition_table_is_parameter_free(pd.DataFrame()) is False
        mock_get_parametric_overrides.assert_called_once()
Esempio n. 2
0
def test_condition_table_is_parameter_free():
    condition_df = pd.DataFrame(
        data={
            'conditionId': ['condition1', 'condition2'],
            'conditionName': ['', 'Condition 2'],
            'fixedParameter1': [1.0, 2.0]
        })

    assert lint.condition_table_is_parameter_free(condition_df) is True

    condition_df.fixedParameter1 = \
        condition_df.fixedParameter1.values.astype(int)

    assert lint.condition_table_is_parameter_free(condition_df) is True

    condition_df.loc[0, 'fixedParameter1'] = 'parameterId'

    assert lint.condition_table_is_parameter_free(condition_df) is False