Repository navigation
Swap out interface for MNeuEventLib - #19
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Callback contract mismatches and model synchronization defects break loading, saving and filter editing.
Review effort: Balanced
Findings: 5
Open (21)
Fix prevent_initial_call spelling · New Align filter load callback and handler outputs · New Remove obsolete state arguments from save callbacks · New Use assertCountEqual for dictionary row comparisons · New Restore synthetic time ranges in unit tests · New Guard amplitude edits before data is loaded · New Distinguish empty retained ranges from no filters · New Avoid showing file details before data is loaded · New Validate settings before Calculate and Save · New Guard histogram edits before data is loaded · New Avoid duplicate generated log filter names · New Use old filter name when renaming log filters · New Preserve above and below log filter modes · New Recalculate and handle errors before saving · New Handle failed loads without corrupting cached state · New Refresh controls when loading a new dataset · New Unify cell validation and model editing · New Guard mode changes before data is loaded · New Avoid duplicate generated time filter names · New Use old filter name when renaming time filters · New
And 1 more that still need to be addressed.
What changed in this PR
Migrates the GUI from MuonDataLib to MNeuEventLib, making BatchData the shared model for filtering, plotting and saving.
Changes:
- Updates presenters and callbacks to read and modify
BatchData. - Adapts tests and fixtures to the new backend.
- Updates dependencies, documentation and application naming.
| File | Description |
|---|---|
| tests/time/time_presenter_test.py | Tests model-backed time filters. |
| tests/table/table_presenter_test.py | Updates table presenter expectations. |
| tests/table/table_group_test.py | Reformats imports. |
| tests/table/table_col_test.py | Cleans imports and redundant statements. |
| tests/table/column_test.py | Reorders imports. |
| tests/system_tests/load_and_save_test.py | Uses unprefixed file paths. |
| tests/save_bar/save_bar_presenter_test.py | Adjusts import spacing. |
| tests/plot_area/plot_area_presenter_test.py | Uses dictionary-based sample logs. |
| tests/main_app/main_app_presenter_test.py | Adapts loading and saving tests. |
| tests/log/log_presenter_test.py | Tests model-backed log filters. |
| tests/load_bar/load_bar_presenter_test.py | Verifies BatchData loading. |
| tests/histogram_settings/hist_settings_presenter_test.py | Adjusts spacing. |
| tests/filters/filters_presenter_test.py | Tests backend-driven filtering. |
| tests/data_paths.py | Simplifies fixture paths. |
| tests/data_files/README.md | Updates fixture documentation. |
| tests/data_files/filters.py | Creates BatchData filter fixtures. |
| tests/data_files/add_selog_groups.py | Adds a synthetic-log utility. |
| tests/control_pane/control_pane_presenter_test.py | Updates plotting and shading tests. |
| tests/conftest.py | Generates filter JSON through BatchData. |
| src/MNeuEventGUI/utils/main_window.py | Returns unprefixed selected paths. |
| src/MNeuEventGUI/time/view.py | Reworks time-mode callbacks. |
| src/MNeuEventGUI/time/presenter.py | Moves time-filter edits into BatchData. |
| src/MNeuEventGUI/test_helpers/unit_test.py | Adds unordered-content assertions. |
| src/MNeuEventGUI/table/view.py | Adds model-edit callbacks. |
| src/MNeuEventGUI/table/presenter.py | Revises table mutation interfaces. |
| src/MNeuEventGUI/plot_area/presenter.py | Accepts dictionary-based logs. |
| src/MNeuEventGUI/main_app/view.py | Updates branding and callback outputs. |
| src/MNeuEventGUI/main_app/presenter.py | Migrates loading and saving interfaces. |
| src/MNeuEventGUI/log/presenter.py | Moves log-filter edits into BatchData. |
| src/MNeuEventGUI/load_bar/view.py | Removes the filename prefix. |
| src/MNeuEventGUI/load_bar/presenter.py | Loads files as BatchData. |
| src/MNeuEventGUI/histogram_settings/view.py | Connects settings edits to the model. |
| src/MNeuEventGUI/histogram_settings/presenter.py | Adds model-setting methods. |
| src/MNeuEventGUI/help.py | Removes the legacy help launcher. |
| src/MNeuEventGUI/filters/view.py | Simplifies calculation inputs. |
| src/MNeuEventGUI/filters/presenter.py | Uses the shared filtering model. |
| src/MNeuEventGUI/control_pane/view.py | Updates plot triggers. |
| src/MNeuEventGUI/control_pane/presenter.py | Uses backend filter ranges. |
| src/MNeuEventGUI/amp/view.py | Adds amplitude-edit callbacks. |
| src/MNeuEventGUI/amp/presenter.py | Adapts amplitude filtering and plotting. |
| README.md | Updates project status and origins. |
| pyproject.toml | Replaces the backend dependency. |
| MNeuEventGUI-dev.yml | Adds a development environment. |
| launch_GUI.py | Removes comment whitespace. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
9cff6d4 to
45acff8
Compare
| from MNeuEventGUI.plot_area.presenter import PlotAreaPresenter | ||
| from MNeuEventGUI.table.presenter import PresenterTemplate | ||
|
|
||
| BASELINE = 18446744073709551615 |
| and self._hist_data.min_time == min_time | ||
| and self._hist_data.max_time == max_time | ||
| and self._hist_data.num_bins == num_bins) | ||
| and hist_settings["min_time"] / 1e3 == min_time |
| log = self._log._logs.get_sample_log(row_log['sample_log-table']) | ||
| _, _ = log.get_original_values() | ||
| # not quite sure why we're getting the log. but this was there before | ||
| _ = self._data.dataset.get_sample_log(row_log['sample_log-table']) |
There was a problem hiding this comment.
I think we can delete it. I suspect its something that never got cleaned up from a previous implementation.
| def model(self): | ||
| """ | ||
| The part of the Data object that this is a view of. | ||
| """ |
There was a problem hiding this comment.
this does not have a return value
Co-authored-by: Anthony <anthony.lim@stfc.ac.uk>
AnthonyLim23
left a comment
There was a problem hiding this comment.
Some of the errors are not reported correctly but they are fixed in #20


This PR replaces the MuonDataLib interface with MNeuEventLib. All of the tests pass (removed lots of tests that are no longer relevant). Note that this requires the backend as of ISISMuon/MNeuEventLib#121.
Fixes #1, fixes #3, fixes #18
In the process, it simplifies the code by making the model for the GUI consistently the
BatchDataobject: e.g. for filteringOld MuonDataLib
flowchart LR A[Table view] --edit--> B[Internal table object data] B --"on calculate"--> C[MuonData object] D[saved filters] --load--> ANew MNeuEventGUI
flowchart LR A[Table view] --edit--> C[BatchData object] C --update--> B[internal table object data] B --> A D[saved filters] --load--> Ci.e. when the view is edited, it directly updates the
BatchDataobject, and then the table data is refreshed to match theBatchDataobject, soBatchDatais now a single point of truth for the whole GUI.