Skip to content

Implement SIP#321

Open
DPnimo11 wants to merge 24 commits into
mainfrom
darren-contact-sip
Open

Implement SIP#321
DPnimo11 wants to merge 24 commits into
mainfrom
darren-contact-sip

Conversation

@DPnimo11

Copy link
Copy Markdown

Adds contact-based SIP MVP:

  • Estimate undirected contacts from stop tables using exact location_id or radius distance
  • Compute contact weights using duration or linear distance decay
  • Aggregate contacts into user-level SIP
  • Add unit tests for overlap timing, duration-derived end times, missing locations, distance weighting, and custom SIP weights

@DPnimo11 DPnimo11 added this to the SICC 2026 Codebase milestone Jun 16, 2026
@DPnimo11 DPnimo11 requested a review from paco-barreras June 16, 2026 17:01
@DPnimo11 DPnimo11 linked an issue Jun 16, 2026 that may be closed by this pull request
@DPnimo11 DPnimo11 self-assigned this Jun 16, 2026
Comment thread nomad/contact_estimation.py Outdated
+ np.cos(lat_1) * np.cos(lat_2) * np.sin(dlon / 2) ** 2
)
return 2 * _EARTH_RADIUS_M * np.arcsin(np.sqrt(a))
return np.linalg.norm(query_coords[stop_1] - query_coords[stop_2], axis=1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A function like this already exists in nomad/stop_detection/utils.py#L154 , something like temporal_blocking also exists, but I'm not super convinced it is necessary here.

Please integrate and avoid redundancy.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced _pair_distances with _haversine_distance. For temporal blocking, it's not strictly necessary, but I feel like it is still worth including as a performance upgrade; I saw speedup on the order of 10x when I tested on 500 users.

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.

Implementation and testing of Social Interaction Potential

2 participants