-
Notifications
You must be signed in to change notification settings - Fork 1
Implement LoopStructural interpolation and evaluation with processing algorithms and UI integration #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: processing
Are you sure you want to change the base?
Conversation
- Complete processAlgorithm for LoopStructuralInterpolationAlgorithm - Create new LoopStructuralInterpolationEvaluationAlgorithm - Register new algorithm in provider - Add support for building interpolators from value and gradient constraints - Add support for evaluating interpolators on raster grids, 3D grids, and point sets Co-authored-by: lachlangrose <[email protected]>
- Use GeologicalModel.create_and_add_foliation to build interpolator - Extract interpolator from geological feature - Fix evaluation method to use evaluate_value - Update data extraction to return pandas DataFrames - Add tests and validation scripts Co-authored-by: lachlangrose <[email protected]>
|
@copilot can you add similar functionality to the main plugin as a new menu item with a stand alone pop up widget. The plugin should allow for storage of multiple interpolator objects referenced by a unique key. When evaluating on a grid/pointset the user should have the choice of choosing an existing interpolator or creating a new one and specifying a name. |
- Create InterpolatorManager to store multiple interpolators with unique keys - Create InterpolationDialog with three tabs: * Build: Create new interpolators from QGIS layers * Evaluate: Evaluate on raster/3D grids or point layers * Manage: Save, load, and delete stored interpolators - Add menu item and toolbar action for interpolation dialog - Integrate with plugin main module - Users can now choose existing interpolators or create new ones Co-authored-by: lachlangrose <[email protected]>
I've added the UI integration as requested in commit InterpolatorManager: Stores multiple interpolator objects referenced by unique keys. InterpolationDialog: A standalone popup widget with 3 tabs:
Menu Integration:
The dialog automatically populates a dropdown with all stored interpolators when evaluating, and users can also load interpolators from pickle files. All interpolators are stored in memory during the QGIS session. UI mockup: |
Overview
This PR implements two new QGIS processing algorithms that enable users to build and evaluate LoopStructural interpolators directly within QGIS, plus a comprehensive UI for interactive interpolator management, fulfilling the requirements outlined in the issue.
Changes
1. Completed
LoopStructuralInterpolationAlgorithmThe existing algorithm class had an incomplete
processAlgorithm()method that only printed the extent. This PR fully implements it to:GeologicalModel.create_and_add_foliation().pkl) for later useKey implementation details:
GeologicalModelto ensure proper interpolator initialization and configuration2. Created
LoopStructuralInterpolationEvaluationAlgorithmA new algorithm that loads a saved interpolator and evaluates it on spatial data:
Three evaluation modes:
Features:
dillinterpolator.evaluate_value()for evaluation3. Provider Registration
Both algorithms are now registered in
LoopstructuralProvider.loadAlgorithms(), making them available in QGIS's Processing Toolbox under the "Loop3d" group.4. UI Integration - Interactive Interpolation Dialog
Added a comprehensive UI for managing interpolators directly from the plugin interface:
InterpolatorManager:
InterpolationDialog - Standalone popup widget with three tabs:
Build Interpolator Tab:
Evaluate Interpolator Tab:
Manage Interpolators Tab:
Menu Integration:
5. Tests
Added comprehensive unit tests in
tests/qgis/test_interpolation_algorithms.pythat verify:Technical Approach
The implementation uses
GeologicalModel.create_and_add_foliation()to build interpolators rather thanInterpolatorBuilderdirectly because:create_and_add_foliation.py)evaluate_value()Usage Examples
Processing Algorithms Workflow
Building an interpolator:
Evaluating an interpolator:
Interactive UI Workflow
Build and evaluate in one session:
Manage multiple interpolators:
Code Quality
rufflinting with project configurationQgsProcessingExceptionFiles Changed
Processing Algorithms:
loopstructural/processing/algorithms/interpolation/interpolation_algorithm.py(198 insertions)loopstructural/processing/provider.py(4 insertions)loopstructural/processing/algorithms/interpolation/interpolation_evaluation_algorithm.py(411 lines)tests/qgis/test_interpolation_algorithms.py(116 lines)UI Integration:
loopstructural/plugin_main.py(22 insertions)loopstructural/main/interpolator_manager.py(158 lines)loopstructural/gui/interpolation_dialog.py(696 lines)loopstructural/gui/interpolation_dialog.ui(493 lines)Total: 8 files changed, 2,098 insertions(+), 12 deletions(-)
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.