Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements Part 1 of a major refactor to support a plugin-based architecture in COMPASS. The changes establish groundwork for easier plugin support and schema-based extraction.
Changes:
- Introduces a new plugin system with base classes (
BaseExtractionPlugin,ExtractionPlugin) and interfaces for heuristics, text collectors, extractors, and parsers - Refactors existing extraction modules (solar, wind, small_wind, water) to use the new plugin architecture
- Moves
Jurisdictionclass fromcompass.utilities.locationtocompass.utilities.jurisdictionsand consolidates jurisdiction-related utilities - Adds
ExtractionContextclass to support multi-document extraction workflows - Extracts LLM cost computation logic into a dedicated
compass.utilities.costsmodule - Updates service layer to work with
ExtractionContextinstead of raw documents - Removes deprecated utility functions and consolidates common base classes
Reviewed changes
Copilot reviewed 58 out of 58 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
compass/plugin/ (new) |
Defines plugin base classes and interfaces for extraction workflows |
compass/extraction/context.py (new) |
Implements ExtractionContext for multi-document support |
compass/utilities/costs.py (new) |
Extracts cost computation utilities from main utilities module |
compass/utilities/jurisdictions.py |
Consolidates jurisdiction utilities (moved from location.py) |
compass/extraction/{solar,wind,small_wind,water}/ |
Refactored to use plugin architecture |
compass/services/threaded.py |
Updated to work with ExtractionContext |
tests/python/unit/ |
Migrated and added tests for new modules |
docs/source/conf.py |
Updated documentation references |
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (64.60%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #376 +/- ##
==========================================
+ Coverage 53.61% 56.67% +3.06%
==========================================
Files 49 55 +6
Lines 4695 4953 +258
Branches 416 431 +15
==========================================
+ Hits 2517 2807 +290
+ Misses 2149 2119 -30
+ Partials 29 27 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Set up a lot of groundwork to easier support plugins in COMPASS and ultimately get to a point where we can run extraction based on a schema alone.