Skip to content

Commit

Permalink
Started working on DB
Browse files Browse the repository at this point in the history
  • Loading branch information
gnthibault committed Aug 20, 2023
1 parent b37d253 commit 0f12889
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
24 changes: 24 additions & 0 deletions apps/prototyping/database/test_base_read.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from Base.Base import Base


b = Base()
print(b.db.collection_names)
"""
collection_names = [
'scope_controller', # useless ?
'config', # useless ?
'current', # useless ?
'calibrations',
'environment', # useless ?
'mount', # useles
'observations',
'offset_info', # Legacy: Used to be there to store guiding delta info
'state',
'weather',
]
"""

latest_calibration = b.db.get_current(collection='calibrations')


def find(self, collection, obj_id):
14 changes: 6 additions & 8 deletions utils/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,15 @@ def __new__(cls, db_type=None, db_name=None, *args, **kwargs):

# Pre-defined list of collections that are valid.
collection_names = [
'scope_controller',
'config',
'current',
'scope_controller', # useless ?
'config', # useless ?
'current', # useless ?
'calibrations',
'drift_align',
'environment',
'mount',
'environment', # useless ?
'mount', # useles
'observations',
'offset_info',
'offset_info', # Legacy: Used to be there to store guiding delta info
'state',
'telemetry_board',
'weather',
]

Expand Down

0 comments on commit 0f12889

Please sign in to comment.