From 6ad55bcf423dd29424d960b01711788f7e30ecd4 Mon Sep 17 00:00:00 2001 From: Travis Thurber Date: Thu, 29 Dec 2022 08:39:17 -0800 Subject: [PATCH] relax water constraint test to support small variations from dependency versions (#100) --- mosartwmpy/_version.py | 2 +- .../tests/test_calculate_water_constraints_by_farm.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mosartwmpy/_version.py b/mosartwmpy/_version.py index 3d18726..dd9b22c 100644 --- a/mosartwmpy/_version.py +++ b/mosartwmpy/_version.py @@ -1 +1 @@ -__version__ = "0.5.0" +__version__ = "0.5.1" diff --git a/mosartwmpy/tests/test_calculate_water_constraints_by_farm.py b/mosartwmpy/tests/test_calculate_water_constraints_by_farm.py index 32be1e9..565346b 100644 --- a/mosartwmpy/tests/test_calculate_water_constraints_by_farm.py +++ b/mosartwmpy/tests/test_calculate_water_constraints_by_farm.py @@ -1,4 +1,5 @@ import unittest +import numpy as np import pandas as pd import pkg_resources @@ -65,7 +66,11 @@ def test_calculate_water_constraints_by_farm(self): 90: 1867.5493916929483, 91: 871.2380665376529, 92: 551.7301491571899, 93: 12.085666626862842, 94: 0.0, 95: 0.0, 96: 2.757034402743735, 97: 2.059543992483289, 98: 0.0, 99: 0.0} - self.assertEqual(water_constraints_by_farm, expected) + np.testing.assert_almost_equal( + np.array(list(water_constraints_by_farm.values())), + np.array(list(expected.values())), + 2 + ) if __name__ == '__main__':