dmarr commited on
Commit
d4440d0
·
1 Parent(s): 8c1bf0e
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -186,8 +186,8 @@ def nuc_monitor(usr_start_date, usr_end_date, past_date, mongo_db_data):
186
 
187
  sorted_df = sorted_df.copy().reset_index(drop=True)
188
 
189
- nogent_2 = sorted_df.copy()[(sorted_df.copy()["name"] == "NOGENT 2") & (sorted_df.copy()["end_date"] >= start_date_str)]
190
- print(nogent_2[['updated_date', 'available_capacity']])
191
 
192
  # Filter to get identifiers
193
  filtered_id_df = sorted_df.copy()
@@ -195,8 +195,8 @@ def nuc_monitor(usr_start_date, usr_end_date, past_date, mongo_db_data):
195
  # I commented this out
196
  filtered_id_df = filtered_id_df.drop_duplicates(subset='identifier', keep='last')
197
 
198
- nogent_2 = filtered_id_df.copy()[(filtered_id_df.copy()["name"] == "NOGENT 2") & (filtered_id_df.copy()["end_date"] >= start_date_str)]
199
- print(nogent_2[['updated_date', 'available_capacity']])
200
  # --------------------------- !!!!!!!!!!!!!!!!!!!!!!! HERE IS POTENTIAL ERROR!!!!!!!!!!!!!!!!!!!!!!! --------------------------- #
201
 
202
  filtered_id_df = filtered_id_df.copy().reset_index(drop=True)
@@ -282,6 +282,8 @@ def nuc_monitor(usr_start_date, usr_end_date, past_date, mongo_db_data):
282
  filtered_values.append(item)
283
  results_filtered[key] = filtered_values
284
 
 
 
285
 
286
  sorted_results = results_filtered
287
  # --------------------- SECOND DATA CLEANING ------------------------ #
 
186
 
187
  sorted_df = sorted_df.copy().reset_index(drop=True)
188
 
189
+ cruas_2 = sorted_df.copy()[(sorted_df.copy()["name"] == "CRUAS 2") & (sorted_df.copy()["end_date"] >= start_date_str)]
190
+ print(cruas_2[['updated_date', 'end_date', 'available_capacity']])
191
 
192
  # Filter to get identifiers
193
  filtered_id_df = sorted_df.copy()
 
195
  # I commented this out
196
  filtered_id_df = filtered_id_df.drop_duplicates(subset='identifier', keep='last')
197
 
198
+ cruas_2 = filtered_id_df.copy()[(filtered_id_df.copy()["name"] == "CRUAS 2") & (filtered_id_df.copy()["end_date"] >= start_date_str)]
199
+ print(cruas_2[['updated_date', 'end_date', 'available_capacity']])
200
  # --------------------------- !!!!!!!!!!!!!!!!!!!!!!! HERE IS POTENTIAL ERROR!!!!!!!!!!!!!!!!!!!!!!! --------------------------- #
201
 
202
  filtered_id_df = filtered_id_df.copy().reset_index(drop=True)
 
282
  filtered_values.append(item)
283
  results_filtered[key] = filtered_values
284
 
285
+ # Need to eventually do a filter that takes the most restrictive updated identifier instead of the most recent when there
286
+ # is an overlap
287
 
288
  sorted_results = results_filtered
289
  # --------------------- SECOND DATA CLEANING ------------------------ #