Loading tests/test_play_based_risk.py +15 −8 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ def test_play_based_risk_single_location(): axd["temp_cos"].hist(temperature_cos, bins=20) # thickness axd["thick"].set_title("thick samples [m]") axd["thick"].set_title("Thickness samples [m]") axd["thick"].hist(thickness, bins=20) axd["thick_sig"].set_title("Thickness Sigmoid") Loading @@ -86,7 +86,7 @@ def test_play_based_risk_single_location(): axd["thick_cos"].hist(thickness_cos, bins=20) # permeability axd["perm"].set_title("permeability samples [mD]") axd["perm"].set_title("Permeability samples [mD]") axd["perm"].hist(permeability, bins=20) axd["perm_sig"].set_title("Permeability Sigmoid") Loading @@ -102,10 +102,10 @@ def test_play_based_risk_single_location(): # ntg axd["ntg"].set_title("ntg samples [0-1]") axd["ntg"].set_title("NTG samples [0-1]") axd["ntg"].hist(ntg, bins=20) axd["ntg_sig"].set_title("ntg Sigmoid") axd["ntg_sig"].set_title("NTG Sigmoid") axd["ntg_sig"].plot( np.linspace(ntg_range[0], ntg_range[1]), smooth_logit( Loading @@ -113,7 +113,7 @@ def test_play_based_risk_single_location(): ), ) axd["ntg_cos"].set_title("ntg COS") axd["ntg_cos"].set_title("NTG COS") axd["ntg_cos"].hist(ntg_cos, bins=20) # combined cos Loading @@ -131,7 +131,7 @@ def test_cos_grid(): thick = read_grid(test_input / f"{aquifer}__thick.zmap") thick_sd = read_grid(test_input / f"{aquifer}__thick_sd.zmap") n_samples = 10 n_samples = 1000 cos_grids = [] cos_mean_grid = copy.deepcopy(ntg) Loading @@ -155,5 +155,12 @@ def test_cos_grid(): cos_mean_grid.data = np.mean(cos_grids, axis=0) cos_sd_grid.data = np.std(cos_grids, axis=0) plot_grid(cos_mean_grid, add_netherlands_shapefile=True, show=True) plot_grid(cos_sd_grid, add_netherlands_shapefile=True, show=True) No newline at end of file fig, ax = plt.subplots(nrows=1, ncols = 2, figsize=(20, 10)) plot_grid(cos_mean_grid, axes=ax[0], add_netherlands_shapefile=True) plot_grid(cos_sd_grid, axes=ax[1], add_netherlands_shapefile=True) ax[0].set_title("Mean COS") ax[1].set_title("SD COS") plt.show() No newline at end of file Loading
tests/test_play_based_risk.py +15 −8 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ def test_play_based_risk_single_location(): axd["temp_cos"].hist(temperature_cos, bins=20) # thickness axd["thick"].set_title("thick samples [m]") axd["thick"].set_title("Thickness samples [m]") axd["thick"].hist(thickness, bins=20) axd["thick_sig"].set_title("Thickness Sigmoid") Loading @@ -86,7 +86,7 @@ def test_play_based_risk_single_location(): axd["thick_cos"].hist(thickness_cos, bins=20) # permeability axd["perm"].set_title("permeability samples [mD]") axd["perm"].set_title("Permeability samples [mD]") axd["perm"].hist(permeability, bins=20) axd["perm_sig"].set_title("Permeability Sigmoid") Loading @@ -102,10 +102,10 @@ def test_play_based_risk_single_location(): # ntg axd["ntg"].set_title("ntg samples [0-1]") axd["ntg"].set_title("NTG samples [0-1]") axd["ntg"].hist(ntg, bins=20) axd["ntg_sig"].set_title("ntg Sigmoid") axd["ntg_sig"].set_title("NTG Sigmoid") axd["ntg_sig"].plot( np.linspace(ntg_range[0], ntg_range[1]), smooth_logit( Loading @@ -113,7 +113,7 @@ def test_play_based_risk_single_location(): ), ) axd["ntg_cos"].set_title("ntg COS") axd["ntg_cos"].set_title("NTG COS") axd["ntg_cos"].hist(ntg_cos, bins=20) # combined cos Loading @@ -131,7 +131,7 @@ def test_cos_grid(): thick = read_grid(test_input / f"{aquifer}__thick.zmap") thick_sd = read_grid(test_input / f"{aquifer}__thick_sd.zmap") n_samples = 10 n_samples = 1000 cos_grids = [] cos_mean_grid = copy.deepcopy(ntg) Loading @@ -155,5 +155,12 @@ def test_cos_grid(): cos_mean_grid.data = np.mean(cos_grids, axis=0) cos_sd_grid.data = np.std(cos_grids, axis=0) plot_grid(cos_mean_grid, add_netherlands_shapefile=True, show=True) plot_grid(cos_sd_grid, add_netherlands_shapefile=True, show=True) No newline at end of file fig, ax = plt.subplots(nrows=1, ncols = 2, figsize=(20, 10)) plot_grid(cos_mean_grid, axes=ax[0], add_netherlands_shapefile=True) plot_grid(cos_sd_grid, axes=ax[1], add_netherlands_shapefile=True) ax[0].set_title("Mean COS") ax[1].set_title("SD COS") plt.show() No newline at end of file