spacepy / dbprocessing

Automated processing controller for heliophysics data
5 stars 4 forks source link

Resolve tension between instrumentproductlink and product.instrument_id #105

Open jtniehof opened 2 years ago

jtniehof commented 2 years ago

Another from #102. There is both an instrumentproductlink table, implying instruments and products are a many-to-many, and an instrument_id column in product, implying each product only has one instrument. I haven't gone digging deeply to figure out which is actually used when doing, say, a reprocess by instrument.

My gut feeling says there should be only one of these two mechanisms, but maybe we have a "primary" instrument and "others". This is probably going to involve a db migration and some code checking to make sure all uses the same mechanism.

OS, Python version, and dependency version information:

Linux-4.15.0-163-generic-x86_64-with-Ubuntu-18.04-bionic
sys.version_info(major=2, minor=7, micro=17, releaselevel='final', serial=0)
sqlalchemy=1.1.11

Version of dbprocessing

102 , i.e. 1d5a938ed6666e4da3069d13707f57db650715e7 or jtniehof/dbprocessing:document_tables

Closure condition

This issue should be closed when a PR is merged with the mapping approach chosen, code updated (with tests), database migration included, and any documentation updates.

balarsen commented 2 years ago

I agree with

My gut feeling says there should be only one of these two mechanisms, but maybe we have a "primary" instrument and "others". This is probably going to involve a db migration and some code checking to make sure all uses the same mechanism.