Skip to content

Sort spectra before plotting - #75

Merged
kjohnsen merged 1 commit into
siplab-gt:masterfrom
viranovskaya:fix/65-sort-spectra
Sep 3, 2026
Merged

kjohnsen merged 1 commit into
siplab-gt:masterfrom
viranovskaya:fix/65-sort-spectra

Conversation

@viranovskaya

Copy link
Copy Markdown
Contributor

Closes #65.

plot_spectra() now sorts wavelength-value pairs before interpolation, using the same path as LightDependent.epsilon(). This allows edited spectra to be plotted when their samples are out of order without modifying the stored spectrum.

The regression test compares sorted and reversed inputs and checks that they produce the same plotted curve.

Tests:

  • pytest tests/light/test_light.py::test_plot_spectra_sorts_wavelengths -q
  • pytest tests -m "not slow" -q (212 passed)

@gitnotebooks

gitnotebooks Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review these changes at https://app.gitnotebooks.com/siplab-gt/cleo/pull/75

@kjohnsen
kjohnsen merged commit 4a888af into siplab-gt:master Sep 3, 2026
1 check 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.

plot_spectra() requires sorted spectrum

2 participants