Skip to content

AssertionError in border2average_correction #10

Description

@macraild

I've hit another AssertionError durring border correction. This time:

Traceback (most recent call last):
File "C:\Users\macraild\progs\peakonly\gui_utils\threading.py", line 72, in run
result = self.function(*self.args, **self.kwargs)
File "C:\Users\macraild\progs\peakonly\processing_utils\runner.py", line 147, in call
features = self._batch_run(files, progress_callback, operation_callback)
File "C:\Users\macraild\progs\peakonly\processing_utils\runner.py", line 261, in _batch_run
border_correction(component, borders)
File "C:\Users\macraild\progs\peakonly\processing_utils\run_utils.py", line 337, in border_correction
scan_borders[sample] = border2average_correction(scan_borders[sample], averaged_borders)
File "C:\Users\macraild\progs\peakonly\processing_utils\run_utils.py", line 223, in border2average_correction
assert added[i] != 1, '"many-to-many" case here must be impossible!'
AssertionError: "many-to-many" case here must be impossible!

I've spent some time trying to track this down, and can reproduce with the following:

from processing_utils.run_utils import border2average_correction
borders = [[231, 453], [460, 477]]
avg_borders = [[232, 325], [330, 333], [333, 476]]
border2average_correction(borders, avg_borders)

I'm keen to help find fixes for this and the similar (but perhaps unrelated?) #7 but I'm struggling to grok the logic of these functions. Any help to understand the intent of the border correction algorithm or pointers to where fixes might lie would be very welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions