Skip to content

Swap out interface for MNeuEventLib - #19

Merged
AnthonyLim23 merged 28 commits into
mainfrom
swap-out-interface
Nov 16, 2026
Merged

AnthonyLim23 merged 28 commits into
mainfrom
swap-out-interface

Conversation

@alexhroom

@alexhroom alexhroom commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

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 BatchData object: e.g. for filtering

Old MuonDataLib

flowchart LR
    A[Table view] --edit--> B[Internal table object data]
    B --"on calculate"--> C[MuonData object]
    D[saved filters] --load--> A
Loading

New MNeuEventGUI

flowchart LR
    A[Table view] --edit--> C[BatchData object]
    C --update--> B[internal table object data]
    B --> A
    D[saved filters] --load--> C
Loading

i.e. when the view is edited, it directly updates the BatchData object, and then the table data is refreshed to match the BatchData object, so BatchData is now a single point of truth for the whole GUI.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Callback contract mismatches and model synchronization defects break loading, saving and filter editing.

Review effort: Balanced
Findings: 5 High severity · 16 Medium severity

Open (21)

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.

Comment thread src/MNeuEventGUI/amp/view.py Resolved
Comment thread src/MNeuEventGUI/main_app/view.py Resolved
Comment thread src/MNeuEventGUI/main_app/view.py Resolved
Comment thread tests/time/time_presenter_test.py Resolved
Comment thread src/MNeuEventGUI/table/view.py Resolved
Comment thread src/MNeuEventGUI/time/presenter.py Resolved
Comment thread src/MNeuEventGUI/time/presenter.py Resolved
Comment thread src/MNeuEventGUI/time/presenter.py Resolved
Comment thread src/MNeuEventGUI/time/view.py Resolved
from MNeuEventGUI.plot_area.presenter import PlotAreaPresenter
from MNeuEventGUI.table.presenter import PresenterTemplate

BASELINE = 18446744073709551615

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what is this number?

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

magic number

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'])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can delete it. I suspect its something that never got cleaned up from a previous implementation.

Comment thread src/MNeuEventGUI/main_app/presenter.py Resolved
Comment thread src/MNeuEventGUI/table/view.py Outdated
def model(self):
"""
The part of the Data object that this is a view of.
"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this does not have a return value

Comment thread src/MNeuEventGUI/time/presenter.py Resolved

@AnthonyLim23 AnthonyLim23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some of the errors are not reported correctly but they are fixed in #20

@AnthonyLim23
AnthonyLim23 merged commit 53a923b into main Nov 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make filter tables just a view Replace MuonDataLib with MNeuEventLib Migrate the GUI

3 participants