petal-qc 0.0.18__tar.gz → 0.0.20__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 (85) hide show
  1. {petal_qc-0.0.18 → petal_qc-0.0.20}/PKG-INFO +1 -1
  2. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/__init__.py +1 -1
  3. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/petal_flatness.py +10 -9
  4. petal_qc-0.0.20/petal_qc/test/reportFromJSon.py +78 -0
  5. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/IRPetalParam.py +6 -1
  6. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/coreThermal.py +2 -2
  7. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/create_IRCore.py +0 -2
  8. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/create_core_report.py +0 -3
  9. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc.egg-info/PKG-INFO +1 -1
  10. {petal_qc-0.0.18 → petal_qc-0.0.20}/pyproject.toml +1 -1
  11. petal_qc-0.0.18/petal_qc/test/reportFromJSon.py +0 -51
  12. {petal_qc-0.0.18 → petal_qc-0.0.20}/README.md +0 -0
  13. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/BTreport/CheckBTtests.py +0 -0
  14. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/BTreport/__init__.py +0 -0
  15. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/BTreport/bustapeReport.py +0 -0
  16. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/PetalReceptionTests.py +0 -0
  17. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/dashBoard.py +0 -0
  18. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/getPetalCoreTestSummary.py +0 -0
  19. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/Cluster.py +0 -0
  20. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/DataFile.py +0 -0
  21. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/PetalMetrology.py +0 -0
  22. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/__init__.py +0 -0
  23. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/all2csv.py +0 -0
  24. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/analyze_locking_points.py +0 -0
  25. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/cold_noise.py +0 -0
  26. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/compare_Cores.py +0 -0
  27. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/comparisonTable.py +0 -0
  28. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/convert_mitutoyo.py +0 -0
  29. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/convert_smartscope.py +0 -0
  30. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/coreMetrology.py +0 -0
  31. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/data2csv.py +0 -0
  32. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/do_Metrology.py +0 -0
  33. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/flatness4nigel.py +0 -0
  34. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/gtkutils.py +0 -0
  35. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/readAVSdata.py +0 -0
  36. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/show_data_file.py +0 -0
  37. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/testSummary.py +0 -0
  38. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/test_paralelism.py +0 -0
  39. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/metrology/uploadPetalInformation.py +0 -0
  40. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/analyzeMetrologyTable.py +0 -0
  41. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/checkAVStests.py +0 -0
  42. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/checkCoreShipments.py +0 -0
  43. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/compare_golden.py +0 -0
  44. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/createMetrologyFile.py +0 -0
  45. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/createMetrologyTable.py +0 -0
  46. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/desyModuleBow.py +0 -0
  47. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/findRawData.py +0 -0
  48. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/getAVSjson.py +0 -0
  49. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/getAVStests.py +0 -0
  50. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/listPetalCoreComponents.py +0 -0
  51. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/prepareDESYfiles.py +0 -0
  52. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/test_Graphana.py +0 -0
  53. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/test/test_coreThermal.py +0 -0
  54. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/CSVImage.py +0 -0
  55. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/DESYdata.py +0 -0
  56. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/DebugPlot.py +0 -0
  57. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/IRBFile.py +0 -0
  58. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/IRCore.py +0 -0
  59. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/IRDataGetter.py +0 -0
  60. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/IRPetal.py +0 -0
  61. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/PetalColorMaps.py +0 -0
  62. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/Petal_IR_Analysis.py +0 -0
  63. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/PipeFit.py +0 -0
  64. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/__init__.py +0 -0
  65. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/analyze_IRCore.py +0 -0
  66. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/contours.py +0 -0
  67. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/pipe_back.npz +0 -0
  68. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/pipe_front.npz +0 -0
  69. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/pipe_read.py +0 -0
  70. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/thermal/show_IR_petal.py +0 -0
  71. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/utils/ArgParserUtils.py +0 -0
  72. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/utils/Geometry.py +0 -0
  73. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/utils/Progress.py +0 -0
  74. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/utils/__init__.py +0 -0
  75. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/utils/all_files.py +0 -0
  76. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/utils/docx_utils.py +0 -0
  77. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/utils/fit_utils.py +0 -0
  78. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/utils/readGraphana.py +0 -0
  79. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc/utils/utils.py +0 -0
  80. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc.egg-info/SOURCES.txt +0 -0
  81. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc.egg-info/dependency_links.txt +0 -0
  82. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc.egg-info/entry_points.txt +0 -0
  83. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc.egg-info/requires.txt +0 -0
  84. {petal_qc-0.0.18 → petal_qc-0.0.20}/petal_qc.egg-info/top_level.txt +0 -0
  85. {petal_qc-0.0.18 → petal_qc-0.0.20}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: petal_qc
3
- Version: 0.0.18
3
+ Version: 0.0.20
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
@@ -1,5 +1,5 @@
1
1
  """petal_qc python module."""
2
- __version__ = "0.0.18"
2
+ __version__ = "0.0.20"
3
3
 
4
4
 
5
5
  def coreMetrology():
@@ -24,10 +24,10 @@ from petal_qc.utils.Geometry import fit_plane
24
24
  from petal_qc.utils.Geometry import flatness_conhull, flatness_LSPL
25
25
  from petal_qc.utils.Geometry import project_to_plane
26
26
 
27
- from .analyze_locking_points import analyze_locking_point_data, locking_point_positions
28
- from .analyze_locking_points import remove_outliers
29
- from .Cluster import cluster_points
30
- from .show_data_file import show_data, TOP_VIEW
27
+ from petal_qc.metrology.analyze_locking_points import analyze_locking_point_data, locking_point_positions
28
+ from petal_qc.metrology.analyze_locking_points import remove_outliers
29
+ from petal_qc.metrology.Cluster import cluster_points
30
+ from petal_qc.metrology.show_data_file import show_data, TOP_VIEW
31
31
 
32
32
  figure_width = 14
33
33
 
@@ -132,7 +132,7 @@ def petal_flatness(orig_data, options, document=None):
132
132
 
133
133
  # group points by sensors.
134
134
  sensor_dict = {0: "R0", 10: "R1", 20: "R2", 30: "R3_0", 31: "R3_1", 40: "R4_0", 41: "R4_1", 50: "R5_0", 51: "R5_1"}
135
- sensors, *_ = group_by_sensors(M, options.is_front, False)
135
+ sensors, *_ = group_by_sensors(M, options.is_front, True)
136
136
  all_data = np.vstack(list(sensors.values()))
137
137
 
138
138
  fig = show_data(all_data, "All points in core", view=TOP_VIEW, surf=False)
@@ -257,7 +257,7 @@ def get_iring(P, is_front):
257
257
  return -1
258
258
 
259
259
 
260
- def group_by_sensors(Min, is_front=True, remove_outliers=False):
260
+ def group_by_sensors(Min, is_front=True, no_outliers=False):
261
261
  """Groups data points by sensors."""
262
262
  # Now move in Y to be on the ATLAS reference
263
263
  M = np.array(Min)
@@ -275,10 +275,11 @@ def group_by_sensors(Min, is_front=True, remove_outliers=False):
275
275
  else:
276
276
  sensors.setdefault(iring, []).append(P)
277
277
 
278
- if remove_outliers:
278
+ if no_outliers:
279
279
  for key, val in sensors.items():
280
- if remove_outliers:
281
- sensors[key] = remove_outliers(sensors[key][:, 2], 0.075)
280
+ points = np.vstack(val)
281
+ indx = remove_outliers(points[:, 2])
282
+ sensors[key] = points[indx, :]
282
283
 
283
284
  return sensors, np.array(other)
284
285
 
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env python3
2
+ """List failing cores from JSon files."""
3
+ import sys
4
+ import argparse
5
+ from pathlib import Path
6
+ import json
7
+
8
+
9
+ try:
10
+ import petal_qc
11
+
12
+ except ImportError:
13
+ cwd = Path(__file__).parent.parent
14
+ sys.path.append(cwd.as_posix())
15
+
16
+ from petal_qc.utils.ArgParserUtils import RangeListAction
17
+ from petal_qc.utils.all_files import all_files
18
+
19
+
20
+
21
+ def main(options):
22
+ """main entry."""
23
+ petal_cores = {}
24
+ for fpath in options.files:
25
+ fnam = str(fpath)
26
+ if "PPC." not in fnam:
27
+ continue
28
+
29
+ ipos = fnam.find("PPC")
30
+ lpos = fnam[ipos:].find("-")
31
+ petal_id = fnam[ipos:ipos+lpos]
32
+ pid = int(petal_id[4:])
33
+
34
+ if len(options.cores)>0 and pid not in options.cores:
35
+ continue
36
+
37
+ with open(fpath, "r", encoding="utf-8") as fin:
38
+ data = json.load(fin)
39
+
40
+ if not data["passed"]:
41
+ petalId = data["component"]
42
+ if petalId is None:
43
+ print("Petal {} has bad Serial number".format(petal_id))
44
+ if petal_id not in petal_cores:
45
+ petal_cores[petal_id] = {"FRONT": [], "BACK": []}
46
+
47
+ side = "FRONT" if "FRONT" in data["testType"] else "BACK"
48
+ for D in data["defects"]:
49
+ petal_cores[petal_id][side].append("{}: {}".format(D["name"], D["description"]))
50
+
51
+
52
+ keys = sorted(petal_cores.keys())
53
+ for petalId in keys:
54
+ print(petalId)
55
+ for side in ["FRONT","BACK"]:
56
+ if len(petal_cores[petalId][side])>0:
57
+ print("+-", side)
58
+ for D in petal_cores[petalId][side]:
59
+ print(" ", D)
60
+
61
+ print("\n")
62
+
63
+
64
+ if __name__ == "__main__":
65
+ parser = argparse.ArgumentParser()
66
+ parser.add_argument('files', nargs='*', help="Input files")
67
+ parser.add_argument("--cores", dest="cores", action=RangeListAction, default=[],
68
+ help="Create list of cores to analyze. The list is made with numbers or ranges (ch1:ch2 or ch1:ch2:step) ")
69
+ opts = parser.parse_args()
70
+
71
+
72
+ folder = Path("/tmp/petal-metrology/results")
73
+ # folder = Path("~/tmp/petal-metrology/Production/Results").expanduser()
74
+ opts.files = []
75
+ for fnam in all_files(folder, "*.json"):
76
+ opts.files.append(fnam)
77
+
78
+ main(opts)
@@ -26,8 +26,10 @@ class IRPetalParam(object):
26
26
  self.do_fit = True # True to fit the segment points.
27
27
  self.rotate = True # Rotate to have a vertical petal in mirror image
28
28
  self.debug = False # To debug
29
- self.report = False #
29
+ self.report = False #
30
30
  self.graphana = None # Graphana server
31
+ self.save_pipes = False # If true save pipe path
32
+ self.legend = True # if false do not plot legend
31
33
 
32
34
  if values is not None:
33
35
  self.set_values(values)
@@ -75,3 +77,6 @@ class IRPetalParam(object):
75
77
  help="Value to smooth contour")
76
78
  parser.add_argument("--debug", action="store_true", default=False, help="Show additional information.")
77
79
  parser.add_argument("--report", action="store_true", default=False, help="True if figures kept for the report.")
80
+ parser.add_argument("--save_pipes", default=False, action="store_true", help="SAve pipe path. Output is alias_pipe-i.txt")
81
+ parser.add_argument("--no-legend", dest="legend", action="store_false", default=True, help="Do not show the legend in plots.")
82
+
@@ -258,7 +258,7 @@ class CoreThermal(itkdb_gtk.dbGtkUtils.ITkDBWindow):
258
258
  if upper:
259
259
  self.dataBox.remove(self.btnData)
260
260
  self.dataBox.add(self.desyData)
261
-
261
+
262
262
  self.param.distance = 16
263
263
  self.param.width = 16
264
264
 
@@ -268,7 +268,7 @@ class CoreThermal(itkdb_gtk.dbGtkUtils.ITkDBWindow):
268
268
  if upper:
269
269
  self.dataBox.remove(self.desyData)
270
270
  self.dataBox.add(self.btnData)
271
-
271
+
272
272
  self.param.distance = 5
273
273
  self.param.width = 2
274
274
 
@@ -290,8 +290,6 @@ def main():
290
290
  parser.add_argument("--alias", default="", help="Alias")
291
291
  parser.add_argument("--SN", default="", help="serial number")
292
292
  parser.add_argument("--folder", default=None, help="Folder to store output files. Superseeds folder in --out")
293
- parser.add_argument("--no-legend", dest="legend", action="store_false", default=True, help="Do not show the legend in plots.")
294
- parser.add_argument("--save_pipes", default=False, action="store_true", help="SAve pipe path. Output is alias_pipe-i.txt")
295
293
 
296
294
  IRPetalParam.add_parameters(parser)
297
295
 
@@ -152,9 +152,6 @@ def main():
152
152
  parser.add_argument("--folder", default=None, help="Folder to store output files. Superseeds folder in --out")
153
153
  parser.add_argument("--add_attachments", action="store_true", default=False, help="If true add the attachments section os DB file.")
154
154
  parser.add_argument("--golden", default=None, help="The golden to compare width")
155
- parser.add_argument("--no-legend", dest="legend", action="store_false", default=True, help="Do not show the legend in plots.")
156
- parser.add_argument("--save_pipes", default=False, action="store_true", help="SAve pipe path. Output is alias_pipe-i.txt")
157
-
158
155
 
159
156
  IRPetalParam.add_parameters(parser)
160
157
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: petal_qc
3
- Version: 0.0.18
3
+ Version: 0.0.20
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "petal_qc"
7
- version = "0.0.18"
7
+ version = "0.0.20"
8
8
  authors = [
9
9
  { name="Carlos Lacasta", email="carlos.lacasta@cern.ch" },
10
10
  ]
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env python3
2
- """List failing cores from JSon files."""
3
- import sys
4
- import argparse
5
- from pathlib import Path
6
- import json
7
-
8
-
9
-
10
- def main(options):
11
- """main entry."""
12
- petal_cores = {}
13
- for fnam in options.files:
14
- ifile = Path(fnam).expanduser().resolve()
15
- with open(ifile, "r", encoding="utf-8") as fin:
16
- data = json.load(fin)
17
-
18
- if not data["passed"]:
19
- petalId = data["component"]
20
- if petalId not in petal_cores:
21
- petal_cores[petalId] = {"FRONT": [], "BACK": []}
22
-
23
- side = "FRONT" if "FRONT" in data["testType"] else "BACK"
24
- for D in data["defects"]:
25
- petal_cores[petalId][side].append("{}: {}".format(D["name"], D["description"]))
26
-
27
-
28
- keys = sorted(petal_cores.keys())
29
- for petalId in keys:
30
- print(petalId)
31
- for side in ["FRONT","BACK"]:
32
- if len(petal_cores[petalId][side])>0:
33
- print("+-", side)
34
- for D in petal_cores[petalId][side]:
35
- print(" ", D)
36
-
37
- print("\n")
38
-
39
-
40
- if __name__ == "__main__":
41
- parser = argparse.ArgumentParser()
42
- parser.add_argument('files', nargs='*', help="Input files")
43
- opts = parser.parse_args()
44
-
45
- from petal_qc.utils.all_files import all_files
46
-
47
- opts.files = []
48
- for fnam in all_files(Path("~/tmp/petal-metrology/Production/Results").expanduser(), "*.json"):
49
- opts.files.append(fnam)
50
-
51
- main(opts)
File without changes
File without changes