From 15b5ad71f18b46e3d1329067ce9940aa057919ae Mon Sep 17 00:00:00 2001 From: "Leaf, Andrew T" Date: Tue, 7 May 2024 10:54:34 -0500 Subject: [PATCH] fix(ci::test_mf6_shellmound.py::test_rch_setup): relative pct difference issue on osx --- mfsetup/tests/test_mf6_shellmound.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/mfsetup/tests/test_mf6_shellmound.py b/mfsetup/tests/test_mf6_shellmound.py index f25cc24b..8095dd4a 100644 --- a/mfsetup/tests/test_mf6_shellmound.py +++ b/mfsetup/tests/test_mf6_shellmound.py @@ -552,11 +552,16 @@ def test_rch_setup(shellmound_model_with_dis): unit_conversion = convert_length_units('inches', 'meters') def get_period_values(start, end): - period_data = ds['net_infiltration'].loc[start:end].mean(axis=0) - dsi = period_data.interp(x=x, y=y, method='linear', + #period_data = ds['net_infiltration'].loc[start:end].mean(axis=0) + #dsi = period_data.interp(x=x, y=y, method='linear', + # kwargs={'fill_value': np.nan, + # 'bounds_error': True}) + dsi = ds.interp(x=x, y=y, method='linear', kwargs={'fill_value': np.nan, 'bounds_error': True}) - data = dsi.values * unit_conversion + period_data = dsi['net_infiltration'].loc[start:end].mean(axis=0) + data = period_data.values * unit_conversion + #data = dsi.values * unit_conversion return np.reshape(data, (m.nrow, m.ncol)) # test steady-state avg. across all data @@ -564,8 +569,9 @@ def get_period_values(start, end): #assert np.allclose(values, m.rch.recharge.array[0, 0]) # test period 1 avg. for those times - values1 = get_period_values(m.perioddata['start_datetime'].values[1], - m.perioddata['end_datetime'].values[1]) + start = m.cfg['rch']['source_data']['recharge']['period_stats'][1][0] + end = m.cfg['rch']['source_data']['recharge']['period_stats'][1][1] + values1 = get_period_values(start, end) assert testing.rpd(values1.mean(), m.rch.recharge.array[1, 0].mean()) < 0.01 # check that nodata are written as 0.