Open ots22 opened 4 years ago
The bug is something related to matching the dates that projects have resource required with dates that people are available in the github emoji table. I haven't tracked it down and fixed it properly yet, but committed a quick fix that bypasses the issue (return 0 if trying to calculate mean on an empty list, rather than erroring).
So the update link on the web app should be working again, but where zero availability/demand appears on the github emoji table it may be a bug rather than a genuine zero as things stand.
start_date
and end_date
arguments given to get_person_availability
inside get_preferences
seem to get set to the same value (start_date = end_date
) if the duration of resource required is less than one month. Probably because the resource required info is resampled to be monthly inside the function on line 216:
resreqdf = wim.project_resourcereq.resample('MS').mean()
This incorrectly leads to an empty list of person availability in the get_person_availability
function.
Visiting https://wimbledon-planner.azurewebsites.net/update
I get the following message after about a minute:
Traceback (most recent call last): File "app.py", line 78, in update preferences_table = pref.get_all_preferences_table(wim=vis.wim) File "/WimbledonPlanner/wimbledon/github/preferences_availability.py", line 324, in get_all_preferences_table preferences_with_availability = get_preferences(wim, preference_data_df) File "/WimbledonPlanner/wimbledon/github/preferences_availability.py", line 247, in get_preferences person_availability = get_person_availability(wim, name, first_resreq_date, last_resreq_date) File "/WimbledonPlanner/wimbledon/github/preferences_availability.py", line 122, in get_person_availability average_availability = statistics.mean(availability_range) File "/usr/local/lib/python3.7/statistics.py", line 310, in mean raise StatisticsError('mean requires at least one data point') statistics.StatisticsError: mean requires at least one data point