moest-np / center-randomize Goto Github PK
View Code? Open in Web Editor NEWScript is to assign exam centers to students
License: MIT License
Script is to assign exam centers to students
License: MIT License
If we pass -o folderName/ as our argument then it is throwing error as DEFAULT_OUTOUT_FILENAME is not defined.
If we can provide full functionality in mobile applications, it would be great for the students and parents.
No response
No response
Yes
School A has 207 students. Current script will
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
A dashboard which plots schools and center on a map.
Preferred solution:
Managing dependencies as the project grows is quite a task, requirements.txt lacks support for dependency version locking, which comes with other maintenance challenges. There are package managers like Rye or Poetry that manage dependencies efficiently.
If no centers are within the absolute distance threshold, it always chooses the same center(the closest one)
Example: If school A doesn't have any center within threshold (7km).
But has 5 centers near threshold but slightly different distance like 7.1, 7.2 km etc. This doesn't choose different center every year.
In this case, there is no check for PREF_CUTOFF either. So even if it was problematic last year, same center will still be chosen.
originally reported in #2
To assist contributors, where contributors can search, navigate, and understand Center-randomize's source code using Onboard AI's free tool LearnThisRepo
I saw a PR without tests written. Let’s add contribution guidelines and define a flow of how a PR gets merged into the repo.
Folder Structure Enhancement:
Architectural Pattern Adoption:
if your comandline argument has ouptput unter a directory structure. thsi produces Directory not found Error.
Steps to reproduce:
python3 school_center.py sample_data/schools_grade12_2081.tsv sample_data/centers_grade12_2081.tsv sample_data/prefs.tsv -o sample_data/output_main.tsv
Traceback (most recent call last):
File "/Users/user/Documents/MOEST/center-randomize/school_center.py", line 165, in
open(OUTPUT_DIR + args.output, 'w+', encoding='utf-8') as a_file:
FileNotFoundError: [Errno 2] No such file or directory: 'results/sample_data/output_main.tsv'
Hi, this is a great effort to have an open sourced algorithm for doing things like this. I hope you continue to open source any other problems/solutions so that more people might be able to take a look at them.
On a quick look, I didn't find any big issue. I am just going to mention some edge cases that I thought of while going through the code. You may need to account for these situations (in future) if you haven't already done so. Piloting this in Kathmandu, itself shouldn't be problematic but as you expand this in future these cases might occur more frequently. Case 3. and 4. might be applicable in Kathmandu as well.
Distance calculation with latitude, longitude doesn't always equal to distance students need to travel by road.
Example:
For places in remote areas, where there is no accessible bridge available and the center happens to be on the other side of river,
closest by km might not be easily accessible.
Maybe this can be handled by setting up prefs code?
If no centers are within the absolute distance threshold, it always chooses the same center(the closest one)
Example: If school A doesn't have any center within threshold (7km).
But has 5 centers near threshold but slightly different distance like 7.1, 7.2 km etc. This doesn't choose different center every year.
In this case, there is no check for PREF_CUTOFF either. So even if it was problematic last year, same center will still be chosen.
Not sure if its possible for students to be not from any school(eg: homeschool). In which case they might need special center allocation.
Centers assignment for students with special needs might need to be handled separately.
On the readme file it says
Run the program and re-run if
This feels very weird.
It would be very userfriendly if all the students are allocated on the single go.
Keep the list of students that are not allocated and try allocating them if they are not allocated at the end of the run.
The script runs in collab but requires manually uploading files to collab vm. Adapt the script such that it takes input from google sheet and outputs to sheet
The goal is to make this easy to run for non technical folks directly from a browser without having to setup anything
Add Github Workflow
Updated description May 5, 2024
In the streamlit app, school not plotted in map, only centers are plotted. I believe the original intent of this feature was to visualize how the centers are geo - distributed with respect to the school (and vice versa), omitting selected school defeats the purpose.
Run the streamlit app, select a school or center, observe only centers are plotted, not the selected entity
Schools should also be plotted in a different colored marker.
similar to what @RupeshAryal had demoed in this comment
Additionally -
When school is selected, it is not plotted
When center is selected, it is the only thing plotted.
Linux
python 3.11.9
Firefox 125
None
There are many PRs created without discussion and also some of them are merged that can conflict with other PRs. It's a really good thing to have many contributors but I believe we should standardize the process otherwise it will be harder to maintain.
I have opened this issues to discuss about some of the standard ways we can implement together with the maintainers of this project apart from the contribution guidelines. There are indeed many ways we can improve but I believe these are some of the important steps we should take now:
Any PRs created without a discussion shouldn't be accepted, there should be a proper discussion on why we need the changes. This is a good way to filter unwanted PRs as well as reduce the duplicate PRs. The discussion can be held by creating an issue and to conclude the next step.
We can introduce a basic PR template that will prompt the contributors to answer some questions or read some information before they create the PR.
This will be very helpful to ask them to follow some guidelines without any manual effort. One good example is to "ask them if there are any issue created?" If not, they should create first.
We can discuss more on what guidelines to set in PR template by creating an issue for this topic.
It will be really good if there is a codeowners
file setup for this project. There are several advantages:
We can protect the main branch with different cases but what I feel currently we need is to make it mandatory that each PRs before merge should be approved by at least one core maintainers (currently anyone can approve). Although the merge is only done by the core maintainers it should be mandatory.
Please feel free to add your thoughts about the above ideas.
The current streamlit interface deals with code and name separately, which I believe is a bit clumsy.
I request these changes -
No response
No response
None
To Reproduce the issue take below Data:
schools_grade12_2081.tsv
scode count name-address lat long
27101 600 काठमाण्डौ मोडेल मा.वि., वागवजार 45.77476723 85.27076582
27007 1700 ट्रिनीटी इन्टरनेशनल मा.वि., डिल्लीबजार 45.77476723 85.27076582
27045 1278 साउथ वेस्टर्न स्टेट मा.वि., बसुन्धारा 27.73966002 85.32545325
27127 1210 क्यापिटल मा.वि., कोटेश्वर 27.67354169 85.34490138
27011 1166 विश्व निकेतन मा.वि., त्रिपुरेश्वर 27.67354169 85.27076582
centres_grade12_2081.tsv:
cscode capacity name address नाम ठेगाना lat long
27003 5000 NATIONAL SCHOOL OF SCIENCES SECONDARY SCHOOL LAINCHAUR नेशनल स्कुल अफ साइन्सेस मा.वि लैनचौर 27.78577775 85.27276585
27051 5000 UNIGLOBE MA VI KAMALADI युनिग्लोब मा.वि कमलादी 27.78577775 85.27176585
27045 5680 SOUTH WESTERN ACADEMY SECONDARY SCHOOL BASUNDHARA साउथ वेर्ष्टन एकेडेमी मा.वि. बसुन्धरा 27.78577775 85.27276585
27075 5000 SIGMA SECONDARY SCHOOL SORAKHUTTE सिग्मा मा.वि. सोह्रखुट्टे 27.71854977 85.27276585
27115 382 NABODIT BIDHYAKUNJA SECONDARY SCHOOL MHEPI SAMAKHUSI नवोदीत विद्याकुञ्ज मा.वि म्हैपी सामाखुसी 27.78577775 85.27276585
prefs.tsv:
scode cscode pref reason
27001 27999 -5 same management
27999 27001 -5 same management
27990 27992 -5 problematic history
27998 27997 1 community school
Output:
school-centre.tsv:
scode school cscode center center_address center_lat center_long allocation distance_km
27127 क्यापिटल मा.वि., कोटेश्वर 27075 SIGMA SECONDARY SCHOOL SORAKHUTTE 27.71854977 85.27276585 1210 8.688293003084407
27045 साउथ वेस्टर्न स्टेट मा.वि., बसुन्धारा 27075 SIGMA SECONDARY SCHOOL SORAKHUTTE 27.71854977 85.27276585 1278 5.692288518271926
27011 विश्व निकेतन मा.वि., त्रिपुरेश्वर 27075 SIGMA SECONDARY SCHOOL SORAKHUTTE 27.71854977 85.27276585 1166 5.008542496281751
27101 काठमाण्डौ मोडेल मा.वि., वागवजार 27051 UNIGLOBE MA VI KAMALADI 27.78577775 85.27176585 600 2000.2843675772574
27007 ट्रिनीटी इन्टरनेशनल मा.वि., डिल्लीबजार 27051 UNIGLOBE MA VI KAMALADI 27.78577775 85.27176585 1700 2000.2843675772574
school-center-distance.tsv:
scode s_count school_name school_lat school_long cscode center_name center_address center_capacity distance_km
27127 1210 क्यापिटल मा.वि., कोटेश्वर 27.67354169 85.34490138 27075 SIGMA SECONDARY SCHOOL SORAKHUTTE 5000 8.688293003084407
27045 1278 साउथ वेस्टर्न स्टेट मा.वि., बसुन्धारा 27.73966002 85.32545325 27075 SIGMA SECONDARY SCHOOL SORAKHUTTE 5000 5.692288518271926
27011 1166 विश्व निकेतन मा.वि., त्रिपुरेश्वर 27.67354169 85.27076582 27075 SIGMA SECONDARY SCHOOL SORAKHUTTE 5000 5.008542496281751
27101 600 काठमाण्डौ मोडेल मा.वि., वागवजार 45.77476723 85.27076582 27051 UNIGLOBE MA VI KAMALADI 5000 2000.2843675772574
27007 1700 ट्रिनीटी इन्टरनेशनल मा.वि., डिल्लीबजार 45.77476723 85.27076582 27051 UNIGLOBE MA VI KAMALADI 5000 2000.2843675772574
So, if we notice the distance_km field of the output tables then we can see that it is allowing to allocate centers even if the distance between school and center is greater than ABS_DISTANCE_THRESHOLD and even more greater if we also take Stretch factor to account.
It should not allow the distance greater than the absolute Distance Threshold + STRETCH_CAPACITY_FACTOR.
No response
No response
None
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.