Stop SpectralTraceList.meta dict overwriting individual SPectralTrace.meta dicts - #986
Open
astronomyk wants to merge 1 commit into
Open
Stop SpectralTraceList.meta dict overwriting individual SPectralTrace.meta dicts#986astronomyk wants to merge 1 commit into
SpectralTraceList.meta dict overwriting individual SPectralTrace.meta dicts#986astronomyk wants to merge 1 commit into
Conversation
make_spectral_traces built each trace's parameters as row columns updated with self.meta, so any key collision (notably 'description', which most instrument YAMLs set for the effect as a whole) clobbered the per-trace catalogue value. Trace-specific columns (description, extension_id, aperture_id, image_plane_id) now win; list meta remains the source for everything else. Applied to SpectralTraceList and the same pattern in MosaicSpectralTraceList. Adds a test that per-trace descriptions survive a list-level description kwarg. Full basic_instrument spectroscopy/ifu suite passes unchanged.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #986 +/- ##
=======================================
Coverage 76.45% 76.45%
=======================================
Files 69 69
Lines 9021 9021
=======================================
Hits 6897 6897
Misses 2124 2124 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
SpectralTraceList.meta dict overwriting individual SPectralTrace.meta dicts
astronomyk
marked this pull request as ready for review
August 24, 2026 13:56
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.
The Toaster-generated description is actually pretty ok for this one - summarised with the problem statement:
This PR swaps the
params.update(self.meta)todict(self.meta).update(params)to preserve individualSpectralTracemeta infoIt seems fine and the tests bare it out. In practice it seems it's limited to the "description" key, but in general, we want each individual
SpectralTraceto retain it's own settings. So this seems to, in the words of Martin, "reduce the future bug cross-section"What
make_spectral_tracesbuilt each trace's parameters as catalogue row columns, then overwritten by the list's meta:Since most instrument YAMLs give the effect a
description, every individualSpectralTracehad its catalogue description replaced by the list-level one (e.g. all eight MICADO traces described as "list of spectral order trace geometry on the focal plane" instead ofORDER_3_1etc.). The same applies to any future collision between effect kwargs and the per-trace catalogue columns (description,extension_id,aperture_id,image_plane_id).Precedence is now: list meta provides the defaults, the trace-specific catalogue values win. Applied to
SpectralTraceListand the same pattern inMosaicSpectralTraceList.Behaviour note
This is a (mild) behaviour change by design: previously, an effect kwarg colliding with a catalogue column silently overrode it per trace. No instrument package in the IRDB relies on that — the colliding key in practice is only
description— and the full basic_instrument spectroscopy/IFU end-to-end suite passes unchanged.Testing
TestInit::test_trace_values_win_over_list_meta: per-trace descriptions survive a list-leveldescriptionkwarg.