You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculate what percentage of users in a community have filled out their availability.
This well help us track whether people are eligible for schedule matches at all. Currently, there is no way for users to edit their schedule, so for now, there will be no real data to test this feature with, which means you will have to write good unit tests to ensure that it will work correctly when the real data arrives.
Definition of Done
Write a function that takes in a list of User objects and returns a tuple of two counts
The first count in the tuple is the number of users who have availability data
The second count in the tuple is the total number of users
Write unit tests for the above function
Why a tuple? It will be more reliable to test the numerator and denominator, rather than the percentage
Integrate the above function into the matching pipeline
Call your function in the display_internal_matching_metrics() task, which is used in the matching flow
Add a line to log the percentage of users who have filled out their availability, using the tuple output
Run the matching flow with run flow matching to make sure that it succeeds and logs the correct information
Code Pointers
Implementation and Tests
Write your own function (no need for a class) to calculate this tuple
You can create a new file pipeline/transform/schedule.py for your function
You can create a new file pipeline/transform/schedule_test.py for your unit tests
Similar to your core project, read examples from the codebase to see how to use functions, tests, and types
User Availability Data
Just like in your schedule match generator, you can check whether a user has availability data by accessing the schedule field of the User class:
vingkan
changed the title
Matching Engine Analytics: Percentage of users with schedule data
Matching Engine Analytics: Percentage of users with availability data
Jul 22, 2022
@vingkan Emma is done with her core project now and is ready to start the stretch assignment! 🎉 What did you have in mind for this assignment in terms of details? Could you please add details or explain it to me so that I can add details to the issue?
@rbrooks6 Thanks for the reminder! I updated this issue with more details. The instructions for #312 will be very similar, so if @emmadiamon finishes this task quickly, she can follow a similar approach for that task.
Goal
Calculate what percentage of users in a community have filled out their availability.
This well help us track whether people are eligible for schedule matches at all. Currently, there is no way for users to edit their schedule, so for now, there will be no real data to test this feature with, which means you will have to write good unit tests to ensure that it will work correctly when the real data arrives.
Definition of Done
User
objects and returns a tuple of two countsdisplay_internal_matching_metrics()
task, which is used in the matching flowrun flow matching
to make sure that it succeeds and logs the correct informationCode Pointers
Implementation and Tests
pipeline/transform/schedule.py
for your functionpipeline/transform/schedule_test.py
for your unit testsUser Availability Data
Just like in your schedule match generator, you can check whether a user has availability data by accessing the
schedule
field of theUser
class:butterfly/pipeline/types/user.py
Line 26 in f21cdc8
Pipeline Integration
display_internal_matching_metrics()
is a Prefect task, which runs as part of the matching flowMatchingOutput
parameter by accessingoutput.users
butterfly/pipeline/load/display_metrics.py
Lines 27 to 38 in f21cdc8
The text was updated successfully, but these errors were encountered: