Repository navigation
fix(eic): regenerate deleted compounds and samples on a mass tolerance change - #306
Merged
Merged
Conversation
…e change A tolerance change rebuilt EICs for active compounds and samples only, after deleting every EIC of each active sample. A compound restored afterwards had no EICs, and a restored sample kept old-tolerance EICs. The reload and its correction pass now include soft-deleted rows, so a restore needs no extra work. Fixes #168.
Collaborator
Author
|
Review verdict for head 8310f64: CLEAN. Reviewed by GPT-6.1 Sol. What Sol ran:
What it found:
Nothing was fixed in review. Note for merging with #305: a deleted sample that rebuilds makes |
This was referenced Nov 10, 2026
…s-get-current-eics # Conflicts: # src/manic/io/eic_importer.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #168. Re-applies #214 onto
mainafter the UI redesign.The bug
A mass tolerance change rebuilt EICs for active compounds and active samples only. It first deleted every EIC of each active sample. A compound deleted before the change and restored after it had no EICs, so no plot and nothing to export. A sample restored after the change kept EICs built at the old tolerance.
The fix
The reload now includes soft-deleted compounds and samples, and so does the natural isotope correction pass that follows it. Restoring an item then only flips its deleted flag, as before, and its EICs are already current.
_iter_compoundstakesinclude_deleted. Only the reload passes it, so the first import is unchanged.regenerate_all_eics_with_mass_toleranceselects all samples and compounds, and its progress total counts them.process_all_correctionscorrects deleted compounds too. Without this, a restored compound's corrected EICs fall back to raw values.Exports and the data provider already filter
deleted = 0, so the extra rows stay hidden until a restore. A deleted sample whose CDF cannot be read takes the existing path from #278: it keeps its old EICs and is named in the warning.I chose this over regenerating on restore. That would need a worker, a progress dialog and error handling in both recovery dialogs and in session import, and a restored compound would re-read every CDF.
The user guide gains two sentences under Recovering Deleted Items.
Checks
{'s2': [1.0, 1.0, 1.0]} != {'s1': [11.0, ...], 's2': [11.0, ...]}. Without only the correction change, corrected values are11.0instead of12.9016. It passes with the change.uv run python -m pytest -q: 672 passed.bench/reference.py check: exported results unchanged.Left out
MassToleranceReloadWorkerdirectly rather than throughMainWindow.apply_mass_tolerance.