pygeosimplify 0.0.13__tar.gz → 0.0.14__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.
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/PKG-INFO +8 -7
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/geo/base.py +2 -2
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/simplify/layer.py +21 -17
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/simplify/post_process.py +4 -2
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/vis/cylinder.py +3 -1
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/vis/geo.py +22 -21
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/vis/scene.py +7 -5
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pyproject.toml +15 -12
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/LICENSE +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/README.md +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/__init__.py +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/cfg/config.py +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/cfg/test_data.py +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/coordinate/definitions.py +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/geo/cells.py +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/io/geo_handler.py +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/simplify/cylinder.py +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/simplify/detector.py +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/simplify/helpers.py +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/utils/message_type.py +0 -0
- {pygeosimplify-0.0.13 → pygeosimplify-0.0.14}/pygeosimplify/utils/path_resolver.py +0 -0
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pygeosimplify
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.14
|
|
4
4
|
Summary: Python package for automatic, cell-based inference of clash-free simplified detector geometry.
|
|
5
5
|
Author: Joshua Falco Beirer
|
|
6
6
|
Author-email: jbeirer@cern.ch
|
|
7
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.9,<3.13
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
9
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
13
|
Requires-Dist: distinctipy (>=1.3.4,<2.0.0)
|
|
13
|
-
Requires-Dist: matplotlib (>=3.
|
|
14
|
-
Requires-Dist: numpy (>=2.2
|
|
14
|
+
Requires-Dist: matplotlib (>=3.9.0,<4.0.0)
|
|
15
|
+
Requires-Dist: numpy (>=2.0.2,<3.0.0)
|
|
15
16
|
Requires-Dist: pandas (>=2.2.3,<3.0.0)
|
|
16
|
-
Requires-Dist: pyg4ometry (
|
|
17
|
-
Requires-Dist: scipy (>=1.
|
|
17
|
+
Requires-Dist: pyg4ometry (==1.3.2)
|
|
18
|
+
Requires-Dist: scipy (>=1.13.1,<2.0.0)
|
|
18
19
|
Requires-Dist: tqdm (>=4.67.1,<5.0.0)
|
|
19
|
-
Requires-Dist: uproot (>=5.
|
|
20
|
+
Requires-Dist: uproot (>=5.6.0,<6.0.0)
|
|
20
21
|
Description-Content-Type: text/markdown
|
|
21
22
|
|
|
22
23
|
<img src=https://github.com/jbeirer/pygeosimplify/raw/main/docs/logo.svg alt="Logo" width="250">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any, Union
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
|
|
@@ -61,7 +61,7 @@ class Cell(VertexSet):
|
|
|
61
61
|
def __init__(
|
|
62
62
|
self,
|
|
63
63
|
vertices: np.ndarray,
|
|
64
|
-
facecolor: tuple[float, float, float]
|
|
64
|
+
facecolor: Union[tuple[float, float, float], str] = "tab:orange",
|
|
65
65
|
alpha: float = 0.1,
|
|
66
66
|
edgecolor: tuple = (1, 1, 1, 1),
|
|
67
67
|
edgewidth: float = 1,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
|
|
1
3
|
import matplotlib.pyplot as plt
|
|
2
4
|
import numpy as np
|
|
3
5
|
import pandas as pd
|
|
@@ -25,7 +27,7 @@ class GeoLayer:
|
|
|
25
27
|
The coordinate system used to represent the cell positions.
|
|
26
28
|
is_barrel : bool
|
|
27
29
|
True if the layer is a barrel layer, False otherwise.
|
|
28
|
-
cells :
|
|
30
|
+
cells : list[Union[XYZCell, EtaPhiRCell, EtaPhiZCell, RPhiZCell]]
|
|
29
31
|
A list of cell objects representing the cells in the layer.
|
|
30
32
|
extent : dict
|
|
31
33
|
A dictionary containing the minimum and maximum values of r and z coordinates of the cells in the layer.
|
|
@@ -77,7 +79,9 @@ class GeoLayer:
|
|
|
77
79
|
return coordinate_system
|
|
78
80
|
raise Exception(f"Could not infer set coordinate system found for layer {self.idx}.")
|
|
79
81
|
|
|
80
|
-
def _get_cells(
|
|
82
|
+
def _get_cells(
|
|
83
|
+
self, df: pd.DataFrame
|
|
84
|
+
) -> Union[list[XYZCell], list[EtaPhiRCell], list[EtaPhiZCell], list[RPhiZCell]]:
|
|
81
85
|
"""
|
|
82
86
|
Returns a list of cell objects representing the cells in the layer.
|
|
83
87
|
|
|
@@ -88,46 +92,46 @@ class GeoLayer:
|
|
|
88
92
|
|
|
89
93
|
Returns:
|
|
90
94
|
--------
|
|
91
|
-
Union[
|
|
95
|
+
Union[list[XYZCell], list[EtaPhiRCell], list[EtaPhiZCell], list[RPhiZCell]]:
|
|
92
96
|
A list of cell objects representing the cells in the layer.
|
|
93
97
|
"""
|
|
94
98
|
if self.coordinate_system == "XYZ":
|
|
95
99
|
return [
|
|
96
100
|
XYZCell(dx, dy, dz, pos=XYZ(x, y, z))
|
|
97
|
-
for dx, dy, dz, x, y, z in zip(df.dx, df.dy, df.dz, df.x, df.y, df.z
|
|
101
|
+
for dx, dy, dz, x, y, z in zip(df.dx, df.dy, df.dz, df.x, df.y, df.z)
|
|
98
102
|
]
|
|
99
103
|
elif self.coordinate_system == "EtaPhiR":
|
|
100
104
|
return [
|
|
101
105
|
EtaPhiRCell(deta, dphi, dr, pos=EtaPhiR(eta, phi, r))
|
|
102
|
-
for deta, dphi, dr, eta, phi, r in zip(df.deta, df.dphi, df.dr, df.eta, df.phi, df.r
|
|
106
|
+
for deta, dphi, dr, eta, phi, r in zip(df.deta, df.dphi, df.dr, df.eta, df.phi, df.r)
|
|
103
107
|
]
|
|
104
108
|
elif self.coordinate_system == "EtaPhiZ":
|
|
105
109
|
return [
|
|
106
110
|
EtaPhiZCell(deta, dphi, dz, pos=EtaPhiZ(eta, phi, z))
|
|
107
|
-
for deta, dphi, dz, eta, phi, z in zip(df.deta, df.dphi, df.dz, df.eta, df.phi, df.z
|
|
111
|
+
for deta, dphi, dz, eta, phi, z in zip(df.deta, df.dphi, df.dz, df.eta, df.phi, df.z)
|
|
108
112
|
]
|
|
109
113
|
elif self.coordinate_system == "RPhiZ":
|
|
110
114
|
return [
|
|
111
115
|
RPhiZCell(dr, dphi, dz, pos=RPhiZ(r, phi, z))
|
|
112
|
-
for dr, dphi, dz, r, phi, z in zip(df.dr, df.dphi, df.dz, df.r, df.phi, df.z
|
|
116
|
+
for dr, dphi, dz, r, phi, z in zip(df.dr, df.dphi, df.dz, df.r, df.phi, df.z)
|
|
113
117
|
]
|
|
114
118
|
else:
|
|
115
119
|
raise Exception(f"Invalid coordinate system {self.coordinate_system}.")
|
|
116
120
|
|
|
117
121
|
def _cell_vertices_rz(
|
|
118
|
-
self, cells: list[XYZCell]
|
|
122
|
+
self, cells: Union[list[XYZCell], list[EtaPhiRCell], list[EtaPhiZCell], list[RPhiZCell]]
|
|
119
123
|
) -> tuple[list[float], list[float]]:
|
|
120
124
|
"""
|
|
121
125
|
Returns the r and z values of the cell vertices in the layer.
|
|
122
126
|
|
|
123
127
|
Parameters:
|
|
124
128
|
-----------
|
|
125
|
-
cells : Union[
|
|
129
|
+
cells : Union[list[XYZCell], list[EtaPhiRCell], list[EtaPhiZCell], list[RPhiZCell]]
|
|
126
130
|
A list of XYZ, EtaPhiR, EtaPhiZ or RPhiZCell cells.
|
|
127
131
|
|
|
128
132
|
Returns:
|
|
129
133
|
--------
|
|
130
|
-
|
|
134
|
+
tuple[list[float], list[float]]:
|
|
131
135
|
A tuple containing the r and z values of cell vertices.
|
|
132
136
|
"""
|
|
133
137
|
vertex_list = np.concatenate([cell.vertices for cell in cells], axis=0)
|
|
@@ -148,14 +152,14 @@ class GeoLayer:
|
|
|
148
152
|
return r_values, z_values
|
|
149
153
|
|
|
150
154
|
def _min_max_rz_extent(
|
|
151
|
-
self, cells: list[XYZCell]
|
|
155
|
+
self, cells: Union[list[XYZCell], list[EtaPhiRCell], list[EtaPhiZCell], list[RPhiZCell]]
|
|
152
156
|
) -> dict:
|
|
153
157
|
"""
|
|
154
158
|
Returns a dictionary containing the minimum and maximum values of r and z coordinates of the cells in the layer.
|
|
155
159
|
|
|
156
160
|
Parameters:
|
|
157
161
|
-----------
|
|
158
|
-
cells : Union[
|
|
162
|
+
cells : Union[list[XYZCell], list[EtaPhiRCell], list[EtaPhiZCell], list[RPhiZCell]]
|
|
159
163
|
A list of cell objects representing the cells in the layer.
|
|
160
164
|
|
|
161
165
|
Returns:
|
|
@@ -217,8 +221,8 @@ class GeoLayer:
|
|
|
217
221
|
|
|
218
222
|
def plot_cell_vertices_rz(
|
|
219
223
|
self,
|
|
220
|
-
ax: None
|
|
221
|
-
color: tuple[float, float, float]
|
|
224
|
+
ax: Union[None, plt.Axes] = None,
|
|
225
|
+
color: Union[tuple[float, float, float], str] = "tab:blue",
|
|
222
226
|
marker_size: float = 0.01,
|
|
223
227
|
x_label: str = "z",
|
|
224
228
|
y_label: str = "r",
|
|
@@ -258,7 +262,7 @@ class GeoLayer:
|
|
|
258
262
|
return ax
|
|
259
263
|
|
|
260
264
|
def plot_symmetrized_cylinder(
|
|
261
|
-
self, cyl: Cylinder, ax: Axes3D = None, color: tuple[float, float, float]
|
|
265
|
+
self, cyl: Cylinder, ax: Axes3D = None, color: Union[tuple[float, float, float], str] = "black"
|
|
262
266
|
) -> Axes3D:
|
|
263
267
|
# If layer is continuous in z, plot as single cylinder
|
|
264
268
|
if self.is_continuous_in_z():
|
|
@@ -271,7 +275,7 @@ class GeoLayer:
|
|
|
271
275
|
plot_cylinder(cyl_pos_z_halfspace, ax=ax, color=color)
|
|
272
276
|
plot_cylinder(cyl_neg_z_halfspace, ax=ax, color=color)
|
|
273
277
|
|
|
274
|
-
def plot_thinned_cylinder(self, ax: Axes3D = None, color: tuple[float, float, float]
|
|
278
|
+
def plot_thinned_cylinder(self, ax: Axes3D = None, color: Union[tuple[float, float, float], str] = "red") -> Axes3D:
|
|
275
279
|
"""
|
|
276
280
|
Plots the thinned version of the layer in 3D space.
|
|
277
281
|
|
|
@@ -297,7 +301,7 @@ class GeoLayer:
|
|
|
297
301
|
|
|
298
302
|
return ax
|
|
299
303
|
|
|
300
|
-
def plot_cell_envelope(self, ax: Axes3D = None, color: tuple[float, float, float]
|
|
304
|
+
def plot_cell_envelope(self, ax: Axes3D = None, color: Union[tuple[float, float, float], str] = "red") -> Axes3D:
|
|
301
305
|
"""
|
|
302
306
|
Plots the envelope of the cells in the layer in 3D space.
|
|
303
307
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
|
|
1
3
|
import pandas as pd
|
|
2
4
|
|
|
3
5
|
from pygeosimplify.simplify.cylinder import Cylinder
|
|
@@ -155,7 +157,7 @@ def get_cylinder_envelope(df: pd.DataFrame, min_dist: float, envelope_width: flo
|
|
|
155
157
|
return envelope_dict
|
|
156
158
|
|
|
157
159
|
|
|
158
|
-
def get_cyl_limiting_r_extension(df: pd.DataFrame, layer: pd.DataFrame, side: str = "OUT") -> Cylinder
|
|
160
|
+
def get_cyl_limiting_r_extension(df: pd.DataFrame, layer: pd.DataFrame, side: str = "OUT") -> Union[Cylinder, None]:
|
|
159
161
|
if side not in ["OUT", "IN"]:
|
|
160
162
|
raise ValueError("side must be either OUT or IN")
|
|
161
163
|
|
|
@@ -193,7 +195,7 @@ def get_cyl_limiting_r_extension(df: pd.DataFrame, layer: pd.DataFrame, side: st
|
|
|
193
195
|
return limiting_cyl
|
|
194
196
|
|
|
195
197
|
|
|
196
|
-
def get_cyl_limiting_z_extension(df: pd.DataFrame, layer: pd.DataFrame, side: str = "RIGHT") -> Cylinder
|
|
198
|
+
def get_cyl_limiting_z_extension(df: pd.DataFrame, layer: pd.DataFrame, side: str = "RIGHT") -> Union[Cylinder, None]:
|
|
197
199
|
if side not in ["RIGHT", "LEFT"]:
|
|
198
200
|
raise ValueError("side must be either RIGHT or LEFT")
|
|
199
201
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
|
|
1
3
|
import matplotlib.pyplot as plt
|
|
2
4
|
import numpy as np
|
|
3
5
|
from mpl_toolkits.mplot3d import Axes3D
|
|
@@ -60,7 +62,7 @@ def generate_cylinder_endcap_points(rmin: float, rmax: float, z: float, linspace
|
|
|
60
62
|
def plot_cylinder(
|
|
61
63
|
cylinder: Cylinder,
|
|
62
64
|
ax: Axes3D = None,
|
|
63
|
-
color: tuple[float, float, float]
|
|
65
|
+
color: Union[tuple[float, float, float], str] = "black",
|
|
64
66
|
alpha: float = 0.2,
|
|
65
67
|
linspace_count: int = 300,
|
|
66
68
|
) -> Axes3D:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any
|
|
1
|
+
from typing import Any, Optional, Union
|
|
2
2
|
|
|
3
3
|
import matplotlib.colors as mcolors
|
|
4
4
|
import matplotlib.pyplot as plt
|
|
@@ -16,14 +16,14 @@ from pygeosimplify.vis.scene import CellScene
|
|
|
16
16
|
|
|
17
17
|
def plot_geometry( # noqa: C901
|
|
18
18
|
df: pd.DataFrame,
|
|
19
|
-
ax: Axes3D = None,
|
|
20
|
-
layer_list: list[int]
|
|
21
|
-
eta_range: list
|
|
22
|
-
phi_range: list
|
|
23
|
-
axis_labels: list
|
|
24
|
-
color: str
|
|
19
|
+
ax: Union[None, Axes3D] = None,
|
|
20
|
+
layer_list: Optional[list[int]] = None,
|
|
21
|
+
eta_range: Optional[list] = None,
|
|
22
|
+
phi_range: Optional[list] = None,
|
|
23
|
+
axis_labels: Optional[list] = None,
|
|
24
|
+
color: Optional[str] = None,
|
|
25
25
|
unit_scale: float = 1,
|
|
26
|
-
cell_energy_col: str
|
|
26
|
+
cell_energy_col: Optional[str] = None,
|
|
27
27
|
unit_scale_energy: float = 1,
|
|
28
28
|
energy_label: str = "Cell Energy",
|
|
29
29
|
color_map: str = "gist_heat_r",
|
|
@@ -34,10 +34,10 @@ def plot_geometry( # noqa: C901
|
|
|
34
34
|
Parameters:
|
|
35
35
|
df (pd.DataFrame): The DataFrame containing the geometry data.
|
|
36
36
|
ax (Axes3D, optional): The 3D axes to plot on. If not provided, a new figure and axes will be created.
|
|
37
|
-
layer_list (
|
|
38
|
-
eta_range (
|
|
39
|
-
phi_range (
|
|
40
|
-
axis_labels (
|
|
37
|
+
layer_list (list[int], optional): The list of layers to consider. If not provided, all layers will be considered.
|
|
38
|
+
eta_range (list, optional): The range of eta values to filter the data. If not provided, the default range is [-5, 5].
|
|
39
|
+
phi_range (list, optional): The range of phi values to filter the data. If not provided, the default range is [0, np.pi].
|
|
40
|
+
axis_labels (list, optional): The labels for the x, y, and z axes. If not provided, the default labels are ["x", "y", "z"].
|
|
41
41
|
color (str, optional): The color to use for the cells. If not provided, colors will be automatically assigned based on the layers.
|
|
42
42
|
unit_scale (float, optional): The scale factor for the unit of measurement. Default is 1.
|
|
43
43
|
cell_energy_col (str, optional): The name of the column containing the cell energy values. If provided, the cells will be colored based on the energy values.
|
|
@@ -75,7 +75,7 @@ def plot_geometry( # noqa: C901
|
|
|
75
75
|
|
|
76
76
|
if not cell_energy_col:
|
|
77
77
|
# Create a color dict mapping a layer to a color
|
|
78
|
-
layer_color_dict = dict(zip(layer_list, get_colors(len(layer_list), rng=0)
|
|
78
|
+
layer_color_dict = dict(zip(layer_list, get_colors(len(layer_list), rng=0)))
|
|
79
79
|
# If color is specifically provided, override the color dict
|
|
80
80
|
if color:
|
|
81
81
|
layer_color_dict = {layer: color for layer in layer_list}
|
|
@@ -117,7 +117,8 @@ def plot_geometry( # noqa: C901
|
|
|
117
117
|
# Regularize x,y limits so that limits are identical for x and y (to avoid distortions)
|
|
118
118
|
minMaxX = vis.min_max_cell_list_extent(0)
|
|
119
119
|
minMaxY = vis.min_max_cell_list_extent(1)
|
|
120
|
-
minMax =
|
|
120
|
+
minMax: tuple[float, float] = (min(minMaxX[0], minMaxY[0]), max(minMaxX[1], minMaxY[1]))
|
|
121
|
+
|
|
121
122
|
ax.set_xlim(minMax)
|
|
122
123
|
ax.set_ylim(minMax)
|
|
123
124
|
|
|
@@ -130,8 +131,8 @@ def filter_df_eta_phi(df: pd.DataFrame, eta_range: list, phi_range: list) -> pd.
|
|
|
130
131
|
|
|
131
132
|
Args:
|
|
132
133
|
df (pd.DataFrame): The DataFrame to filter.
|
|
133
|
-
eta_range (
|
|
134
|
-
phi_range (
|
|
134
|
+
eta_range (list): A list containing the minimum and maximum eta values.
|
|
135
|
+
phi_range (list): A list containing the minimum and maximum phi values.
|
|
135
136
|
|
|
136
137
|
Returns:
|
|
137
138
|
pd.DataFrame: The filtered DataFrame.
|
|
@@ -148,10 +149,10 @@ def add_cells_to_scene(
|
|
|
148
149
|
df: pd.DataFrame,
|
|
149
150
|
scene: CellScene,
|
|
150
151
|
unit_scale: float,
|
|
151
|
-
unit_scale_energy: float
|
|
152
|
-
layer_color_dict: dict
|
|
153
|
-
colormap: Any
|
|
154
|
-
norm: mcolors.Normalize
|
|
152
|
+
unit_scale_energy: Optional[float] = 1,
|
|
153
|
+
layer_color_dict: Optional[dict] = None,
|
|
154
|
+
colormap: Optional[Any] = None,
|
|
155
|
+
norm: Optional[mcolors.Normalize] = None,
|
|
155
156
|
) -> None:
|
|
156
157
|
"""
|
|
157
158
|
Adds cells to a given scene.
|
|
@@ -161,7 +162,7 @@ def add_cells_to_scene(
|
|
|
161
162
|
scene (CellScene): The scene to which the cells will be added.
|
|
162
163
|
unit_scale (float): The scale factor for the cell units.
|
|
163
164
|
unit_scale_energy (Optional[float], optional): The scale factor for the cell energy units. Defaults to 1.
|
|
164
|
-
layer_color_dict (Optional[
|
|
165
|
+
layer_color_dict (Optional[dict], optional): A dictionary mapping layer names to colors. Defaults to None.
|
|
165
166
|
colormap (Optional[Any], optional): The colormap used to map cell energy values to colors. Defaults to None.
|
|
166
167
|
norm (Optional[mcolors.Normalize], optional): The normalization function used for the colormap. Defaults to None.
|
|
167
168
|
"""
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
|
|
1
3
|
import matplotlib.pyplot as plt
|
|
2
4
|
import numpy as np
|
|
3
5
|
from mpl_toolkits.mplot3d import Axes3D
|
|
@@ -14,7 +16,7 @@ class CellScene:
|
|
|
14
16
|
|
|
15
17
|
Attributes:
|
|
16
18
|
-----------
|
|
17
|
-
cell_list :
|
|
19
|
+
cell_list : list[Cell]
|
|
18
20
|
A list of Cell objects to be plotted in the scene.
|
|
19
21
|
|
|
20
22
|
Methods:
|
|
@@ -31,7 +33,7 @@ class CellScene:
|
|
|
31
33
|
min_max_cell_list_extent(dimIdx: int) -> tuple[float, float]
|
|
32
34
|
Returns the minimum and maximum extent of the cell_list along the specified dimension.
|
|
33
35
|
|
|
34
|
-
plot(ax: Axes3D = None, axisLabels:
|
|
36
|
+
plot(ax: Axes3D = None, axisLabels: list[str] = []) -> Axes3D
|
|
35
37
|
Plots the cells in the cell_list in a 3D plot with specified axis labels.
|
|
36
38
|
"""
|
|
37
39
|
|
|
@@ -41,7 +43,7 @@ class CellScene:
|
|
|
41
43
|
def add_cell(
|
|
42
44
|
self,
|
|
43
45
|
cell: Cell,
|
|
44
|
-
facecolor: tuple[float, float, float]
|
|
46
|
+
facecolor: Union[tuple[float, float, float], str] = "tab:orange",
|
|
45
47
|
alpha: float = 0.1,
|
|
46
48
|
edgecolor: tuple = (1, 1, 1, 1),
|
|
47
49
|
edgewidth: float = 1,
|
|
@@ -68,8 +70,8 @@ class CellScene:
|
|
|
68
70
|
def plot(
|
|
69
71
|
self,
|
|
70
72
|
ax: Axes3D = None,
|
|
71
|
-
axis_limits: list[tuple[float, float]]
|
|
72
|
-
axis_labels: list[str]
|
|
73
|
+
axis_limits: Union[list[tuple[float, float]], None] = None,
|
|
74
|
+
axis_labels: Union[list[str], None] = None,
|
|
73
75
|
) -> Axes3D:
|
|
74
76
|
if self.n_cells() == 0:
|
|
75
77
|
raise RuntimeWarning("No cells to plot. Add cells using the add_cell method.")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pygeosimplify"
|
|
3
|
-
version = "v0.0.
|
|
3
|
+
version = "v0.0.14"
|
|
4
4
|
description = "Python package for automatic, cell-based inference of clash-free simplified detector geometry."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Joshua Falco Beirer", email = "jbeirer@cern.ch" }
|
|
@@ -12,19 +12,20 @@ packages = [
|
|
|
12
12
|
{ include = "pygeosimplify" }
|
|
13
13
|
]
|
|
14
14
|
|
|
15
|
-
requires-python = ">=3.
|
|
15
|
+
requires-python = ">=3.9,<3.13"
|
|
16
16
|
dynamic = ["dependencies"]
|
|
17
17
|
|
|
18
18
|
[tool.poetry.dependencies]
|
|
19
|
-
python = ">=3.
|
|
20
|
-
uproot = "^5.
|
|
19
|
+
python = ">=3.9,<3.13"
|
|
20
|
+
uproot = "^5.6.0"
|
|
21
21
|
pandas = "^2.2.3"
|
|
22
|
-
numpy = "^2.2
|
|
23
|
-
matplotlib = "^3.
|
|
24
|
-
scipy = "^1.
|
|
22
|
+
numpy = "^2.0.2"
|
|
23
|
+
matplotlib = "^3.9.0"
|
|
24
|
+
scipy = "^1.13.1"
|
|
25
25
|
tqdm = "^4.67.1"
|
|
26
26
|
distinctipy = "^1.3.4"
|
|
27
|
-
pyg4ometry = "
|
|
27
|
+
pyg4ometry = "1.3.2"
|
|
28
|
+
|
|
28
29
|
|
|
29
30
|
[tool.poetry.group.dev.dependencies]
|
|
30
31
|
pytest = "^8.3.4"
|
|
@@ -41,12 +42,12 @@ mkdocs-material = "^9.5.49"
|
|
|
41
42
|
mkdocstrings = {extras = ["python"], version = "^0.27.0"}
|
|
42
43
|
|
|
43
44
|
[build-system]
|
|
44
|
-
requires = ["poetry-core>=2.
|
|
45
|
+
requires = ["poetry-core>=2.1.1"]
|
|
45
46
|
build-backend = "poetry.core.masonry.api"
|
|
46
47
|
|
|
47
48
|
[tool.black]
|
|
48
49
|
line-length = 120
|
|
49
|
-
target-version = ['
|
|
50
|
+
target-version = ['py39']
|
|
50
51
|
preview = true
|
|
51
52
|
|
|
52
53
|
[tool.mypy]
|
|
@@ -69,7 +70,7 @@ filterwarnings = [
|
|
|
69
70
|
]
|
|
70
71
|
|
|
71
72
|
[tool.ruff]
|
|
72
|
-
target-version = "
|
|
73
|
+
target-version = "py39"
|
|
73
74
|
line-length = 120
|
|
74
75
|
fix = true
|
|
75
76
|
lint.select = [
|
|
@@ -116,7 +117,9 @@ lint.ignore = [
|
|
|
116
117
|
# Avoid specifying long messages outside the exception class
|
|
117
118
|
"TRY003",
|
|
118
119
|
# B017 Do not assert blind exception: `Exception`
|
|
119
|
-
"B017"
|
|
120
|
+
"B017",
|
|
121
|
+
# Use `X | Y` for type annotations
|
|
122
|
+
"UP007"
|
|
120
123
|
]
|
|
121
124
|
|
|
122
125
|
[tool.coverage.report]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|