rcdb 2.2.9__tar.gz → 2.3.0__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 (222) hide show
  1. {rcdb-2.2.9 → rcdb-2.3.0}/MANIFEST.in +11 -11
  2. {rcdb-2.2.9/rcdb.egg-info → rcdb-2.3.0}/PKG-INFO +65 -56
  3. {rcdb-2.2.9 → rcdb-2.3.0}/README.md +29 -26
  4. {rcdb-2.2.9 → rcdb-2.3.0}/pyproject.toml +73 -67
  5. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/__init__.py +137 -127
  6. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/__main__.py +7 -7
  7. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/alias.py +97 -90
  8. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/app_context.py +115 -100
  9. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/__main__.py +3 -3
  10. rcdb-2.3.0/rcdb/cli/add.py +139 -0
  11. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/app.py +70 -72
  12. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/context.py +5 -5
  13. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/db.py +224 -213
  14. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/info.py +58 -60
  15. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/ls.py +21 -23
  16. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/repair/__init__.py +12 -12
  17. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/repair/evio_files.py +143 -145
  18. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/rp.py +251 -254
  19. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/run.py +78 -76
  20. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/select.py +116 -84
  21. rcdb-2.3.0/rcdb/cli/test_data.py +133 -0
  22. rcdb-2.3.0/rcdb/cli/web.py +68 -0
  23. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/coda_parser.py +308 -308
  24. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/config_parser.py +99 -99
  25. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/errors.py +30 -30
  26. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/file_archiver.py +34 -34
  27. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/halld_daq_config_parser.py +75 -79
  28. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/lexer.py +1 -21
  29. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/model.py +514 -517
  30. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/provider.py +1503 -1455
  31. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/stopwatch.py +1 -0
  32. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/update.py +35 -34
  33. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/version.py +5 -5
  34. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/__init__.py +175 -112
  35. rcdb-2.3.0/rcdb/web/__main__.py +3 -0
  36. rcdb-2.3.0/rcdb/web/modules/__init__.py +16 -0
  37. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/modules/conditions.py +13 -18
  38. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/modules/files.py +31 -31
  39. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/modules/logs.py +23 -23
  40. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/modules/runs.py +279 -259
  41. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/modules/select_values.py +57 -57
  42. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/modules/statistics.py +28 -28
  43. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/pagination.py +42 -42
  44. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/run_table.py +5 -5
  45. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.bootstrap.css +187 -187
  46. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.bootstrap.min.css +1 -1
  47. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.foundation.css +117 -117
  48. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.foundation.min.css +1 -1
  49. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.jqueryui.css +482 -482
  50. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.jqueryui.min.css +1 -1
  51. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables.css +453 -453
  52. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables.min.css +1 -1
  53. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables_themeroller.css +416 -416
  54. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.bootstrap.js +219 -219
  55. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.bootstrap.min.js +9 -9
  56. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.foundation.js +156 -156
  57. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.foundation.min.js +8 -8
  58. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.jqueryui.js +164 -164
  59. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.jqueryui.min.js +9 -9
  60. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/js/jquery.dataTables.js +15212 -15212
  61. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/js/jquery.dataTables.min.js +164 -164
  62. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.bootstrap.css +178 -178
  63. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.bootstrap.min.css +1 -1
  64. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.dataTables.css +178 -178
  65. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.dataTables.min.css +1 -1
  66. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.foundation.css +181 -181
  67. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.foundation.min.css +1 -1
  68. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.jqueryui.css +178 -178
  69. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.jqueryui.min.css +1 -1
  70. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/js/dataTables.responsive.js +1149 -1149
  71. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/js/dataTables.responsive.min.js +23 -23
  72. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.bootstrap.js +78 -78
  73. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.bootstrap.min.js +7 -7
  74. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.foundation.js +62 -62
  75. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.foundation.min.js +6 -6
  76. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.jqueryui.js +63 -63
  77. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.jqueryui.min.js +6 -6
  78. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.bootstrap.css +22 -22
  79. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.bootstrap.min.css +1 -1
  80. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.dataTables.css +22 -22
  81. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.dataTables.min.css +1 -1
  82. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.foundation.css +22 -22
  83. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.foundation.min.css +1 -1
  84. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.jqueryui.css +22 -22
  85. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.jqueryui.min.css +1 -1
  86. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/RowReorder-1.1.0/js/dataTables.rowReorder.js +619 -619
  87. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/RowReorder-1.1.0/js/dataTables.rowReorder.min.js +15 -15
  88. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/datatables.css +671 -671
  89. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/datatables.js +16998 -16998
  90. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/datatables.min.css +21 -21
  91. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/datatables.min.js +220 -220
  92. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/bootstrap-theme.css +587 -587
  93. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/bootstrap-theme.min.css +5 -5
  94. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/bootstrap.css +6760 -6760
  95. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/bootstrap.min.css +5 -5
  96. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/buttons.dataTables.min.css +1 -1
  97. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/dataTables.tableTools.css +361 -361
  98. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/jquery-ui.min.css +6 -6
  99. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/jquery-ui.structure.min.css +4 -4
  100. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/jquery-ui.theme.min.css +4 -4
  101. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/jquery.dataTables.min.css +1 -1
  102. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/jquery.dataTables.yadcf.css +123 -123
  103. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/jquery.jsonview.css +52 -52
  104. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/main.css +232 -232
  105. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/select.dataTables.min.css +1 -1
  106. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/webintellisense.css +126 -126
  107. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/fonts/glyphicons-halflings-regular.svg +287 -287
  108. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/humans.txt +15 -15
  109. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/bootstrap.js +2363 -2363
  110. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/bootstrap.min.js +6 -6
  111. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/clipboard.min.js +6 -6
  112. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/copy_clipboard.js +51 -51
  113. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/dataTables.buttons.min.js +36 -36
  114. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/dataTables.select.min.js +25 -25
  115. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/jquery-2.1.0.min.js +5 -5
  116. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/jquery-2.1.4.min.js +4 -4
  117. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/jquery-ui.min.js +8 -8
  118. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/jquery.dataTables.min.js +166 -166
  119. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/jquery.dataTables.yadcf.js +4175 -4175
  120. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/jquery.flot.min.js +1 -1
  121. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/jquery.jsonview.js +284 -284
  122. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/npm.js +12 -12
  123. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/webintellisense-ace.js +380 -380
  124. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/webintellisense-codemirror.js +233 -233
  125. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/webintellisense-textbox.js +385 -385
  126. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/js/webintellisense.js +912 -912
  127. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/robots.txt +5 -5
  128. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/style.css +17 -17
  129. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/404.html +157 -157
  130. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/admin/index.html +7 -7
  131. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/admin/layout.html +9 -9
  132. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/admin/user.html +10 -10
  133. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/admin/users.html +27 -27
  134. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/conditions/index.html +28 -28
  135. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/custom_column_run_table.html +84 -84
  136. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/default_run_table.html +86 -86
  137. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/errors/forbidden_page.html +14 -14
  138. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/errors/layout.html +31 -31
  139. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/errors/page_not_found.html +15 -15
  140. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/errors/server_error.html +10 -10
  141. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/files/index.html +121 -121
  142. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/files/info.html +25 -25
  143. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/files/not_found.html +15 -15
  144. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/frontend/create_profile.html +10 -10
  145. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/frontend/footers/help.html +17 -17
  146. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/frontend/login.html +10 -10
  147. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/frontend/login_openid.html +11 -11
  148. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/frontend/reauth.html +10 -10
  149. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/frontend/reset_password.html +10 -10
  150. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/frontend/search.html +27 -27
  151. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/frontend/signup.html +10 -10
  152. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/index.html +157 -157
  153. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/layout.html +16 -16
  154. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/layouts/base.html +341 -327
  155. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/layouts/base2.html +328 -328
  156. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/login.html +13 -13
  157. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/logs/index.html +34 -34
  158. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/macros/_ask_user_to_update_ie.html +3 -3
  159. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/macros/_form.html +135 -135
  160. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/macros/_google_analytics.html +8 -8
  161. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/macros/_misc.html +42 -42
  162. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/macros/_reset_password.html +13 -13
  163. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/render_pagination.html +16 -16
  164. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/run_search_box.html +302 -302
  165. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/runs/conditions.html +90 -90
  166. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/runs/example.html +206 -206
  167. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/runs/index.html +189 -189
  168. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/runs/info.html +251 -251
  169. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/runs/not_found.html +26 -26
  170. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/select_values/index.html +119 -119
  171. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/settings/layout.html +9 -9
  172. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/settings/password.html +10 -10
  173. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/settings/profile.html +10 -10
  174. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/show_entries.html +20 -20
  175. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/statistics/index.html +78 -78
  176. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/user/index.html +7 -7
  177. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/templates/user/profile.html +7 -7
  178. {rcdb-2.2.9 → rcdb-2.3.0/rcdb.egg-info}/PKG-INFO +65 -56
  179. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb.egg-info/SOURCES.txt +6 -1
  180. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb.egg-info/requires.txt +7 -0
  181. {rcdb-2.2.9 → rcdb-2.3.0}/setup.cfg +4 -4
  182. rcdb-2.3.0/tests/test_cli_add_condition.py +139 -0
  183. rcdb-2.3.0/tests/test_cli_add_file.py +104 -0
  184. rcdb-2.3.0/tests/test_cli_add_type.py +86 -0
  185. {rcdb-2.2.9 → rcdb-2.3.0}/tests/test_coda_parser.py +65 -66
  186. {rcdb-2.2.9 → rcdb-2.3.0}/tests/test_conditions.py +229 -231
  187. {rcdb-2.2.9 → rcdb-2.3.0}/tests/test_config_parser.py +22 -22
  188. {rcdb-2.2.9 → rcdb-2.3.0}/tests/test_get_run_periods.py +95 -68
  189. {rcdb-2.2.9 → rcdb-2.3.0}/tests/test_get_runs.py +77 -77
  190. {rcdb-2.2.9 → rcdb-2.3.0}/tests/test_halld_run_config_parser.py +26 -27
  191. rcdb-2.3.0/tests/test_save_files.py +105 -0
  192. {rcdb-2.2.9 → rcdb-2.3.0}/tests/test_select_runs.py +171 -171
  193. {rcdb-2.2.9 → rcdb-2.3.0}/tests/test_select_values.py +122 -122
  194. {rcdb-2.2.9 → rcdb-2.3.0}/tests/test_sql_schema_version.py +52 -52
  195. {rcdb-2.2.9 → rcdb-2.3.0}/tests/test_value_comparison.py +35 -35
  196. rcdb-2.2.9/rcdb/cli/web.py +0 -29
  197. rcdb-2.2.9/rcdb/condition_query_builder.py +0 -34
  198. rcdb-2.2.9/rcdb/web/modules/__init__.py +0 -6
  199. rcdb-2.2.9/tests/test_save_files.py +0 -54
  200. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/cli/__init__.py +0 -0
  201. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/constants.py +0 -0
  202. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/log_format.py +0 -0
  203. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_asc.png +0 -0
  204. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_asc_disabled.png +0 -0
  205. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_both.png +0 -0
  206. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_desc.png +0 -0
  207. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_desc_disabled.png +0 -0
  208. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/bootstrap-theme.css.map +0 -0
  209. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/bootstrap-theme.min.css.map +0 -0
  210. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/bootstrap.css.map +0 -0
  211. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/css/bootstrap.min.css.map +0 -0
  212. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/favicon.png +0 -0
  213. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/fonts/glyphicons-halflings-regular.eot +0 -0
  214. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/fonts/glyphicons-halflings-regular.ttf +0 -0
  215. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/fonts/glyphicons-halflings-regular.woff +0 -0
  216. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/fonts/glyphicons-halflings-regular.woff2 +0 -0
  217. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/img/glyphicons-halflings-white.png +0 -0
  218. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/img/glyphicons-halflings.png +0 -0
  219. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb/web/static/img/logo.png +0 -0
  220. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb.egg-info/dependency_links.txt +0 -0
  221. {rcdb-2.2.9 → rcdb-2.3.0}/rcdb.egg-info/entry_points.txt +0 -0
  222. {rcdb-2.2.9 → rcdb-2.3.0}/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,65 @@
1
- Metadata-Version: 2.4
2
- Name: rcdb
3
- Version: 2.2.9
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.0
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. It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
46
+
47
+ The interfaces available are:
48
+ - Web site
49
+ - Command line interface (CLI)
50
+ - Python API
51
+ - C++ API
52
+ - Possibly JAVA API
53
+
54
+ #### Documentation:
55
+
56
+ https://jeffersonlab.github.io/rcdb/
57
+
58
+ #### Demo website:
59
+ One can visit HallD RCDB Web site as demo:
60
+ https://halldweb.jlab.org/rcdb/
61
+
62
+
63
+ #### SQLite db:
64
+ Daily updated SQLite database is available here:
65
+ https://halldweb.jlab.org/dist/rcdb2.sqlite
@@ -1,26 +1,29 @@
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
-
6
- 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.
7
-
8
- The interfaces available are:
9
- - Web site
10
- - Command line interface (CLI)
11
- - Python API
12
- - C++ API
13
- - Possibly JAVA API
14
-
15
- #### Documentation:
16
-
17
- https://jeffersonlab.github.io/rcdb/
18
-
19
- #### Demo website:
20
- One can visit HallD RCDB Web site as demo:
21
- https://halldweb.jlab.org/rcdb/
22
-
23
-
24
- #### SQLite db:
25
- Daily updated SQLite database is available here:
26
- https://halldweb.jlab.org/dist/rcdb2.sqlite
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. It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
10
+
11
+ The interfaces available are:
12
+ - Web site
13
+ - Command line interface (CLI)
14
+ - Python API
15
+ - C++ API
16
+ - Possibly JAVA API
17
+
18
+ #### Documentation:
19
+
20
+ https://jeffersonlab.github.io/rcdb/
21
+
22
+ #### Demo website:
23
+ One can visit HallD RCDB Web site as demo:
24
+ https://halldweb.jlab.org/rcdb/
25
+
26
+
27
+ #### SQLite db:
28
+ Daily updated SQLite database is available here:
29
+ https://halldweb.jlab.org/dist/rcdb2.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")