forked from Global-Opportunity-Lab/cider
-
Notifications
You must be signed in to change notification settings - Fork 1
Fix home locations module #28
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
Open
poornimaramesh
wants to merge
14
commits into
main
Choose a base branch
from
fix-home-locations-module
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lickem22
reviewed
Nov 5, 2025
Collaborator
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.
Why this?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reviewer: @lickem22
Estimate: ~30 mins
Ticket
Fixes: Issue 26
Some notes on installation before you begin testing the repo:
Package installation: I have switched to uv, and made a minimal list of packages (i.e. skipping auto-sklearn and other problematic packages). This means that install should happen smoothly without dependency issues BUT I cannot guarantee that the files NOT touched by this PR work as expected.
Spark installation: On Mac, I needed to do a few additional steps to get Spark (for parallelized dataframe operations) to work:
a.
brew install openjdk@17b.
export JAVA_HOME="$(/usr/libexec/java_home)" && export PATH="$JAVA_HOME/bin:$PATH"Description
Re-implement homelocations module to make it more lightweight
Changes
Made a new
homelocation/folder that reimplements everything incider/home_location.pyschemas.pyadds schemas to enforce structure for the data required for home location inference. These functions are originally captured by functions incider/data_checker.pycider/datastore.py,cider/data_format/data_format.ymlandconfigs/config*.ymlinference.pyimplements the actual inference algorithms inhome_locations.py(HomeLocator.get_home_locationsandHomeLocator.accuracy)plotting.pyre-implements a less fancy version ofHomeLocator.mapdependencies.pyreimplementshelpers.plot_utils.voronoi_tesellation-- this was a wrong turn I took ( I thought I would need this for making maps / plots, but decided not to use it because Voronoi tessellations are only used to plot population maps)Added tests for all the implemented functions
Moved
notebooks->old_notebooks; added new notebook for testing tonotebooksFuture Tasks:
cider/homelocation/andtests/modules are properly lintedHow has this been tested?
pytest tests/test_homelocation.pyfrom the root of the reponotebooks/homelocation.ipynband check everything works (variations for homelocation inference are thoroughly tested with the tests/; the notebook simply demonstrates a pipeline and comparison with the old way of doing things).To-do before merge
Checklist
Fill with
xfor completed.pre-commithooks locally.github/workflows/