-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply age filter using min_age_booking #495
Conversation
Fixes bombardier-gif#494 - Will make the minimum age filter continuous instead of discrete steps
if "centers" in resp: | ||
for center in list(resp["centers"]): | ||
for session in list(center["sessions"]): | ||
if session['min_age_limit'] != center_age_filter: | ||
if session['min_age_limit'] > min_age_booking: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It displays centers for both 45+ and 18+. This will not work in a scenario where min_age_booking is above 45 and if the location you are searching for opens up slots for only 18+, it will try to book that and throw an error. Refer this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dosen't 18+ means anyone above 18? or is those centers only for 18-45 only. If 18+ centers is only for 18-45 then, then this will end up with the error for person aboue 45. But that opens up a new question then what does 40+ (and other age classes) mean? 40-45?
But if 18+ means anyone above 18, then in the current function filter_centers_by_age
(in the main branch) will filter out 40+ sessions for a person with age 42. Also, if this is the case I don't think we need the function filter_centers_by_age
altogether as the viable_options
function clearly filters the sessions based on age.
Can you clarify if booking a 18+ session for a person with age above 45 will result in an error? If not can I remove the filter_centers_by_age
function altogether and add it to this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dosen't 18+ means anyone above 18? or is those centers only for 18-45 only. If 18+ centers is only for 18-45 then, then this will end up with the error for person aboue 45. But that opens up a new question then what does 40+ (and other age classes) mean? 40-45?
No it doesn't. CoWIN has 2 age grps 18-44 and 45+(and now 40-44 is also there which is very rare)
But if 18+ means anyone above 18, then in the current function
filter_centers_by_age
(in the main branch) will filter out 40+ sessions for a person with age 42. Also, if this is the case I don't think we need the functionfilter_centers_by_age
altogether as theviable_options
function clearly filters the sessions based on age.
filter_centers_by_age prints the available centers according to age and then viable option filters them according to dose_no,fee_type and min slots. So no we can't remove it since viable options will not filter by age. Are you suggesting we should merge these 2 functions.
Can you clarify if booking a 18+ session for a person with age above 45 will result in an error? If not can I remove the
filter_centers_by_age
function altogether and add it to this PR?
Yes it does give you an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't. CoWIN has 2 age grps 18-44 and 45+(and now 40-44 is also there which is very rare)
I disagree with this. This is the data I got from the Ernakulam (Kerala) district data for the date 08-07-2021
for number of session and min_age_limit for each session.
{
"age 45": 67,
"age 40": 44,
"age 18": 11
}
So, I think in some regions there are more age ranges. Also as mentioned here, there are other age limits too.
So no we can't remove it since viable options will not filter by age
I think the function filters according to age as seen in this line. But if there is a problem like the error you mentioned is there with age classes, I accept that a filter like filter_centers_by_age
function is needed . But then why is theviable_options
function again filtering based on age?
But even as such the issue #494 still exists but I am closing this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the function filters according to age as seen in this line. But if there is a problem like the error you mentioned is there with age classes, I accept that a filter like
filter_centers_by_age
function is needed . But then why is theviable_options
function again filtering based on age?
I agree, there is no point in filtering out by age again in viable options since we are already doing that in filter_centers_by_age func
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like there are very few centers like these with these varying age grp restrictions. So as of now we can hold off this PR and keep issue #494 open.
We probably need to see the min and max limit of every age group and accordingly need to implement the logic
Fixes #494
Make the minimum age filter continuous instead of discrete steps.