Skip to content

Reducedddatum refactor#1521

Open
Fingel wants to merge 38 commits intoversion-3-0-alphafrom
reducedddatum-refactor
Open

Reducedddatum refactor#1521
Fingel wants to merge 38 commits intoversion-3-0-alphafrom
reducedddatum-refactor

Conversation

@Fingel
Copy link
Copy Markdown
Contributor

@Fingel Fingel commented Apr 23, 2026

Introduces concrete Reduced Datum types: PhotometryReducedDatum, SpectroscopyReducedDatum, AstrometryReducedDatum, and keeps the original ReducedDatum class as a generic type. This PR attempts to use the concrete types where needed, while maintaining API compatibility. This means the the JSON endpoints will have the same shape, but the underlying storage will use the concrete tables.

It also includes a management command to move existing generic ReducedDatums into their concrete counterparts. Note that many views will no longer populate until this command is run, for example the photometry plot.

Fingel added 26 commits April 2, 2026 11:51
Moves almost all field from the existing model an abstract model from
which all models inherit. This means existing ReducedDatums remain
unchanged, but 3 new tables are created for the concrete types. A
datamigration can be run to convert from the old model to the new
(future commit).
Two custom field types that use TextField as storage, but se/deserialize
as arrays. Flux being an array of 2-tuple flux/wavelength pairs, and
FloatArray as a single array of floats.
value can now be blank
@Fingel Fingel linked an issue Apr 23, 2026 that may be closed by this pull request
@jchate6 jchate6 changed the base branch from dev to version-3-0-alpha April 23, 2026 20:52
@jchate6 jchate6 moved this to Needs Review in TOM Toolkit Apr 23, 2026
Copy link
Copy Markdown
Contributor

@jchate6 jchate6 left a comment

Choose a reason for hiding this comment

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

I've made a few preliminary comments.

I also merged v3 into this. Can you take a look at tom_dataservices to see what changes might need to happen there?

Once you are happy with that, please re-request a review.

Comment thread tom_dataproducts/models.py
Comment thread tom_dataproducts/models.py Outdated
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 code will be abandoned in the next sprint

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 will probably be useful when we refactor this into a data service. Thanks!

Comment thread tom_dataproducts/management/commands/migrateReducedDatums.py Outdated
Comment thread tom_dataproducts/models.py
@jchate6 jchate6 self-requested a review May 1, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

Refactor ReducedDatums to a multi-model based infrastructure

2 participants