Skip to content

Commit 229db3a

Browse files
committed
Remove nonworking check_performance fn
1 parent f5d1050 commit 229db3a

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

utils/Wetlands.py

-30
Original file line numberDiff line numberDiff line change
@@ -223,36 +223,6 @@ def plot_wets_drys(self, dtw_thresh=0.08, hrs_thresh=5185, test=False):
223223
fig.subplots_adjust(left=0.05, right=0.915, wspace=0.25, hspace=0.25)
224224
plt.show()
225225

226-
def check_performance(self, dtw_thresh=0.08, hrs_thresh=5185):
227-
""" Check number of cells / percentages to create table of performance """
228-
df = pd.read_pickle(op.join(self.path_data, 'dtw_hrs_wet_dry_masked.df'))
229-
df_passed = df[((df.dtw_thresh<=dtw_thresh) & (df.hrs_thresh >= hrs_thresh))].iloc[0, :]
230-
231-
### this should be encapsulated in fn; used here and make_indicator
232-
mat_dtw = self.mat_dtw[self.mask_z]
233-
mask_wet = self.mask_wet[self.mask_z]
234-
mat_wet_dtw = mat_dtw[~mask_wet]
235-
mat_nonwet_dtw = mat_dtw[mask_wet]
236-
mat_dry_dtw = mat_nonwet_dtw[~np.isnan(mat_nonwet_dtw)].reshape(
237-
-1, mat_nonwet_dtw.shape[1])
238-
total_ccap = mat_wet_dtw.shape[0]
239-
total_nonccap = mat_dry_dtw.shape[0]
240-
total_wets = df_passed.loc['n_wet'] + df_passed.loc['n_dry']
241-
total_subs = self.df_swmm.shape[0]
242-
df_raw = pd.DataFrame(np.zeros([4, 3]), columns=['sim_wet', 'true_wet', 'per_covering'], index=['A', 'B', 'C', 'D'])
243-
244-
df_raw.loc['A', :] = ['Yes', 'Yes', round(df_passed.loc['n_wet']/total_subs*100, 2)] # correct
245-
df_raw.loc['B', :] = ['No', 'Yes', round((total_ccap - total_wets) / total_subs*100, 2)] # pretty sure correct
246-
df_raw.loc['C', :] = ['Yes', 'No', round(df_passed.loc['n_dry']/total_subs*100, 2)] # correct
247-
df_raw.loc['D', :] = ['No', 'No', round((total_subs-total_wets) / total_subs*100, 2)]
248-
print df_raw
249-
print (df_raw.iloc[:, 2].sum())
250-
251-
252-
253-
254-
return
255-
256226
def overlay_sim_true(self, dtw_thresh=0.08, hrs_thresh=5185):
257227
""" Compare the simulated/nonsimulated wetlands vs ccap """
258228
df = pd.read_pickle(op.join(self.path_data, 'dtw_hrs_wet_dry_masked.df'))

0 commit comments

Comments
 (0)