Skip to content

Commit

Permalink
Merge branch 'develop' into oak_warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hackdna authored Oct 25, 2024
2 parents 79e5d3a + cd8cdbb commit 8508c53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion forest/sycamore/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,19 @@ def find_missing_data(user: str, survey_id: str, agg_data: pd.DataFrame,
].unique()
missing_times = []
for time in known_answers_submits:
# If there were no timings submits recorded, every answers
# submit will be missing
if len(known_timings_submits) == 0:
missing_times.append(time)
continue

hours_from_nearest = np.min(
np.abs((pd.to_datetime(known_timings_submits)
- pd.to_datetime(time)).total_seconds())
) / 60 / 60
# add on the data if there is more than 1/2 hour between an
# answers submission and a timing submission.
if hours_from_nearest > .5 or len(known_timings_submits) == 0:
if hours_from_nearest > .5:
missing_times.append(time)
if len(missing_times) > 0:
missing_data = answers_data.loc[
Expand Down

0 comments on commit 8508c53

Please sign in to comment.