Refactor package - #31
Open
nreinicke wants to merge 15 commits into
Open
Conversation
added 4 commits
May 27, 2026 10:52
- update lab name - make requests optional - remove setup.py
- Add savgol filter implementation and drop scipy - add grade/elevation filter abstractions - drop strict pandas dep - clean up top level imports
- only do elevation filtering - make bridge filter more robust and operate on elevation data - pass in elevation model directly instead of soruce and elevation model - add plotting utilities
There was a problem hiding this comment.
Pull request overview
Refactors GradeIT into a lighter, pandas-optional core API that returns a structured GradeResult, adds optional folium-based interactive plotting, and reorganizes filtering/elevation logic into clearer modules.
Changes:
- Replaced the old DataFrame-mutating
gradeit/gradeit.pyAPI with a new orchestrator ingradeit/core.pyreturningGradeResultand supporting flexible coordinate inputs. - Introduced optional-dependency features (
pandas,plot) and lazy imports to keepimport gradeitcheap. - Added substantial unit test coverage for IO coercion, filtering behavior, plotting, and import surface guarantees.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_plotting.py | New tests for folium plotting layers, error paths, and tooltip content. |
| tests/test_io.py | New tests for to_coordinates() coercion and GradeResult export helpers. |
| tests/test_imports.py | Ensures top-level import surface works and avoids eager heavy imports. |
| tests/test_gradeit.py | End-to-end tests for new gradeit() core API, filtering semantics, and input immutability. |
| tests/test_filtering.py | Tests Savitzky-Golay primitive and filter behavior (optionally validated vs SciPy). |
| tests/test_bridge_filter.py | Extensive tests for new BridgeFilter detection/correction behavior. |
| setup.py | Removed legacy setup.py stub (pyproject-based packaging). |
| README.md | Updated usage docs, extras installation, filtering pipeline, and plotting docs. |
| pyproject.toml | Made pandas/folium optional extras; updated metadata and pixi env features. |
| pixi.lock | Lockfile updated to reflect dependency graph changes and new extras/dev deps. |
| LICENSE | Updated copyright line. |
| gradeit/plotting.py | New plot_grade_map() implementation using folium with raw/filtered layering. |
| gradeit/io.py | New to_coordinates() + GradeResult container with lazy pandas/folium helpers. |
| gradeit/gradeit.py | Removed old DataFrame-based gradeit() implementation. |
| gradeit/filters/savitzky_golay.py | Added pure-numpy Savitzky-Golay implementation + filter wrapper. |
| gradeit/filters/elevation_filter.py | Introduced ElevationFilter abstraction. |
| gradeit/filters/bridge.py | Added BridgeFilter implementation for bridge/overpass DEM dip correction. |
| gradeit/filters/init.py | Exposed filter public surface. |
| gradeit/filter_bridge.py | Removed legacy bridge filtering implementation. |
| gradeit/exceptions.py | New package exception hierarchy for consistent error handling. |
| gradeit/elevation/usgs_api.py | Made requests import lazy and introduced gradeit-specific error types. |
| gradeit/elevation/filtering.py | Removed legacy SciPy-based filtering module. |
| gradeit/elevation/init.py | New elevation module public surface exports. |
| gradeit/core.py | New primary gradeit() orchestration with model injection + filter pipeline. |
| gradeit/init.py | Curated top-level public API surface (models, filters, result type, plotting). |
| examples/basic.py | Updated example to new API, optional filtering pipeline, and plotting output. |
| CLAUDE.md | Added architecture documentation describing the refactor and new API surface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 10 commits
August 14, 2026 13:32
Collaborator
Author
|
@jakeholden @jhoshiko If you have a chance I would really appreciate your eyes on these updates, especially the new documentation, see: |
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
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.
Refactors the package and adds real documentation.
Wood2014that is based on the paper: https://docs.nlr.gov/docs/fy14osti/61109.pdf. This approach has been tested against high quality TomTom grade data and performs better than the previous default method.