Skip to content

Commit

Permalink
fix(ci::test_mf6_shellmound.py::test_rch_setup): relative pct differe…
Browse files Browse the repository at this point in the history
…nce issue on osx
  • Loading branch information
aleaf committed May 7, 2024
1 parent 5c55095 commit 15b5ad7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions mfsetup/tests/test_mf6_shellmound.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,20 +552,26 @@ 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
values = get_period_values('2012-01-01', '2017-12-31')

#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.
Expand Down

0 comments on commit 15b5ad7

Please sign in to comment.