petal-qc 0.0.9__tar.gz → 0.0.11__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.

Potentially problematic release.


This version of petal-qc might be problematic. Click here for more details.

Files changed (75) hide show
  1. {petal_qc-0.0.9 → petal_qc-0.0.11}/PKG-INFO +2 -2
  2. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/BTreport/CheckBTtests.py +2 -6
  3. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/__init__.py +17 -1
  4. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/PetalMetrology.py +0 -5
  5. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/compare_Cores.py +27 -15
  6. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/coreMetrology.py +20 -10
  7. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/do_Metrology.py +0 -5
  8. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/petal_flatness.py +0 -4
  9. petal_qc-0.0.11/petal_qc/metrology/readAVSdata.py +762 -0
  10. petal_qc-0.0.11/petal_qc/metrology/uploadPetalInformation.py +769 -0
  11. petal_qc-0.0.11/petal_qc/test/checkAVStests.py +181 -0
  12. petal_qc-0.0.11/petal_qc/test/compare_golden.py +44 -0
  13. petal_qc-0.0.11/petal_qc/test/getAVSjson.py +27 -0
  14. petal_qc-0.0.11/petal_qc/test/getAVStests.py +263 -0
  15. petal_qc-0.0.11/petal_qc/test/getPetalCoreTestSummary.py +89 -0
  16. petal_qc-0.0.11/petal_qc/test/listPetalCoreComponents.py +89 -0
  17. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/test/prepareDESYfiles.py +25 -8
  18. petal_qc-0.0.11/petal_qc/thermal/DESYdata.py +58 -0
  19. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/IRBFile.py +51 -7
  20. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/IRCore.py +1 -1
  21. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/IRDataGetter.py +43 -24
  22. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/IRPetal.py +84 -7
  23. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/IRPetalParam.py +1 -1
  24. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/Petal_IR_Analysis.py +4 -3
  25. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/PipeFit.py +12 -3
  26. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/analyze_IRCore.py +24 -15
  27. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/coreThermal.py +124 -28
  28. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/create_IRCore.py +35 -9
  29. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/create_core_report.py +31 -8
  30. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/utils/Geometry.py +2 -2
  31. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/utils/readGraphana.py +2 -1
  32. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc.egg-info/PKG-INFO +2 -2
  33. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc.egg-info/SOURCES.txt +10 -0
  34. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc.egg-info/entry_points.txt +3 -0
  35. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc.egg-info/requires.txt +1 -1
  36. {petal_qc-0.0.9 → petal_qc-0.0.11}/pyproject.toml +5 -2
  37. {petal_qc-0.0.9 → petal_qc-0.0.11}/README.md +0 -0
  38. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/BTreport/__init__.py +0 -0
  39. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/BTreport/bustapeReport.py +0 -0
  40. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/dashBoard.py +0 -0
  41. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/Cluster.py +0 -0
  42. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/DataFile.py +0 -0
  43. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/__init__.py +0 -0
  44. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/all2csv.py +0 -0
  45. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/analyze_locking_points.py +0 -0
  46. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/cold_noise.py +0 -0
  47. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/comparisonTable.py +0 -0
  48. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/convert_mitutoyo.py +0 -0
  49. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/convert_smartscope.py +0 -0
  50. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/data2csv.py +0 -0
  51. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/flatness4nigel.py +0 -0
  52. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/gtkutils.py +0 -0
  53. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/show_data_file.py +0 -0
  54. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/testSummary.py +0 -0
  55. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/metrology/test_paralelism.py +0 -0
  56. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/test/test_Graphana.py +0 -0
  57. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/test/test_coreThermal.py +0 -0
  58. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/CSVImage.py +0 -0
  59. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/DebugPlot.py +0 -0
  60. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/PetalColorMaps.py +0 -0
  61. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/__init__.py +0 -0
  62. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/contours.py +0 -0
  63. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/pipe_back.npz +0 -0
  64. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/pipe_front.npz +0 -0
  65. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/pipe_read.py +0 -0
  66. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/thermal/show_IR_petal.py +0 -0
  67. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/utils/Progress.py +0 -0
  68. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/utils/__init__.py +0 -0
  69. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/utils/all_files.py +0 -0
  70. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/utils/docx_utils.py +0 -0
  71. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/utils/fit_utils.py +0 -0
  72. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc/utils/utils.py +0 -0
  73. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc.egg-info/dependency_links.txt +0 -0
  74. {petal_qc-0.0.9 → petal_qc-0.0.11}/petal_qc.egg-info/top_level.txt +0 -0
  75. {petal_qc-0.0.9 → petal_qc-0.0.11}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: petal_qc
3
- Version: 0.0.9
3
+ Version: 0.0.11
4
4
  Summary: A collection of scripts for Petal CORE QC.
5
5
  Author-email: Carlos Lacasta <carlos.lacasta@cern.ch>
6
6
  Project-URL: Homepage, https://gitlab.cern.ch/atlas-itk/sw/db/itk-pdb-gtk-gui-utils
@@ -10,7 +10,7 @@ Classifier: Operating System :: OS Independent
10
10
  Requires-Python: >=3.7
11
11
  Description-Content-Type: text/markdown
12
12
  Requires-Dist: itkdb
13
- Requires-Dist: itkdb_gtk
13
+ Requires-Dist: itkdb_gtk>=0.10.10
14
14
  Requires-Dist: numpy
15
15
  Requires-Dist: matplotlib
16
16
  Requires-Dist: lmfit
@@ -271,12 +271,8 @@ def main():
271
271
 
272
272
  except Exception:
273
273
  # Login with "standard" if the above fails.
274
- client = itkdb.Client()
275
- client.user._access_code1 = getpass.getpass("Access 1: ")
276
- client.user._access_code2 = getpass.getpass("Access 2: ")
277
- client.user.authenticate()
278
- print("Hello {} !".format(client.user.name))
279
-
274
+ client = ITkDButils.create_client()
275
+
280
276
  # Check the Bustape tests
281
277
  try:
282
278
  out = BTreport(client, SN)
@@ -1,5 +1,5 @@
1
1
  """petal_qc python module."""
2
- __version__ = "0.0.9"
2
+ __version__ = "0.0.11"
3
3
 
4
4
 
5
5
  def coreMetrology():
@@ -23,6 +23,22 @@ def bustapeReport():
23
23
  # from .BTreport.bustapeReport import main
24
24
  main()
25
25
 
26
+ def uploadPetalInformation():
27
+ """Read files from AVS nd create Petal core in PDB."""
28
+ from .metrology.uploadPetalInformation import main
29
+ main()
30
+
31
+ def createCoreThermalReport():
32
+ """Create a petal core thermal report."""
33
+ from .thermal.create_core_report import main
34
+ main()
35
+
36
+ def analyzeIRCore():
37
+ """Create a petal core thermal report."""
38
+ from .thermal.analyze_IRCore import main
39
+ main()
40
+
41
+
26
42
  def dashBoard():
27
43
  """Launches the Core thermal analysis ahd PDB script."""
28
44
  from .dashBoard import main
@@ -320,11 +320,6 @@ def do_petal_metrology():
320
320
  parser.add_argument("--save", dest='save', action="store_true", default=False)
321
321
  parser.add_argument("--out", dest="out", default="petal_flatness.docx",
322
322
  type=str, help="The output fiel name")
323
- parser.add_argument("--bottom-lp", dest='bLP', action=CommaSeparatedListAction, default=None,
324
- help="Bottom locking point fiducial coordinates")
325
- parser.add_argument("--upper-lp", dest='uLP', action=CommaSeparatedListAction, default=None,
326
- help="upper locking point fiducials coordinates")
327
-
328
323
  parser.add_argument("--title", dest="title", default=None,
329
324
  type=str, help="Document title")
330
325
  parser.add_argument("--nbins", dest="nbins", default=25,
@@ -77,17 +77,21 @@ def read_data_files(options):
77
77
  if not label in labels:
78
78
  labels.append(label)
79
79
 
80
- val = get_value(data, options.value)
81
- if "front" in tmp[1].lower():
82
- front[label] = val
83
- else:
84
- back[label] = val
80
+ try:
81
+ val = get_value(data, options.value)
82
+ if "front" in tmp[1].lower():
83
+ front[label] = val
84
+ else:
85
+ back[label] = val
86
+ except KeyError as E:
87
+ print("Error in {}:\n{}".format(fnam, E))
88
+ continue
85
89
 
86
90
  labels.sort()
87
91
 
88
92
  return front, back, labels
89
93
 
90
- def draw_deltas(data, keys, fnam=None, title="Front"):
94
+ def draw_deltas(data, keys, fnam=None, title="Front", draw_text=True):
91
95
  """Plot the position deltas."""
92
96
  key_table = {"Bot.": "PL01", "Slot": "PL02", "Top": "PL03",
93
97
  "Bot-FD01": "PL01-FD01", "Bot-FD02": "PL01-FD02", "FD01-FD02": "FD01-FD02" }
@@ -123,8 +127,9 @@ def draw_deltas(data, keys, fnam=None, title="Front"):
123
127
  LBL[k].append(label.split('.')[1].lstrip('0'))
124
128
 
125
129
  ax[i].scatter(P[i][:,0], P[i][:,1])
126
- for j in range(len(LBL[i])):
127
- ax[i].text(P[i][j,0], P[i][j,1], LBL[i][j]) #, ha='center', va='top')
130
+ if draw_text:
131
+ for j in range(len(LBL[i])):
132
+ ax[i].text(P[i][j,0], P[i][j,1], LBL[i][j]) #, ha='center', va='top')
128
133
 
129
134
  save_figure(fig, fnam, prefix=title)
130
135
 
@@ -142,10 +147,12 @@ def show_positions(options):
142
147
 
143
148
  front, back, labels = read_data_files(options)
144
149
  val_name = options.value.split('/')[-1]
145
- draw_deltas(front, keys, fnam=options.out, title="{} - Front".format(val_name))
146
- draw_deltas(back, keys, fnam=options.out, title="{} - Back".format(val_name))
150
+ draw_text = not options.no_legend
151
+ draw_deltas(front, keys, fnam=options.out, title="{} - Front".format(val_name), draw_text=draw_text)
152
+ draw_deltas(back, keys, fnam=options.out, title="{} - Back".format(val_name), draw_text=draw_text)
147
153
 
148
- plt.show()
154
+ if not options.no_show:
155
+ plt.show()
149
156
 
150
157
  def show_flatness(options):
151
158
  """Show flatness plots."""
@@ -177,9 +184,10 @@ def show_flatness(options):
177
184
  a.set_ylim(0, 1.2*max(y_lim[0][1], y_lim[1][1]))
178
185
  x_lim = a.get_xlim()
179
186
  a.fill_between(x_lim, 0, 0.050, facecolor="darkseagreen", alpha=0.1)
180
- a.legend(ncol=3, fontsize="x-small")
187
+ if not options.no_legend:
188
+ a.legend(ncol=3, fontsize="x-small")
181
189
 
182
- save_figure(fig, options.out, prefix=opts.prefix)
190
+ save_figure(fig, options.out, prefix=options.prefix)
183
191
 
184
192
  def main(options):
185
193
  """Main entry."""
@@ -204,11 +212,13 @@ def main(options):
204
212
  vback = [back[x] for x in labels]
205
213
  ax.plot(X, vfront, '*', label="Front")
206
214
  ax.plot(X, vback, 'o', label="Back")
207
- ax.legend()
215
+ if not options.no_legend:
216
+ ax.legend()
208
217
 
209
218
  save_figure(fig, options.out, prefix=options.prefix)
210
219
 
211
- plt.show()
220
+ if not options.no_show:
221
+ plt.show()
212
222
 
213
223
 
214
224
  if __name__ == "__main__":
@@ -218,6 +228,8 @@ if __name__ == "__main__":
218
228
  parser.add_argument("--value", default=None, help="Value to plot")
219
229
  parser.add_argument("--prefix", default=None, help="prefix for out file")
220
230
  parser.add_argument("--out", default=None, help="File to store the figure.")
231
+ parser.add_argument("--no-legend", dest="no_legend", default=False, action="store_true", help="Do not draw the legend")
232
+ parser.add_argument("--no-show", dest="no_show", default=False, action="store_true", help="Do not show the figure")
221
233
 
222
234
  opts = parser.parse_args()
223
235
  if len(opts.files) == 0:
@@ -16,7 +16,7 @@ import gi
16
16
  gi.require_version("Gtk", "3.0")
17
17
  from gi.repository import Gtk, GObject, Gio, GLib
18
18
 
19
- __HELP__ = "https://petal-qc.docs.cern.ch"
19
+ __HELP__ = "https://petal-qc.docs.cern.ch/metrology.html"
20
20
 
21
21
  class CommaSeparatedListAction(Action):
22
22
  """Create a list from the comma sepparated numbers at imput."""
@@ -89,14 +89,11 @@ class CoreMetrology(itkdb_gtk.dbGtkUtils.ITkDBWindow):
89
89
  # The Serial number
90
90
  self.SN = itkdb_gtk.dbGtkUtils.TextEntry()
91
91
  self.SN.connect("text-changed", self.on_SN_changed)
92
- if options.SN:
93
- self.on_SN_changed(self.SN.entry, options.SN)
94
92
 
95
93
  # The prefix
96
94
  self.prefix = Gtk.Entry()
97
- if options.prefix:
98
- self.SN.set_text(options.prefix)
99
95
 
96
+ # The switch
100
97
  self.desy = Gtk.Switch()
101
98
  self.desy.props.halign = Gtk.Align.START
102
99
 
@@ -147,6 +144,22 @@ class CoreMetrology(itkdb_gtk.dbGtkUtils.ITkDBWindow):
147
144
 
148
145
  self.mainBox.pack_start(self.message_panel.frame, True, True, 0)
149
146
 
147
+ if self.options.SN:
148
+ self.on_SN_changed(self.SN.entry, self.options.SN)
149
+
150
+ if self.options.is_front:
151
+ self.back.set_active(True)
152
+
153
+ if self.options.folder:
154
+ the_folder = Gio.File.new_for_path(self.options.folder)
155
+ self.btnFolder.set_file(the_folder)
156
+ self.on_folder_set(None)
157
+
158
+ if len(self.options.files)>0:
159
+ the_file = Gio.File.new_for_path(self.options.files[0])
160
+ self.btnData.set_file(the_file)
161
+ self.on_file_set(None)
162
+
150
163
 
151
164
  def quit(self, *args):
152
165
  """Quits the application."""
@@ -354,15 +367,12 @@ def main():
354
367
  parser.add_argument('files', nargs='*', help="Input files")
355
368
  parser.add_argument("--prefix", dest='prefix', default=None)
356
369
  parser.add_argument("--SN", dest='SN', default=None)
370
+ parser.add_argument("--front", dest='is_front', action="store_true", default=False)
371
+
357
372
  parser.add_argument("--save", dest='save', action="store_true", default=False)
358
373
  parser.add_argument("--desy", dest='desy', action="store_true", default=False)
359
374
  parser.add_argument("--out", dest="out", default="petal_flatness.docx",
360
375
  type=str, help="The output fiel name")
361
- parser.add_argument("--bottom-lp", dest='bLP', action=CommaSeparatedListAction, default=None,
362
- help="Bottom locking point fiducial coordinates")
363
- parser.add_argument("--upper-lp", dest='uLP', action=CommaSeparatedListAction, default=None,
364
- help="upper locking point fiducials coordinates")
365
-
366
376
  parser.add_argument("--title", dest="title", default=None,
367
377
  type=str, help="Document title")
368
378
  parser.add_argument("--nbins", dest="nbins", default=25,
@@ -96,11 +96,6 @@ def main():
96
96
  parser.add_argument("--desy", dest='desy', action="store_true", default=False, help="True if data is from DESY's SmartScope")
97
97
  parser.add_argument("--out", dest="out", default="petal_flatness.docx",
98
98
  type=str, help="The output file name")
99
- parser.add_argument("--bottom-lp", dest='bLP', action=CommaSeparatedListAction, default=None,
100
- help="Bottom locking point fiducial coordinates")
101
- parser.add_argument("--upper-lp", dest='uLP', action=CommaSeparatedListAction, default=None,
102
- help="upper locking point fiducials coordinates")
103
-
104
99
  parser.add_argument("--title", dest="title", default=None,
105
100
  type=str, help="Report Document title")
106
101
  parser.add_argument("--nbins", dest="nbins", default=25,
@@ -328,10 +328,6 @@ if __name__ == "__main__":
328
328
  parser.add_argument("--save", dest='save', action="store_true", default=False)
329
329
  parser.add_argument("--front", dest='is_front', action="store_true", default=True)
330
330
  parser.add_argument("--back", dest='is_front', action="store_false", default=True)
331
- parser.add_argument("--bottom-lp", dest='bLP', action=CommaSeparatedListAction, default=None,
332
- help="Bottom locking point fiducial coordinates")
333
- parser.add_argument("--upper-lp", dest='uLP', action=CommaSeparatedListAction, default=None,
334
- help="upper locking point fiducials coordinates")
335
331
  parser.add_argument("--out", dest="out", default="petal_flatness.docx",
336
332
  type=str, help="The output fiel name")
337
333
  parser.add_argument("--title", dest="title", default=None,