petal-qc 0.0.19__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.19 → petal_qc-0.0.20}/PKG-INFO +1 -1
  2. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/__init__.py +1 -1
  3. {petal_qc-0.0.19 → 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.19 → petal_qc-0.0.20}/petal_qc.egg-info/PKG-INFO +1 -1
  6. {petal_qc-0.0.19 → petal_qc-0.0.20}/pyproject.toml +1 -1
  7. petal_qc-0.0.19/petal_qc/test/reportFromJSon.py +0 -51
  8. {petal_qc-0.0.19 → petal_qc-0.0.20}/README.md +0 -0
  9. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/BTreport/CheckBTtests.py +0 -0
  10. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/BTreport/__init__.py +0 -0
  11. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/BTreport/bustapeReport.py +0 -0
  12. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/PetalReceptionTests.py +0 -0
  13. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/dashBoard.py +0 -0
  14. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/getPetalCoreTestSummary.py +0 -0
  15. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/Cluster.py +0 -0
  16. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/DataFile.py +0 -0
  17. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/PetalMetrology.py +0 -0
  18. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/__init__.py +0 -0
  19. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/all2csv.py +0 -0
  20. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/analyze_locking_points.py +0 -0
  21. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/cold_noise.py +0 -0
  22. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/compare_Cores.py +0 -0
  23. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/comparisonTable.py +0 -0
  24. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/convert_mitutoyo.py +0 -0
  25. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/convert_smartscope.py +0 -0
  26. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/coreMetrology.py +0 -0
  27. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/data2csv.py +0 -0
  28. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/do_Metrology.py +0 -0
  29. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/flatness4nigel.py +0 -0
  30. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/gtkutils.py +0 -0
  31. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/readAVSdata.py +0 -0
  32. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/show_data_file.py +0 -0
  33. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/testSummary.py +0 -0
  34. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/test_paralelism.py +0 -0
  35. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/metrology/uploadPetalInformation.py +0 -0
  36. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/analyzeMetrologyTable.py +0 -0
  37. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/checkAVStests.py +0 -0
  38. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/checkCoreShipments.py +0 -0
  39. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/compare_golden.py +0 -0
  40. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/createMetrologyFile.py +0 -0
  41. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/createMetrologyTable.py +0 -0
  42. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/desyModuleBow.py +0 -0
  43. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/findRawData.py +0 -0
  44. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/getAVSjson.py +0 -0
  45. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/getAVStests.py +0 -0
  46. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/listPetalCoreComponents.py +0 -0
  47. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/prepareDESYfiles.py +0 -0
  48. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/test_Graphana.py +0 -0
  49. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/test/test_coreThermal.py +0 -0
  50. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/CSVImage.py +0 -0
  51. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/DESYdata.py +0 -0
  52. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/DebugPlot.py +0 -0
  53. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/IRBFile.py +0 -0
  54. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/IRCore.py +0 -0
  55. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/IRDataGetter.py +0 -0
  56. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/IRPetal.py +0 -0
  57. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/IRPetalParam.py +0 -0
  58. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/PetalColorMaps.py +0 -0
  59. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/Petal_IR_Analysis.py +0 -0
  60. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/PipeFit.py +0 -0
  61. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/__init__.py +0 -0
  62. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/analyze_IRCore.py +0 -0
  63. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/contours.py +0 -0
  64. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/coreThermal.py +0 -0
  65. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/create_IRCore.py +0 -0
  66. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/create_core_report.py +0 -0
  67. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/pipe_back.npz +0 -0
  68. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/pipe_front.npz +0 -0
  69. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/pipe_read.py +0 -0
  70. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/thermal/show_IR_petal.py +0 -0
  71. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/utils/ArgParserUtils.py +0 -0
  72. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/utils/Geometry.py +0 -0
  73. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/utils/Progress.py +0 -0
  74. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/utils/__init__.py +0 -0
  75. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/utils/all_files.py +0 -0
  76. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/utils/docx_utils.py +0 -0
  77. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/utils/fit_utils.py +0 -0
  78. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/utils/readGraphana.py +0 -0
  79. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc/utils/utils.py +0 -0
  80. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc.egg-info/SOURCES.txt +0 -0
  81. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc.egg-info/dependency_links.txt +0 -0
  82. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc.egg-info/entry_points.txt +0 -0
  83. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc.egg-info/requires.txt +0 -0
  84. {petal_qc-0.0.19 → petal_qc-0.0.20}/petal_qc.egg-info/top_level.txt +0 -0
  85. {petal_qc-0.0.19 → 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.19
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.19"
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: petal_qc
3
- Version: 0.0.19
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.19"
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