astrodbtoolkit / astrodb-template-db

A template for astronomical databases.
https://astrodb-template-db.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

add regime as reference table #45

Closed arjunsavel closed 4 months ago

arjunsavel commented 4 months ago

Addresses #38.

Not sure if this is exactly what was intended by #38, though! LMK if this isn't the right direction, happy to reorient.

arjunsavel commented 4 months ago

Once I make the tests pass, I'll also address #42 here, I think.

kelle commented 4 months ago

Agreed, doing the PhotometryFilters UCD test as part of this PR makes good sense.

dr-rodriguez commented 4 months ago

Because regime was set as required, we need to update the tests to pass:

FAILED tests/test_schema.py::test_photometry - sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) NOT NULL constraint failed: Photometry.regime
[SQL: INSERT INTO "Photometry" (source, band, magnitude, magnitude_error, telescope, epoch, comments, reference, regime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('V4046 Sgr', '2MASS.Ks', 7.249, None, '2MASS', None, None, 'Cutri03', None)]

test_schema.py needs to have regime was one of the things we insert into photometry

kelle commented 4 months ago

reference: https://wiki.ivoa.net/internal/IVOA/IvoaUCD/NoteEMSpectrum-20040520.html

arjunsavel commented 4 months ago

since regimes aren't 1-1 with the UCD photometry filters, I think I'll address https://github.com/astrodbtoolkit/astrodb-template-db/issues/42 in another PR. @kelle what do you think?