spacepy / dbprocessing

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

Move table definitions to separate, common module. #55

Closed jtniehof closed 3 years ago

jtniehof commented 3 years ago

This PR takes the table definitions, which were primarily in CreateDB.py and copied where needed elsewhere, and moves them into a separate module that can be used elsewhere.

For now this does not convert CreateDBsabrs as the database format still different, but it provides the possibility for converging them later.

This PR doesn't reformat/rewrap the definitions, so that the correspondence with the original CreateDB is clearer for now (rewrap can happen in the future.) The one change is that the ix_file_big index definition is moved into the table definition itself rather than glued on after the table is created.

One note (that's in the comments, but worth calling out): the table definition module creates new Column objects every time it's called; reusing objects doesn't work if they're used in separate database, as happens in the unit tests.

This is the first time we have a docstring cross-linking to sqlalchemy, so this also adds the appropriate intersphinx entries to make that work.

PR Checklist