Skip to content

Conversation

@lachlangrose
Copy link
Member

No description provided.

Copilot AI and others added 23 commits December 16, 2025 22:46
Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a comprehensive upgrade to the fault feature panel and debugging capabilities for the LoopStructural QGIS plugin. The changes add debug directory management, parameter logging for map2loop tools, and UI improvements to enable interactive fault parameter editing with live model updates.

Changes:

  • Added debug manager infrastructure with configurable debug directory and automatic logging/export of tool parameters and layers
  • Implemented Observable pattern for model updates and added debounced rebuilds for interactive fault parameter editing
  • Enhanced map2loop tool dialogs to accept and use debug_manager for parameter logging and layer export

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 63 comments.

Show a summary per file
File Description
loopstructural/debug_manager.py New debug manager with session directories, parameter logging, and layer export
loopstructural/toolbelt/preferences.py Added debug_directory setting and logging configuration
loopstructural/main/model_manager.py Converted to Observable, added notification suspension and feature update methods
loopstructural/gui/dlg_settings.py Added debug directory UI controls
loopstructural/plugin_main.py Integrated debug_manager and added fault topology action
loopstructural/main/m2l_api.py Added debug_manager parameter to map2loop API functions
loopstructural/gui/modelling/geological_model_tab/feature_details_panel.py Implemented debounced rebuilds and fault parameter controls
loopstructural/gui/visualisation/feature_list_widget.py Added model update observers and surface re-rendering
loopstructural/gui/map2loop_tools/*.py Added debug manager integration to all map2loop tool widgets
loopstructural/main/debug/export.py New debug package export utility
tests/qgis/test_plg_preferences.py Added tests for debug_directory setting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 17 to 18
from loopstructural.main.debug import export

Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Unused import. The 'export' module is imported but never used. Remove this import or use the export functionality.

Suggested change
from loopstructural.main.debug import export

Copilot uses AI. Check for mistakes.
if unit_name_field and unit_name_field != 'UNITNAME' and unit_name_field in geology_gdf.columns:
if (
unit_name_field
and unit_name_field != unit_name_field
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The condition 'unit_name_field != unit_name_field' is always False. This appears to be a copy-paste error and will cause the code block to never execute. This condition should likely compare unit_name_field against 'UNITNAME' or another constant.

Suggested change
and unit_name_field != unit_name_field

Copilot uses AI. Check for mistakes.
payload = params if params is not None else self.get_parameters()
payload = self._serialize_params_for_logging(payload, context_label)
self._debug.log_params(context_label=context_label, params=payload)
except Exception:
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
if getattr(self, "_debug", None):
try:
self._debug.log_params(context_label=context_label, params=params)
except Exception:
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
logger.debug(f"Removed existing mesh: {mesh_name}")
except Exception:
logger.debug(f"Failed to remove existing mesh: {mesh_name}")
pass
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Unnecessary 'pass' statement.

Copilot uses AI. Check for mistakes.
except Exception as e:
print("Failed to save sampler debug info")
print(e)
pass
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Unnecessary 'pass' statement.

Copilot uses AI. Check for mistakes.
@lachlangrose lachlangrose merged commit 1fb1539 into dev-0.1.12 Jan 14, 2026
1 check passed
@lachlangrose lachlangrose deleted the fault-feature-panel-upgrade branch January 14, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request quality UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants