Giter Site home page Giter Site logo

center-randomize's People

Contributors

0xsolidityweb3 avatar abhishakedahal avatar abiskar-timsina avatar basic-bgnr avatar dhirajraut1 avatar horrormyth avatar luluw8071 avatar manisha841 avatar nirmala-sharma avatar padam-ghimire avatar rupesharyal avatar samurato avatar sebakthapa avatar sulochanapradhan avatar sumanashrestha avatar trishan9 avatar urs-santoshh avatar yubinkarki avatar yunik2code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

center-randomize's Issues

Interested to develop Mobile App

🔖 Feature description

If we can provide full functionality in mobile applications, it would be great for the students and parents.

Describe alternatives you've considered

No response

Additional context

No response

Acknowledgements

  • My issue title is clear and descriptive.
  • I have checked existing issues to ensure this feature is not requested yet.
  • I have provided sufficient details for maintainers to understand and assess this request.

Would you like to work on this issue?

Yes

[TODO] avoid allotting small number of students last center

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

[TODO] visualization from output

A dashboard which plots schools and center on a map.

  • Allow selecting / searching for a SCHOOL and show all the allotted centers. In both map as well as tabular format with some descriptive stats
  • Allow selecting / searching for a CENTER and show all the schools whose students are allotted there. In both map as well as tabular format with some descriptive stats

image

Preferred solution:

  • HTML with client side JS which can be hosted statically
  • Free and publicly hosted BI

Adopting Poetry or Rye for Dependency Management

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.

[LOGIC_IMPROVEMENT] Handle no centers are within the absolute distance threshold

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

Add support for GitHub tool

Summary

AI expert

To assist contributors, where contributors can search, navigate, and understand Center-randomize's source code using Onboard AI's free tool LearnThisRepo

[TODO] Test cases

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.

Title: Improve Project Structure and Architectural Pattern for Maintainability

Folder Structure Enhancement:

  1. Create a structured folder hierarchy, separating input/output data & source code
  2. Organize input/output data files in a dedicated data/ directory, with subdirectories for input and output files.
  3. Move source code files into a src/ directory, with further categorization into modules for future maintainability
  4. Add tests folder for the unit testing the code.

Architectural Pattern Adoption:

  1. Define modules representing the Model (data/business logic), View (presentation layer), and Controller (intermediary logic) components.
  2. Ensure clear communication and interaction between different components to facilitate maintainability and scalability.

[BugReport] output directory generation not working as expected.

https://github.com/moest-np/center-randomize/blob/607f3db84e5e589f49cf8c9cb165dfa24c0e0b32/school_center.py#L163C44-L163C53

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'

Nitpick: possible typo in the description

Summary

Really happy to see this repo! I found a small quality issue in the repository's description.

Should it read: "Script to ..." instead of "Script is to ..."?

Screenshots (optional)

image

Great effort! Here are some edge cases you might need to consider in future.

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.

  1. 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?

  2. 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.

  3. Not sure if its possible for students to be not from any school(eg: homeschool). In which case they might need special center allocation.

  4. Centers assignment for students with special needs might need to be handled separately.

Auto rerun if all students are not allocated

Summary

On the readme file it says

Run the program and re-run if

  • Any school has students who have not been assigned a center.

This feels very weird.

It would be very userfriendly if all the students are allocated on the single go.

Proposed solution

Keep the list of students that are not allocated and try allocating them if they are not allocated at the end of the run.

Schools are not plotted in map in streamlit app

Description

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.

Steps to reproduce

Run the streamlit app, select a school or center, observe only centers are plotted, not the selected entity

Describe what you expected to happen.

Schools should also be plotted in a different colored marker.
similar to what @RupeshAryal had demoed in this comment

Additionally -

  • make the list serial number start from 1
  • remove thousand separator in scode / cscode
  • personal opinion - markers used by in demo above looks better

Put here any screenshots or videos (optional)

When school is selected, it is not plotted
image

When center is selected, it is the only thing plotted.
image

Environment

Linux
python 3.11.9
Firefox 125

Would you like to work on this issue?

None

Acknowledgements

  • My issue title is concise, descriptive.
  • I searched the existing issues to ensure this bug hasn't been reported.
  • I am using the latest version of repo.
  • I have provided enough information for the maintainers to reproduce and diagnose the issue.

[DISCUSSION] Standardize the contributions

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:

  1. Issue creation should be mandatory
  2. PR template
  3. Define codeowners
  4. Branch protections

Issue creation should be mandatory

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.

PR template

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.

Define codeowners

It will be really good if there is a codeowners file setup for this project. There are several advantages:

  • Everyone is aware of the core contributors so that they can be tagged in multiple discussions for clarify.
  • Every PRs opened will be assigned to them as the reviewers.
  • They get the notification to review the new PRs.

Branch protections

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.

School / Center searchable by name or code in single dropdown

🔖 Feature description

The current streamlit interface deals with code and name separately, which I believe is a bit clumsy.
I request these changes -

  • Instead of four radio buttons options scode | school | cscode | center, could we just keep two school | center and show the code along side the school/center name.
  • Also make it searchable by both name and code.
  • Use horizontal layout for radio options for efficient use of screen space
  • Do not use thousand separator comma (27,056) in scode / cscode

image

Describe alternatives you've considered

No response

Additional context

No response

Acknowledgements

  • My issue title is clear and descriptive.
  • I have checked existing issues to ensure this feature is not requested yet.
  • I have provided sufficient details for maintainers to understand and assess this request.

Would you like to work on this issue?

None

Allocating Centres even if distance is greater than ABS_DISTANCE_THRESHOLD and even more greater if we also take Stretch factor to account.

Steps to reproduce

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.

Describe what you expected to happen.

It should not allow the distance greater than the absolute Distance Threshold + STRETCH_CAPACITY_FACTOR.

Put here any screenshots or videos (optional)

No response

Environment

No response

Would you like to work on this issue?

None

Acknowledgements

  • My issue title is concise, descriptive.
  • I searched the existing issues to ensure this bug hasn't been reported.
  • I am using the latest version of repo.
  • I have provided enough information for the maintainers to reproduce and diagnose the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.