Skip to content

Conversation

@poornimaramesh
Copy link
Collaborator

@poornimaramesh poornimaramesh commented Nov 4, 2025

Reviewer: @lickem22
Estimate: ~30 mins


Ticket

Fixes: Issue 26

Some notes on installation before you begin testing the repo:

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

  2. 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@17
    b. 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 in cider/home_location.py

    • schemas.py adds schemas to enforce structure for the data required for home location inference. These functions are originally captured by functions in cider/data_checker.py cider/datastore.py, cider/data_format/data_format.yml and configs/config*.yml
    • inference.py implements the actual inference algorithms in home_locations.py (HomeLocator.get_home_locations and HomeLocator.accuracy)
    • plotting.py re-implements a less fancy version of HomeLocator.map
    • dependencies.py reimplements helpers.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 to notebooks

Future Tasks:

  • We might have to move the schemas to outside this module since CDR / Antennas get reused for other modules
  • We might also have to move some of the dependencies / plotting out of this module since they might get re-used
  • The linting GHA fails because the rest of the repo is not up-to-date, but the cider/homelocation/ and tests/ modules are properly linted
  • Need to add GHA for unit tests
  • Need to add Makefile config for tests, freshenv install, etc.

How has this been tested?

  • Run pytest tests/test_homelocation.py from the root of the repo
  • Run the notebook notebooks/homelocation.ipynb and 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

  • Remove all code related to the reimplemented functions here

Checklist

Fill with x for completed.

  • I have run pre-commit hooks locally
  • I have resolved merge conflicts
  • I have updated the automated tests (if applicable)
  • I have updated the requirements (if applicable)
  • I have updated the README file (if applicable)
  • I have updated affected documentation (if applicable)
  • I have updated the CI/CD scripts in .github/workflows/

Copy link
Collaborator

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reimplement minimal version of home locations functions

3 participants