rcdb 2.2.10__tar.gz → 2.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. {rcdb-2.2.10 → rcdb-2.3.1}/MANIFEST.in +11 -11
  2. {rcdb-2.2.10/rcdb.egg-info → rcdb-2.3.1}/PKG-INFO +66 -56
  3. rcdb-2.3.1/README.md +30 -0
  4. {rcdb-2.2.10 → rcdb-2.3.1}/pyproject.toml +73 -67
  5. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/__init__.py +137 -127
  6. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/__main__.py +7 -7
  7. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/alias.py +97 -90
  8. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/app_context.py +115 -100
  9. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/__main__.py +3 -3
  10. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/add.py +139 -141
  11. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/app.py +85 -74
  12. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/context.py +5 -5
  13. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/db.py +224 -213
  14. rcdb-2.3.1/rcdb/cli/file.py +333 -0
  15. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/info.py +58 -60
  16. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/ls.py +21 -23
  17. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/repair/__init__.py +12 -12
  18. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/repair/evio_files.py +143 -145
  19. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/rp.py +251 -254
  20. rcdb-2.3.1/rcdb/cli/run.py +84 -0
  21. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/select.py +116 -84
  22. rcdb-2.3.1/rcdb/cli/test_data.py +133 -0
  23. rcdb-2.3.1/rcdb/cli/web.py +68 -0
  24. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/coda_parser.py +308 -308
  25. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/config_parser.py +99 -99
  26. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/errors.py +30 -30
  27. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/file_archiver.py +34 -34
  28. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/halld_daq_config_parser.py +75 -79
  29. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/lexer.py +1 -21
  30. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/model.py +514 -517
  31. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/provider.py +1503 -1459
  32. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/stopwatch.py +1 -0
  33. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/update.py +35 -34
  34. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/version.py +5 -5
  35. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/__init__.py +175 -112
  36. rcdb-2.3.1/rcdb/web/__main__.py +3 -0
  37. rcdb-2.3.1/rcdb/web/modules/__init__.py +16 -0
  38. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/modules/conditions.py +13 -18
  39. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/modules/files.py +31 -31
  40. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/modules/logs.py +23 -23
  41. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/modules/runs.py +279 -259
  42. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/modules/select_values.py +57 -57
  43. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/modules/statistics.py +28 -28
  44. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/pagination.py +42 -42
  45. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/run_table.py +5 -5
  46. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.bootstrap.css +187 -187
  47. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.bootstrap.min.css +1 -1
  48. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.foundation.css +117 -117
  49. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.foundation.min.css +1 -1
  50. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.jqueryui.css +482 -482
  51. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.jqueryui.min.css +1 -1
  52. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables.css +453 -453
  53. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables.min.css +1 -1
  54. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables_themeroller.css +416 -416
  55. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.bootstrap.js +219 -219
  56. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.bootstrap.min.js +9 -9
  57. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.foundation.js +156 -156
  58. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.foundation.min.js +8 -8
  59. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.jqueryui.js +164 -164
  60. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.jqueryui.min.js +9 -9
  61. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/jquery.dataTables.js +15212 -15212
  62. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/jquery.dataTables.min.js +164 -164
  63. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.bootstrap.css +178 -178
  64. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.bootstrap.min.css +1 -1
  65. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.dataTables.css +178 -178
  66. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.dataTables.min.css +1 -1
  67. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.foundation.css +181 -181
  68. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.foundation.min.css +1 -1
  69. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.jqueryui.css +178 -178
  70. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.jqueryui.min.css +1 -1
  71. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/dataTables.responsive.js +1149 -1149
  72. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/dataTables.responsive.min.js +23 -23
  73. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.bootstrap.js +78 -78
  74. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.bootstrap.min.js +7 -7
  75. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.foundation.js +62 -62
  76. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.foundation.min.js +6 -6
  77. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.jqueryui.js +63 -63
  78. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.jqueryui.min.js +6 -6
  79. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.bootstrap.css +22 -22
  80. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.bootstrap.min.css +1 -1
  81. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.dataTables.css +22 -22
  82. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.dataTables.min.css +1 -1
  83. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.foundation.css +22 -22
  84. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.foundation.min.css +1 -1
  85. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.jqueryui.css +22 -22
  86. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.jqueryui.min.css +1 -1
  87. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/js/dataTables.rowReorder.js +619 -619
  88. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/js/dataTables.rowReorder.min.js +15 -15
  89. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/datatables.css +671 -671
  90. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/datatables.js +16998 -16998
  91. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/datatables.min.css +21 -21
  92. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/datatables.min.js +220 -220
  93. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap-theme.css +587 -587
  94. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap-theme.min.css +5 -5
  95. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap.css +6760 -6760
  96. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap.min.css +5 -5
  97. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/buttons.dataTables.min.css +1 -1
  98. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/dataTables.tableTools.css +361 -361
  99. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/jquery-ui.min.css +6 -6
  100. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/jquery-ui.structure.min.css +4 -4
  101. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/jquery-ui.theme.min.css +4 -4
  102. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/jquery.dataTables.min.css +1 -1
  103. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/jquery.dataTables.yadcf.css +123 -123
  104. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/jquery.jsonview.css +52 -52
  105. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/main.css +232 -232
  106. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/select.dataTables.min.css +1 -1
  107. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/webintellisense.css +126 -126
  108. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/fonts/glyphicons-halflings-regular.svg +287 -287
  109. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/humans.txt +15 -15
  110. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/bootstrap.js +2363 -2363
  111. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/bootstrap.min.js +6 -6
  112. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/clipboard.min.js +6 -6
  113. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/copy_clipboard.js +51 -51
  114. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/dataTables.buttons.min.js +36 -36
  115. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/dataTables.select.min.js +25 -25
  116. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/jquery-2.1.0.min.js +5 -5
  117. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/jquery-2.1.4.min.js +4 -4
  118. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/jquery-ui.min.js +8 -8
  119. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/jquery.dataTables.min.js +166 -166
  120. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/jquery.dataTables.yadcf.js +4175 -4175
  121. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/jquery.flot.min.js +1 -1
  122. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/jquery.jsonview.js +284 -284
  123. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/npm.js +12 -12
  124. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/webintellisense-ace.js +380 -380
  125. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/webintellisense-codemirror.js +233 -233
  126. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/webintellisense-textbox.js +385 -385
  127. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/js/webintellisense.js +912 -912
  128. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/robots.txt +5 -5
  129. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/style.css +17 -17
  130. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/404.html +157 -157
  131. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/admin/index.html +7 -7
  132. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/admin/layout.html +9 -9
  133. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/admin/user.html +10 -10
  134. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/admin/users.html +27 -27
  135. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/conditions/index.html +28 -28
  136. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/custom_column_run_table.html +84 -84
  137. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/default_run_table.html +86 -86
  138. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/errors/forbidden_page.html +14 -14
  139. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/errors/layout.html +31 -31
  140. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/errors/page_not_found.html +15 -15
  141. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/errors/server_error.html +10 -10
  142. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/files/index.html +121 -121
  143. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/files/info.html +25 -25
  144. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/files/not_found.html +15 -15
  145. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/frontend/create_profile.html +10 -10
  146. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/frontend/footers/help.html +17 -17
  147. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/frontend/login.html +10 -10
  148. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/frontend/login_openid.html +11 -11
  149. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/frontend/reauth.html +10 -10
  150. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/frontend/reset_password.html +10 -10
  151. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/frontend/search.html +27 -27
  152. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/frontend/signup.html +10 -10
  153. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/index.html +157 -157
  154. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/layout.html +16 -16
  155. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/layouts/base.html +341 -327
  156. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/layouts/base2.html +328 -328
  157. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/login.html +13 -13
  158. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/logs/index.html +34 -34
  159. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/macros/_ask_user_to_update_ie.html +3 -3
  160. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/macros/_form.html +135 -135
  161. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/macros/_google_analytics.html +8 -8
  162. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/macros/_misc.html +42 -42
  163. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/macros/_reset_password.html +13 -13
  164. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/render_pagination.html +16 -16
  165. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/run_search_box.html +302 -302
  166. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/runs/conditions.html +90 -90
  167. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/runs/example.html +206 -206
  168. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/runs/index.html +189 -189
  169. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/runs/info.html +251 -251
  170. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/runs/not_found.html +26 -26
  171. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/select_values/index.html +119 -119
  172. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/settings/layout.html +9 -9
  173. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/settings/password.html +10 -10
  174. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/settings/profile.html +10 -10
  175. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/show_entries.html +20 -20
  176. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/statistics/index.html +78 -78
  177. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/user/index.html +7 -7
  178. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/templates/user/profile.html +7 -7
  179. {rcdb-2.2.10 → rcdb-2.3.1/rcdb.egg-info}/PKG-INFO +66 -56
  180. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb.egg-info/SOURCES.txt +5 -1
  181. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb.egg-info/requires.txt +7 -0
  182. {rcdb-2.2.10 → rcdb-2.3.1}/setup.cfg +4 -4
  183. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_cli_add_condition.py +139 -139
  184. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_cli_add_file.py +104 -105
  185. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_cli_add_type.py +86 -87
  186. rcdb-2.3.1/tests/test_cli_file.py +241 -0
  187. rcdb-2.3.1/tests/test_cli_run.py +154 -0
  188. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_coda_parser.py +65 -66
  189. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_conditions.py +229 -231
  190. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_config_parser.py +22 -22
  191. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_get_run_periods.py +95 -68
  192. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_get_runs.py +77 -77
  193. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_halld_run_config_parser.py +26 -27
  194. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_save_files.py +105 -105
  195. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_select_runs.py +171 -171
  196. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_select_values.py +122 -122
  197. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_sql_schema_version.py +52 -52
  198. {rcdb-2.2.10 → rcdb-2.3.1}/tests/test_value_comparison.py +35 -35
  199. rcdb-2.2.10/README.md +0 -26
  200. rcdb-2.2.10/rcdb/cli/run.py +0 -76
  201. rcdb-2.2.10/rcdb/cli/web.py +0 -29
  202. rcdb-2.2.10/rcdb/condition_query_builder.py +0 -34
  203. rcdb-2.2.10/rcdb/web/modules/__init__.py +0 -6
  204. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/cli/__init__.py +0 -0
  205. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/constants.py +0 -0
  206. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/log_format.py +0 -0
  207. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_asc.png +0 -0
  208. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_asc_disabled.png +0 -0
  209. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_both.png +0 -0
  210. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_desc.png +0 -0
  211. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_desc_disabled.png +0 -0
  212. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap-theme.css.map +0 -0
  213. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap-theme.min.css.map +0 -0
  214. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap.css.map +0 -0
  215. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap.min.css.map +0 -0
  216. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/favicon.png +0 -0
  217. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/fonts/glyphicons-halflings-regular.eot +0 -0
  218. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/fonts/glyphicons-halflings-regular.ttf +0 -0
  219. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/fonts/glyphicons-halflings-regular.woff +0 -0
  220. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/fonts/glyphicons-halflings-regular.woff2 +0 -0
  221. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/img/glyphicons-halflings-white.png +0 -0
  222. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/img/glyphicons-halflings.png +0 -0
  223. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb/web/static/img/logo.png +0 -0
  224. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb.egg-info/dependency_links.txt +0 -0
  225. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb.egg-info/entry_points.txt +0 -0
  226. {rcdb-2.2.10 → rcdb-2.3.1}/rcdb.egg-info/top_level.txt +0 -0
@@ -1,12 +1,12 @@
1
- exclude .gitignore
2
- exclude daq
3
- exclude examples
4
- exclude halld_rcdb
5
- exclude tests
6
- exclude utilites
7
-
8
-
9
- include ../README.md
10
- recursive-include rcdb *.py
11
- recursive-include rcdb/web/static *
1
+ exclude .gitignore
2
+ exclude daq
3
+ exclude examples
4
+ exclude halld_rcdb
5
+ exclude tests
6
+ exclude utilites
7
+
8
+
9
+ include ../README.md
10
+ recursive-include rcdb *.py
11
+ recursive-include rcdb/web/static *
12
12
  recursive-include rcdb/web/templates *
@@ -1,56 +1,66 @@
1
- Metadata-Version: 2.4
2
- Name: rcdb
3
- Version: 2.2.10
4
- Summary: RCDB - Run Conditions DataBase
5
- Author-email: Dmitry Romanov <romanov@jlab.org>
6
- License-Expression: MIT
7
- Classifier: Development Status :: 5 - Production/Stable
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.9
10
- Classifier: Programming Language :: Python :: 3.10
11
- Classifier: Programming Language :: Python :: 3.11
12
- Classifier: Programming Language :: Python :: 3.12
13
- Classifier: Programming Language :: Python :: 3.13
14
- Classifier: Programming Language :: Python :: Implementation :: CPython
15
- Classifier: Intended Audience :: Science/Research
16
- Classifier: Intended Audience :: Developers
17
- Classifier: Operating System :: OS Independent
18
- Classifier: Topic :: Scientific/Engineering :: Physics
19
- Classifier: Topic :: Database
20
- Requires-Python: >=3.9
21
- Description-Content-Type: text/markdown
22
- Requires-Dist: markupsafe>=3.0
23
- Requires-Dist: pymysql>=1.1
24
- Requires-Dist: ply>=3.11
25
- Requires-Dist: mako>=1.3
26
- Requires-Dist: click>=8
27
- Requires-Dist: sqlalchemy>=2
28
- Requires-Dist: flask>=3.1.0
29
- Requires-Dist: rich
30
-
31
- ## RCDB
32
-
33
- ![Python tests](https://github.com/JeffersonLab/rcdb/actions/workflows/python-tests.yml/badge.svg)
34
- [![Python examples work](https://github.com/JeffersonLab/rcdb/actions/workflows/python-examples.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/python-examples.yml)
35
-
36
- Run Configuration/Conditions Database (RCDB) stores run related information and conditions. It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
37
-
38
- The interfaces available are:
39
- - Web site
40
- - Command line interface (CLI)
41
- - Python API
42
- - C++ API
43
- - Possibly JAVA API
44
-
45
- #### Documentation:
46
-
47
- https://jeffersonlab.github.io/rcdb/
48
-
49
- #### Demo website:
50
- One can visit HallD RCDB Web site as demo:
51
- https://halldweb.jlab.org/rcdb/
52
-
53
-
54
- #### SQLite db:
55
- Daily updated SQLite database is available here:
56
- https://halldweb.jlab.org/dist/rcdb2.sqlite
1
+ Metadata-Version: 2.4
2
+ Name: rcdb
3
+ Version: 2.3.1
4
+ Summary: RCDB - Run Conditions DataBase
5
+ Author-email: Dmitry Romanov <romanov@jlab.org>
6
+ License-Expression: MIT
7
+ Classifier: Development Status :: 5 - Production/Stable
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: Implementation :: CPython
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Topic :: Scientific/Engineering :: Physics
20
+ Classifier: Topic :: Database
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: markupsafe>=3.0
24
+ Requires-Dist: pymysql>=1.1
25
+ Requires-Dist: ply>=3.11
26
+ Requires-Dist: mako>=1.3
27
+ Requires-Dist: click>=8
28
+ Requires-Dist: sqlalchemy>=2
29
+ Requires-Dist: flask>=3.1.0
30
+ Requires-Dist: rich
31
+ Provides-Extra: examples
32
+ Requires-Dist: jsonpickle; extra == "examples"
33
+ Requires-Dist: pandas; extra == "examples"
34
+ Provides-Extra: dev
35
+ Requires-Dist: pyflakes>=3; extra == "dev"
36
+
37
+ ## RCDB
38
+
39
+ ![Python tests](https://github.com/JeffersonLab/rcdb/actions/workflows/python-tests.yml/badge.svg)
40
+ [![Python examples work](https://github.com/JeffersonLab/rcdb/actions/workflows/python-examples.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/python-examples.yml)
41
+ [![C++ tests](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-tests.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-tests.yml)
42
+ [![C++ examples](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-examples.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-examples.yml)
43
+ [![Documentation](https://github.com/JeffersonLab/rcdb/actions/workflows/documentation.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/documentation.yml)
44
+
45
+ Run Configuration/Conditions Database (RCDB) stores run related information and conditions.
46
+ It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
47
+
48
+ The interfaces available are:
49
+ - Web
50
+ - Command line interface (CLI)
51
+ - Python API
52
+ - C++ API
53
+ - Possibly JAVA API
54
+
55
+ #### Documentation:
56
+
57
+ https://jeffersonlab.github.io/rcdb/
58
+
59
+ #### Demo website:
60
+ One can visit HallD RCDB Web site as demo:
61
+ https://halldweb.jlab.org/rcdb/
62
+
63
+
64
+ #### SQLite db:
65
+ Daily updated SQLite database is available here:
66
+ https://halldweb.jlab.org/dist/rcdb.sqlite
rcdb-2.3.1/README.md ADDED
@@ -0,0 +1,30 @@
1
+ ## RCDB
2
+
3
+ ![Python tests](https://github.com/JeffersonLab/rcdb/actions/workflows/python-tests.yml/badge.svg)
4
+ [![Python examples work](https://github.com/JeffersonLab/rcdb/actions/workflows/python-examples.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/python-examples.yml)
5
+ [![C++ tests](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-tests.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-tests.yml)
6
+ [![C++ examples](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-examples.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-examples.yml)
7
+ [![Documentation](https://github.com/JeffersonLab/rcdb/actions/workflows/documentation.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/documentation.yml)
8
+
9
+ Run Configuration/Conditions Database (RCDB) stores run related information and conditions.
10
+ It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
11
+
12
+ The interfaces available are:
13
+ - Web
14
+ - Command line interface (CLI)
15
+ - Python API
16
+ - C++ API
17
+ - Possibly JAVA API
18
+
19
+ #### Documentation:
20
+
21
+ https://jeffersonlab.github.io/rcdb/
22
+
23
+ #### Demo website:
24
+ One can visit HallD RCDB Web site as demo:
25
+ https://halldweb.jlab.org/rcdb/
26
+
27
+
28
+ #### SQLite db:
29
+ Daily updated SQLite database is available here:
30
+ https://halldweb.jlab.org/dist/rcdb.sqlite
@@ -1,67 +1,73 @@
1
- [build-system]
2
- # These tell pip or other installers how to build your project
3
- requires = [
4
- "setuptools>=61.0", # version 61+ supports PEP 621 metadata in pyproject.toml
5
- "wheel"
6
- ]
7
- build-backend = "setuptools.build_meta"
8
-
9
- [project]
10
- name = "rcdb"
11
- description = "RCDB - Run Conditions DataBase"
12
- # If you want to read your long description from README.md, you can also do:
13
- readme = "README.md"
14
- # If you'd like to keep version in rcdb.version.py, see "Dynamic version" section below.
15
- # Otherwise, put a fixed version here, e.g. version = "1.0.0"
16
- dynamic = ["version"]
17
- license = "MIT"
18
- authors = [
19
- { name="Dmitry Romanov", email="romanov@jlab.org" }
20
- ]
21
- classifiers = [
22
- "Development Status :: 5 - Production/Stable",
23
- "Programming Language :: Python :: 3",
24
- "Programming Language :: Python :: 3.9",
25
- "Programming Language :: Python :: 3.10",
26
- "Programming Language :: Python :: 3.11",
27
- "Programming Language :: Python :: 3.12",
28
- "Programming Language :: Python :: 3.13",
29
- "Programming Language :: Python :: Implementation :: CPython",
30
- "Intended Audience :: Science/Research",
31
- "Intended Audience :: Developers",
32
- "Operating System :: OS Independent",
33
- "Topic :: Scientific/Engineering :: Physics",
34
- "Topic :: Database"
35
- ]
36
- requires-python = ">=3.9"
37
- dependencies = [
38
- "markupsafe>=3.0",
39
- "pymysql>=1.1",
40
- "ply>=3.11",
41
- "mako>=1.3",
42
- "click>=8",
43
- "sqlalchemy>=2",
44
- "flask>=3.1.0",
45
- "rich"
46
- ]
47
-
48
- # If you want a console script, define it in [project.scripts]
49
- [project.scripts]
50
- rcdb = "rcdb.cli.app:rcdb_cli"
51
-
52
- # Tell setuptools how to find your packages if needed:
53
- [tool.setuptools.packages.find]
54
- include = ["rcdb*"]
55
-
56
- [tool.setuptools]
57
- include-package-data = true
58
-
59
- [tool.setuptools.package-data]
60
- # Recursively include everything under rcdb/web/static/ and rcdb/web/templates/
61
- rcdb = [
62
- "web/static/**/*.*",
63
- "web/templates/**/*.*"
64
- ]
65
-
66
- [tool.setuptools.dynamic]
67
- version = { attr = "rcdb.version.version" }
1
+ [build-system]
2
+ # These tell pip or other installers how to build your project
3
+ requires = [
4
+ "setuptools>=61.0", # version 61+ supports PEP 621 metadata in pyproject.toml
5
+ "wheel"
6
+ ]
7
+ build-backend = "setuptools.build_meta"
8
+
9
+ [project]
10
+ name = "rcdb"
11
+ description = "RCDB - Run Conditions DataBase"
12
+ # If you want to read your long description from README.md, you can also do:
13
+ readme = "README.md"
14
+ # If you'd like to keep version in rcdb.version.py, see "Dynamic version" section below.
15
+ # Otherwise, put a fixed version here, e.g. version = "1.0.0"
16
+ dynamic = ["version"]
17
+ license = "MIT"
18
+ authors = [
19
+ { name="Dmitry Romanov", email="romanov@jlab.org" }
20
+ ]
21
+ classifiers = [
22
+ "Development Status :: 5 - Production/Stable",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.9",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: 3.14",
30
+ "Programming Language :: Python :: Implementation :: CPython",
31
+ "Intended Audience :: Science/Research",
32
+ "Intended Audience :: Developers",
33
+ "Operating System :: OS Independent",
34
+ "Topic :: Scientific/Engineering :: Physics",
35
+ "Topic :: Database"
36
+ ]
37
+ requires-python = ">=3.9"
38
+ dependencies = [
39
+ "markupsafe>=3.0",
40
+ "pymysql>=1.1",
41
+ "ply>=3.11",
42
+ "mako>=1.3",
43
+ "click>=8",
44
+ "sqlalchemy>=2",
45
+ "flask>=3.1.0",
46
+ "rich"
47
+ ]
48
+
49
+ [project.optional-dependencies]
50
+ examples = ["jsonpickle", "pandas"]
51
+ dev = ["pyflakes>=3"]
52
+
53
+
54
+ # If you want a console script, define it in [project.scripts]
55
+ [project.scripts]
56
+ rcdb = "rcdb.cli.app:rcdb_cli"
57
+
58
+ # Tell setuptools how to find your packages if needed:
59
+ [tool.setuptools.packages.find]
60
+ include = ["rcdb*"]
61
+
62
+ [tool.setuptools]
63
+ include-package-data = true
64
+
65
+ [tool.setuptools.package-data]
66
+ # Recursively include everything under rcdb/web/static/ and rcdb/web/templates/
67
+ rcdb = [
68
+ "web/static/**/*.*",
69
+ "web/templates/**/*.*"
70
+ ]
71
+
72
+ [tool.setuptools.dynamic]
73
+ version = { attr = "rcdb.version.version" }
@@ -1,127 +1,137 @@
1
- from .model import ConditionType
2
- from .provider import RCDBProvider
3
- from .provider import ConfigurationProvider
4
- from .errors import *
5
-
6
- # This thing separates cells in data blob
7
- blob_delimiter = "|"
8
-
9
- # if cell of data table is a string and the string already contains blob_delimiter
10
- # we have to encode blob_delimiter to blob_delimiter_replace on data write and decode it bach on data read
11
- blob_delimiter_replacement = "&delimiter;"
12
-
13
- SQL_SCHEMA_VERSION = 2
14
-
15
-
16
- class UpdateReasons(object):
17
- """Class holds a default values of UpdateContext.reason field
18
- Attributes:
19
- START - means update goes after 'GO', beginning of the data taking
20
- UPDATE - after run in started, RCDB is being update each minute. That is how it is done
21
- END - after run is ended
22
- """
23
- START = 'start'
24
- UPDATE = 'update'
25
- END = 'end'
26
- UNKNOWN = ''
27
-
28
-
29
- # -------------------------------------------------
30
- # class holding a context of the update operations
31
- # -------------------------------------------------
32
- class UpdateContext(object):
33
- """Updates context
34
-
35
- Attributes:
36
- self.db - RCDBProvider with connection
37
- self.reason - one of UpdateReasons or empty string
38
- self.run - Run object
39
- """
40
-
41
- def __init__(self, db, reason):
42
- self.db = db
43
- self.reason = reason # Context in which daq is called '', 'start', 'update', 'end'
44
- self.run = None # Run object
45
-
46
-
47
- # -------------------------------------------------
48
- # function Convert list to DB text representation
49
- # -------------------------------------------------
50
- def list_to_db_text(values):
51
- """
52
- Converts list of values like pedestal,threshold,baseline_preset values
53
- to a space separated string - that is how the values are stored in the DB
54
-
55
- :param values: list of values
56
- :type values: []
57
-
58
- :return: string with values as it is stored in DB
59
- :rtype: basestring
60
- """
61
- return " ".join([str(value) for value in values])
62
-
63
-
64
- def make_threshold_preset(db, board, values):
65
- """
66
- checks if values
67
- :param values:
68
- :return:
69
- """
70
-
71
- if isinstance(values, list):
72
- text_values = list_to_db_text(values)
73
-
74
-
75
- class DefaultConditions(object):
76
- """
77
- Holds common names for conditions and can ensure database have them
78
- """
79
-
80
- EVENT_RATE = 'event_rate'
81
- EVENT_COUNT = 'event_count'
82
- RUN_TYPE = 'run_type'
83
- RUN_CONFIG = 'run_config'
84
- RUN_LENGTH = 'run_length'
85
- RUN_START_TIME = 'run_start_time'
86
- RUN_END_TIME = 'run_end_time'
87
- DAQ_SETUP = 'daq_setup'
88
- SESSION = 'session'
89
- USER_COMMENT = 'user_comment'
90
- COMPONENTS = 'components'
91
- COMPONENT_STATS = 'component_stats'
92
- RTVS = 'rtvs'
93
- IS_VALID_RUN_END = 'is_valid_run_end'
94
-
95
-
96
- def create_default_condition_types(db):
97
- """
98
- Checks if condition types listed in class exist in the database and create them if not
99
- :param db: RCDBProvider connected to database
100
- :type db: RCDBProvider
101
-
102
- :return: None
103
- """
104
- all_types_dict = {t.name: t for t in db.get_condition_types()}
105
-
106
- def create_condition_type(name, value_type, description=""):
107
- all_types_dict[name] if name in all_types_dict.keys() \
108
- else db.create_condition_type(name, value_type, description)
109
-
110
- # get or create condition type
111
- create_condition_type(DefaultConditions.EVENT_RATE, ConditionType.FLOAT_FIELD, "Average event rate")
112
- create_condition_type(DefaultConditions.EVENT_COUNT, ConditionType.INT_FIELD, "Number of events")
113
- create_condition_type(DefaultConditions.RUN_TYPE, ConditionType.STRING_FIELD, "DAQ Run type")
114
- create_condition_type(DefaultConditions.RUN_CONFIG, ConditionType.STRING_FIELD, "DAQ Run configuration")
115
- create_condition_type(DefaultConditions.SESSION, ConditionType.STRING_FIELD)
116
- create_condition_type(DefaultConditions.USER_COMMENT, ConditionType.STRING_FIELD)
117
- create_condition_type(DefaultConditions.COMPONENTS, ConditionType.JSON_FIELD)
118
- create_condition_type(DefaultConditions.RTVS, ConditionType.JSON_FIELD)
119
- create_condition_type(DefaultConditions.COMPONENT_STATS, ConditionType.JSON_FIELD)
120
- create_condition_type(DefaultConditions.IS_VALID_RUN_END, ConditionType.BOOL_FIELD,
121
- "True if a run has valid run-end record. "
122
- "False means the run was aborted/crashed at some point")
123
- create_condition_type(DefaultConditions.RUN_LENGTH, ConditionType.INT_FIELD, "Length of the run ")
124
- create_condition_type(DefaultConditions.RUN_START_TIME, ConditionType.TIME_FIELD, "Run start time ")
125
- create_condition_type(DefaultConditions.RUN_END_TIME, ConditionType.TIME_FIELD, "Run end time (last CODA update)")
126
-
127
-
1
+ from .model import ConditionType
2
+ from .provider import RCDBProvider, ConfigurationProvider
3
+ from .errors import (
4
+ OverrideConditionTypeError,
5
+ NoConditionTypeFound,
6
+ OverrideConditionValueError,
7
+ NoRunFoundError,
8
+ QueryFormatError,
9
+ QueryEvaluationError,
10
+ SqlSchemaVersionError,
11
+ )
12
+
13
+ # Names re-exported as part of rcdb's public API (e.g. rcdb.RCDBProvider)
14
+ __all__ = [
15
+ "ConditionType",
16
+ "RCDBProvider",
17
+ "ConfigurationProvider",
18
+ "OverrideConditionTypeError",
19
+ "NoConditionTypeFound",
20
+ "OverrideConditionValueError",
21
+ "NoRunFoundError",
22
+ "QueryFormatError",
23
+ "QueryEvaluationError",
24
+ "SqlSchemaVersionError",
25
+ ]
26
+
27
+ # This thing separates cells in data blob
28
+ blob_delimiter = "|"
29
+
30
+ # if cell of data table is a string and the string already contains blob_delimiter
31
+ # we have to encode blob_delimiter to blob_delimiter_replace on data write and decode it bach on data read
32
+ blob_delimiter_replacement = "&delimiter;"
33
+
34
+ SQL_SCHEMA_VERSION = 2
35
+
36
+
37
+ class UpdateReasons(object):
38
+ """Class holds a default values of UpdateContext.reason field
39
+ Attributes:
40
+ START - means update goes after 'GO', beginning of the data taking
41
+ UPDATE - after run in started, RCDB is being update each minute. That is how it is done
42
+ END - after run is ended
43
+ """
44
+ START = 'start'
45
+ UPDATE = 'update'
46
+ END = 'end'
47
+ UNKNOWN = ''
48
+
49
+
50
+ # -------------------------------------------------
51
+ # class holding a context of the update operations
52
+ # -------------------------------------------------
53
+ class UpdateContext(object):
54
+ """Updates context
55
+
56
+ Attributes:
57
+ self.db - RCDBProvider with connection
58
+ self.reason - one of UpdateReasons or empty string
59
+ self.run - Run object
60
+ """
61
+
62
+ def __init__(self, db, reason):
63
+ self.db = db
64
+ self.reason = reason # Context in which daq is called '', 'start', 'update', 'end'
65
+ self.run = None # Run object
66
+
67
+
68
+ # -------------------------------------------------
69
+ # function Convert list to DB text representation
70
+ # -------------------------------------------------
71
+ def list_to_db_text(values):
72
+ """
73
+ Converts list of values like pedestal,threshold,baseline_preset values
74
+ to a space separated string - that is how the values are stored in the DB
75
+
76
+ :param values: list of values
77
+ :type values: []
78
+
79
+ :return: string with values as it is stored in DB
80
+ :rtype: basestring
81
+ """
82
+ return " ".join([str(value) for value in values])
83
+
84
+
85
+ class DefaultConditions(object):
86
+ """
87
+ Holds common names for conditions and can ensure database have them
88
+ """
89
+
90
+ EVENT_RATE = 'event_rate'
91
+ EVENT_COUNT = 'event_count'
92
+ RUN_TYPE = 'run_type'
93
+ RUN_CONFIG = 'run_config'
94
+ RUN_LENGTH = 'run_length'
95
+ RUN_START_TIME = 'run_start_time'
96
+ RUN_END_TIME = 'run_end_time'
97
+ DAQ_SETUP = 'daq_setup'
98
+ SESSION = 'session'
99
+ USER_COMMENT = 'user_comment'
100
+ COMPONENTS = 'components'
101
+ COMPONENT_STATS = 'component_stats'
102
+ RTVS = 'rtvs'
103
+ IS_VALID_RUN_END = 'is_valid_run_end'
104
+
105
+
106
+ def create_default_condition_types(db):
107
+ """
108
+ Checks if condition types listed in class exist in the database and create them if not
109
+ :param db: RCDBProvider connected to database
110
+ :type db: RCDBProvider
111
+
112
+ :return: None
113
+ """
114
+ all_types_dict = {t.name: t for t in db.get_condition_types()}
115
+
116
+ def create_condition_type(name, value_type, description=""):
117
+ all_types_dict[name] if name in all_types_dict.keys() \
118
+ else db.create_condition_type(name, value_type, description)
119
+
120
+ # get or create condition type
121
+ create_condition_type(DefaultConditions.EVENT_RATE, ConditionType.FLOAT_FIELD, "Average event rate")
122
+ create_condition_type(DefaultConditions.EVENT_COUNT, ConditionType.INT_FIELD, "Number of events")
123
+ create_condition_type(DefaultConditions.RUN_TYPE, ConditionType.STRING_FIELD, "DAQ Run type")
124
+ create_condition_type(DefaultConditions.RUN_CONFIG, ConditionType.STRING_FIELD, "DAQ Run configuration")
125
+ create_condition_type(DefaultConditions.SESSION, ConditionType.STRING_FIELD)
126
+ create_condition_type(DefaultConditions.USER_COMMENT, ConditionType.STRING_FIELD)
127
+ create_condition_type(DefaultConditions.COMPONENTS, ConditionType.JSON_FIELD)
128
+ create_condition_type(DefaultConditions.RTVS, ConditionType.JSON_FIELD)
129
+ create_condition_type(DefaultConditions.COMPONENT_STATS, ConditionType.JSON_FIELD)
130
+ create_condition_type(DefaultConditions.IS_VALID_RUN_END, ConditionType.BOOL_FIELD,
131
+ "True if a run has valid run-end record. "
132
+ "False means the run was aborted/crashed at some point")
133
+ create_condition_type(DefaultConditions.RUN_LENGTH, ConditionType.INT_FIELD, "Length of the run ")
134
+ create_condition_type(DefaultConditions.RUN_START_TIME, ConditionType.TIME_FIELD, "Run start time ")
135
+ create_condition_type(DefaultConditions.RUN_END_TIME, ConditionType.TIME_FIELD, "Run end time (last CODA update)")
136
+
137
+
@@ -1,7 +1,7 @@
1
- # This is the same as rcdb.cli.api:rcdb_cli
2
- # The logic to have it here, is that if one uses:
3
- # python -m rcdb - it works like 'rcdb' command
4
-
5
- from rcdb.cli.app import rcdb_cli
6
-
7
- rcdb_cli(prog_name="rcdb")
1
+ # This is the same as rcdb.cli.api:rcdb_cli
2
+ # The logic to have it here, is that if one uses:
3
+ # python -m rcdb - it works like 'rcdb' command
4
+
5
+ from rcdb.cli.app import rcdb_cli
6
+
7
+ rcdb_cli(prog_name="rcdb")