Skip to content

ENH: Time based kernel gwlearn#874

Open
FirePheonix wants to merge 4 commits into
pysal:mainfrom
FirePheonix:time-based-kernel-gwlearn
Open

ENH: Time based kernel gwlearn#874
FirePheonix wants to merge 4 commits into
pysal:mainfrom
FirePheonix:time-based-kernel-gwlearn

Conversation

@FirePheonix

@FirePheonix FirePheonix commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

Hello! Please make sure to check all these boxes before submitting a Pull Request
(PR). Once you have checked the boxes, feel free to remove all text except the
justification in point 5.

  1. You have run tests on this submission locally using pytest on your changes. Continuous integration will be run on all PRs with GitHub Actions, but it is good practice to test changes locally prior to a making a PR.
  2. This pull request is directed to the pysal/master branch.
  3. This pull introduces new functionality covered by
    docstrings and
    unittests?
  4. You have assigned a
    reviewer
    and added relevant labels

@codecov

codecov Bot commented Feb 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.67442% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.6%. Comparing base (825fe7f) to head (44875d0).
⚠️ Report is 61 commits behind head on main.

Files with missing lines Patch % Lines
libpysal/weights/set_operations.py 83.3% 1 Missing ⚠️
libpysal/weights/util.py 92.9% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #874   +/-   ##
=====================================
  Coverage   85.5%   85.6%           
=====================================
  Files        151     152    +1     
  Lines      16119   16172   +53     
=====================================
+ Hits       13785   13836   +51     
- Misses      2334    2336    +2     
Files with missing lines Coverage Δ
libpysal/graph/base.py 96.7% <100.0%> (+0.1%) ⬆️
libpysal/graph/tests/test_spatiotemporal.py 100.0% <100.0%> (ø)
libpysal/io/iohandlers/arcgis_dbf.py 87.8% <100.0%> (+0.2%) ⬆️
libpysal/weights/weights.py 93.3% <100.0%> (+<0.1%) ⬆️
libpysal/weights/set_operations.py 60.2% <83.3%> (+1.0%) ⬆️
libpysal/weights/util.py 78.4% <92.9%> (+0.3%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@FirePheonix

Copy link
Copy Markdown
Contributor Author
  1. i'm currently getting in some circular import errors, whilst fixing those, it's causing ruff's NOT IMPORTED on top error.
  2. main branch is 2 commits behind.

lemme fix these first.. rest all tests are passing.

@FirePheonix FirePheonix changed the title Time based kernel gwlearn ENH: Time based kernel gwlearn Feb 21, 2026
@FirePheonix FirePheonix force-pushed the time-based-kernel-gwlearn branch from aa7c65e to 3a928eb Compare February 22, 2026 05:16
@FirePheonix FirePheonix force-pushed the time-based-kernel-gwlearn branch from 3a928eb to dcf7e13 Compare February 22, 2026 05:23
@FirePheonix

FirePheonix commented Feb 22, 2026

Copy link
Copy Markdown
Contributor Author

will switch to a method of Graph.build_spatiotemporal() in next commit, since as suggested, the scale_by_kernel method seemed unintuitive.
rest mathematics and pre-commit + circular errors are now sorted..

@FirePheonix

FirePheonix commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

Newer implementation:

Low-level:

st_graph = temporal_g.multiply(spatial_g)

High-level:

st_graph = Graph.build_spatiotemporal(gdf, t=t, spatial_bandwidth=500, temporal_bandwidth=365)

This build a spatiotemporal graph with:
neighbors that are close in space AND time get high weight.
Close in space but far in time -> low weight.

@martinfleis

Copy link
Copy Markdown
Member

Stuff like this requires API discussion and agreement in an issue before PR. While there is an issue, there's no discussion nor agreement in there.

@FirePheonix

Copy link
Copy Markdown
Contributor Author

Ah, I'm sorry, I misinterpreted it as being ready for a PR.
My bad for the confusion

Let's move this discussion over to that issue if you please?

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.

ENH: Method for building Spatiotemporal Graphs

2 participants