petal-qc 0.0.18__py3-none-any.whl → 0.0.20__py3-none-any.whl
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.
- petal_qc/__init__.py +1 -1
- petal_qc/metrology/petal_flatness.py +10 -9
- petal_qc/test/reportFromJSon.py +35 -8
- petal_qc/thermal/IRPetalParam.py +6 -1
- petal_qc/thermal/coreThermal.py +2 -2
- petal_qc/thermal/create_IRCore.py +0 -2
- petal_qc/thermal/create_core_report.py +0 -3
- {petal_qc-0.0.18.dist-info → petal_qc-0.0.20.dist-info}/METADATA +1 -1
- {petal_qc-0.0.18.dist-info → petal_qc-0.0.20.dist-info}/RECORD +12 -12
- {petal_qc-0.0.18.dist-info → petal_qc-0.0.20.dist-info}/WHEEL +1 -1
- {petal_qc-0.0.18.dist-info → petal_qc-0.0.20.dist-info}/entry_points.txt +0 -0
- {petal_qc-0.0.18.dist-info → petal_qc-0.0.20.dist-info}/top_level.txt +0 -0
petal_qc/__init__.py
CHANGED
|
@@ -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,
|
|
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,
|
|
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
|
|
278
|
+
if no_outliers:
|
|
279
279
|
for key, val in sensors.items():
|
|
280
|
-
|
|
281
|
-
|
|
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
|
|
petal_qc/test/reportFromJSon.py
CHANGED
|
@@ -6,23 +6,47 @@ from pathlib import Path
|
|
|
6
6
|
import json
|
|
7
7
|
|
|
8
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
|
+
|
|
9
20
|
|
|
10
21
|
def main(options):
|
|
11
22
|
"""main entry."""
|
|
12
23
|
petal_cores = {}
|
|
13
|
-
for
|
|
14
|
-
|
|
15
|
-
|
|
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:
|
|
16
38
|
data = json.load(fin)
|
|
17
39
|
|
|
18
40
|
if not data["passed"]:
|
|
19
41
|
petalId = data["component"]
|
|
20
|
-
if petalId
|
|
21
|
-
|
|
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": []}
|
|
22
46
|
|
|
23
47
|
side = "FRONT" if "FRONT" in data["testType"] else "BACK"
|
|
24
48
|
for D in data["defects"]:
|
|
25
|
-
petal_cores[
|
|
49
|
+
petal_cores[petal_id][side].append("{}: {}".format(D["name"], D["description"]))
|
|
26
50
|
|
|
27
51
|
|
|
28
52
|
keys = sorted(petal_cores.keys())
|
|
@@ -40,12 +64,15 @@ def main(options):
|
|
|
40
64
|
if __name__ == "__main__":
|
|
41
65
|
parser = argparse.ArgumentParser()
|
|
42
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) ")
|
|
43
69
|
opts = parser.parse_args()
|
|
44
70
|
|
|
45
|
-
from petal_qc.utils.all_files import all_files
|
|
46
71
|
|
|
72
|
+
folder = Path("/tmp/petal-metrology/results")
|
|
73
|
+
# folder = Path("~/tmp/petal-metrology/Production/Results").expanduser()
|
|
47
74
|
opts.files = []
|
|
48
|
-
for fnam in all_files(
|
|
75
|
+
for fnam in all_files(folder, "*.json"):
|
|
49
76
|
opts.files.append(fnam)
|
|
50
77
|
|
|
51
78
|
main(opts)
|
petal_qc/thermal/IRPetalParam.py
CHANGED
|
@@ -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
|
+
|
petal_qc/thermal/coreThermal.py
CHANGED
|
@@ -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.
|
|
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/PetalReceptionTests.py,sha256=cSrq4PUjdV7T16ARonhsnXWPBBRuvliTKlZwEPfgRVY,10832
|
|
2
|
-
petal_qc/__init__.py,sha256=
|
|
2
|
+
petal_qc/__init__.py,sha256=wWhkImfHsRq6bdiB9KpR1wF1DsTymn7ydqz71fLtYWw,1595
|
|
3
3
|
petal_qc/dashBoard.py,sha256=U_UHNMca3H2ogD4a0Vpe4ZVUKEv2-xmGZQEZ9_aH0E4,4034
|
|
4
4
|
petal_qc/getPetalCoreTestSummary.py,sha256=hTv4A8gcEkvCZLcy9ZkpwOevksz6LfK1Rb1-4ENlC7I,3706
|
|
5
5
|
petal_qc/BTreport/CheckBTtests.py,sha256=CoKTnW_7gbL42rVaBy9FnH1SEYifmgg1P5Iy253vDFk,9855
|
|
@@ -21,7 +21,7 @@ petal_qc/metrology/data2csv.py,sha256=2ttMSmfGLPIaOqZGima2dH6sdnSRAFTHlEbSOfW5eb
|
|
|
21
21
|
petal_qc/metrology/do_Metrology.py,sha256=wA3fKJrdDLGYd0lEi8uSP9uRwQeS59nX6F4VtNnm9LM,4356
|
|
22
22
|
petal_qc/metrology/flatness4nigel.py,sha256=SUHwn6pCEUWQV_62-_9-VKrmUdL4gVQcSA3aTtYq958,4071
|
|
23
23
|
petal_qc/metrology/gtkutils.py,sha256=1pOTxiE2EZR9zNNNT5cOetga_4NG9DzLaqQPI4c1EzE,3372
|
|
24
|
-
petal_qc/metrology/petal_flatness.py,sha256=
|
|
24
|
+
petal_qc/metrology/petal_flatness.py,sha256=f8UqAmwbSkOngFbwekeGq6cX5flSkd7JNhCYRIn39LE,10695
|
|
25
25
|
petal_qc/metrology/readAVSdata.py,sha256=6GRUac9b3iOoVoGfWr6rsNj1smsw9aT0tu5wuNuumAE,25615
|
|
26
26
|
petal_qc/metrology/show_data_file.py,sha256=yZPcmMy-1EWWySiBBx0hNB3tPVh19bTr0PDaXSyIF4c,4057
|
|
27
27
|
petal_qc/metrology/testSummary.py,sha256=0BhcEd1BPz2Mbonzi8nyZOzNSzpUqowBFNl5cVutqsk,994
|
|
@@ -39,7 +39,7 @@ petal_qc/test/getAVSjson.py,sha256=o8AYtyr7Vnp-enznmQ-NNiivZipmxtoVrmsfnRCl0X4,9
|
|
|
39
39
|
petal_qc/test/getAVStests.py,sha256=GNqEpncUQdvo-qSf46ltGVeezSnHB2BQsKjApS6xomY,10285
|
|
40
40
|
petal_qc/test/listPetalCoreComponents.py,sha256=7U9wokRkgeZdYZKeZdAadA32BlhVK6okInuh94hmj24,2502
|
|
41
41
|
petal_qc/test/prepareDESYfiles.py,sha256=uRir2fv0oGqB6hKnIqRltDW-oLz1tR2SDvVkMVxCfKI,4106
|
|
42
|
-
petal_qc/test/reportFromJSon.py,sha256=
|
|
42
|
+
petal_qc/test/reportFromJSon.py,sha256=GHx4Jk5_DTGiaxUd98mdnuFePsCqrJ_v86ufF0_wCBs,2296
|
|
43
43
|
petal_qc/test/test_Graphana.py,sha256=4wADxS_ObG9n4vsCvD1GwPQnx8bFUiUOS6ZwK83wTl8,1082
|
|
44
44
|
petal_qc/test/test_coreThermal.py,sha256=YRPK3DGG7Tz66K4Kka3euXgUDzW_JlIqSYicMBhb96E,1516
|
|
45
45
|
petal_qc/thermal/CSVImage.py,sha256=Vt2kYmUsZWkQvxcF8fDda3HO1Rb29kPQHnEoHFCqWYo,2038
|
|
@@ -49,16 +49,16 @@ petal_qc/thermal/IRBFile.py,sha256=_no8iUyuSQ41j34o3LVzUCjMYoviwjz02tsWvFsTUzA,2
|
|
|
49
49
|
petal_qc/thermal/IRCore.py,sha256=sidf7HtrzEUcllv0E_o1Hks-2_2dl4Og_LWcwgPNRcE,3062
|
|
50
50
|
petal_qc/thermal/IRDataGetter.py,sha256=S-Xaizrop_xQ2pgkvuw_HdKbrsDD84KThwgTfjRg0bQ,11579
|
|
51
51
|
petal_qc/thermal/IRPetal.py,sha256=hVOD0VAKTA2xvNXbZ-TXAYHNlihNWsUkI2i9IEwQhZk,40887
|
|
52
|
-
petal_qc/thermal/IRPetalParam.py,sha256=
|
|
52
|
+
petal_qc/thermal/IRPetalParam.py,sha256=PDf-IRB9Yz2PALNi5UdvammfRAJOzyaM0UlV1xbp_IU,4207
|
|
53
53
|
petal_qc/thermal/PetalColorMaps.py,sha256=6CvJHzRdojLHu3BROYSekHw8g_BJ1lJ_edyhovTIydU,3831
|
|
54
54
|
petal_qc/thermal/Petal_IR_Analysis.py,sha256=ALIER9fLn2R26IMhPVzEDL6tlK7XNbCtRtH0y6kTaEU,3950
|
|
55
55
|
petal_qc/thermal/PipeFit.py,sha256=8nEjpZC1mWh4-bhXzwXfjO8WkC_6hFYX0XXPjTHwNUw,18345
|
|
56
56
|
petal_qc/thermal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
57
|
petal_qc/thermal/analyze_IRCore.py,sha256=-MsKGJR-5pJV93ipLau0FHQeconLhMPDuLQIT9LMWsU,21115
|
|
58
58
|
petal_qc/thermal/contours.py,sha256=Bx4ghZhgZ4ya1rr4CZvjpqZd9M924Vms1oEGrgllWG4,8591
|
|
59
|
-
petal_qc/thermal/coreThermal.py,sha256=
|
|
60
|
-
petal_qc/thermal/create_IRCore.py,sha256=
|
|
61
|
-
petal_qc/thermal/create_core_report.py,sha256=
|
|
59
|
+
petal_qc/thermal/coreThermal.py,sha256=lBPyBm3Fo5uXBw6AIpzTY4Ku238Gr9lwm36Iihfbqp0,16203
|
|
60
|
+
petal_qc/thermal/create_IRCore.py,sha256=s3X-NBc6KdkqOG7kAcG5ldyTRSuommxIruzMFMu8CjQ,9183
|
|
61
|
+
petal_qc/thermal/create_core_report.py,sha256=32F7u7ffnLmGX5J_YP2oa8O_pI0euh9z3p0CTpA3-WM,6135
|
|
62
62
|
petal_qc/thermal/pipe_back.npz,sha256=yooZuVYtHU541HcV6Gh_5B0BqdYAVEvYAuVvMMSY7Jc,3632
|
|
63
63
|
petal_qc/thermal/pipe_front.npz,sha256=DuwruG9C2Z1rLigqWMApY4Orsf1SGUQGKy0Yan8Bk8A,3697
|
|
64
64
|
petal_qc/thermal/pipe_read.py,sha256=HrAtEbf8pMhJDETzkevodiTbuprIOh4yHv6PzpRoz7Q,5040
|
|
@@ -72,8 +72,8 @@ petal_qc/utils/docx_utils.py,sha256=zVmSKHDVE8cUwbXxqyPtgS0z62VCFya1DWklOpO1rCQ,
|
|
|
72
72
|
petal_qc/utils/fit_utils.py,sha256=3KUGWpBMV-bVDkQHWBigXot8chOpjAVBJ5H5b5dbdjk,5349
|
|
73
73
|
petal_qc/utils/readGraphana.py,sha256=YVOztJC3q3P7F0I9Ggeiu6Mv9rZLKgj3clkLCU7k4i4,1918
|
|
74
74
|
petal_qc/utils/utils.py,sha256=CqCsNIcEg6FQb3DN70tmqeLVLlQqsRfDzhfGevlnfBc,4035
|
|
75
|
-
petal_qc-0.0.
|
|
76
|
-
petal_qc-0.0.
|
|
77
|
-
petal_qc-0.0.
|
|
78
|
-
petal_qc-0.0.
|
|
79
|
-
petal_qc-0.0.
|
|
75
|
+
petal_qc-0.0.20.dist-info/METADATA,sha256=EHoZu8c1KUKkam4HCqJRmWP3cnu-AjydFTB4edKmmCI,953
|
|
76
|
+
petal_qc-0.0.20.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
77
|
+
petal_qc-0.0.20.dist-info/entry_points.txt,sha256=YPrZOsRBRsiKNDvsnbug0-Khj7DcN_Sdpq-tB_XjykI,505
|
|
78
|
+
petal_qc-0.0.20.dist-info/top_level.txt,sha256=CCo1Xe6kLS79PruhsB6bk2CuL9VFtNdNpgJjYUs4jk4,9
|
|
79
|
+
petal_qc-0.0.20.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|