Skip to content
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

[TODO] avoid allotting small number of students last center #13

Open
sumanashrestha opened this issue Apr 20, 2024 · 4 comments · May be fixed by #51
Open

[TODO] avoid allotting small number of students last center #13

sumanashrestha opened this issue Apr 20, 2024 · 4 comments · May be fixed by #51
Labels
help wanted Extra attention is needed

Comments

@sumanashrestha
Copy link
Collaborator

School A has 207 students. Current script will

  • allot first 100 students to Center A
  • allot next 100 to center B
  • remaining 7 to center C

It is undesirable to separate just 7 students. They are reassigned to either Center A or B during manual inspection. Automate this step.

Also refrain from distributing those 7 students among center A and B
ie
Center A - 107 Center B - 100 is preferred over center A - 103, center B - 104
as it results in cleaner symbol number distribution

may chose to use existing MIN_STUDENTS_IN_CENTER parameter

@sumanashrestha sumanashrestha added the help wanted Extra attention is needed label Apr 20, 2024
@bpnsnr
Copy link

bpnsnr commented Apr 20, 2024

The main change is in the block that reassigns the remaining students to Center A or Center B. Instead of iterating over the centers list and checking for the center codes 'A' and 'B', modified the code to directly check if the center codes 'A' and 'B' exist in the centers_remaining_cap dictionary and if they have enough remaining capacity.

Here's how the updated code works:

The for loop iterates over the center codes 'A' and 'B'.
For each center code, it checks if the code exists in the centers_remaining_cap dictionary, and if the remaining capacity for that center is greater than or equal to MIN_STUDENT_IN_CENTER.
If both conditions are met, it allocates the remaining students (to_allot) to that center using the allocate function.
It updates the centers_remaining_cap for the allocated center by subtracting the allocated students.
It sets to_allot to 0 and breaks out of the loop since all remaining students have been allocated.
This approach directly checks for the existence of Center A and Center B in the centers_remaining_cap dictionary, which should be more efficient than iterating over the centers list and checking the center codes.

Note: This code assumes that the center codes 'A' and 'B' exist in the centers_remaining_cap dictionary. If you want to handle the case where these center codes are not present, you'll need to add additional checks or modify the code accordingly.

@ashiishme
Copy link

I would be really excited to work on this issue. Can you please assign it to me. 🙂

@sumanashrestha
Copy link
Collaborator Author

sumanashrestha commented Apr 21, 2024

I would be really excited to work on this issue. Can you please assign it to me. 🙂

@ashiishme please feel free to submit a pull request. looking for multiple solutions, so not assigning to a single individual.

@ashiishme
Copy link

I have the PR opened but it hasn't been reviewed yet.

@sapradhan sapradhan mentioned this issue May 1, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants