Skip to content
Snippets Groups Projects

Access metadata from CalDB

Merged Mikhail Karnevskiy requested to merge feat/add_getfromdb into master
3 unresolved threads

Add a function to cal_tools, which returns not only calibration constants but also a metadata. @amunnich @qingtian

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
319 print(e)
320 return empty_constant
320 if verbosity > 0:
321 print(e)
322 return empty_constant, metadata
321 323 else:
322 return empty_constant
324 return empty_constant, None
325
326
327 def get_constant_from_db(device, constant, condition, empty_constant,
328 cal_db_interface, creation_time=None,
329 print_once=True, timeout=30000):
330 data, _ = get_data_from_db(device, constant, condition, empty_constant,
331 cal_db_interface, creation_time,
332 print_once, timeout)
  • 292 292
    293 293
    294 294 all_ready_printed = {}
    295 def get_constant_from_db(device, constant, condition, empty_constant,
    295 def get_data_from_db(device, constant, condition, empty_constant,
  • 307 metadata.retrieve(cal_db_interface)
    308 306 else:
    309 307 metadata.calibration_constant_version = Versions.Timespan(device=device,
    310 308 start=creation_time)
    311 metadata.retrieve(cal_db_interface, when=creation_time.isoformat(), timeout=timeout)
    309 creation_time = creation_time.isoformat()
    310
    312 311 try:
    313
    314 if constant.name not in all_ready_printed or not print_once:
    315 all_ready_printed[constant.name] = True
    316 print("{} was injected on: {}".format(constant.name, metadata.calibration_constant_version.begin_at))
    317 return constant.data
    312 metadata.retrieve(cal_db_interface, when=creation_time, timeout=timeout)
    313 if verbosity > 0:
    314 if constant.name not in all_ready_printed or verbosity > 1:
  • That's all I have

  • added 1 commit

    • 2a4a98ce - Add doc string. Rename variables.

    Compare with previous version

  • added 1 commit

    • d864c65e - Add description of parameters

    Compare with previous version

  • mentioned in commit ae2cef68

  • Please register or sign in to reply
    Loading