pygeosimplify 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.
Files changed (28) hide show
  1. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/PKG-INFO +7 -5
  2. pygeosimplify-0.0.20/pygeosimplify/cfg/__init__.py +0 -0
  3. pygeosimplify-0.0.20/pygeosimplify/coordinate/__init__.py +0 -0
  4. pygeosimplify-0.0.20/pygeosimplify/geo/__init__.py +0 -0
  5. pygeosimplify-0.0.20/pygeosimplify/io/__init__.py +0 -0
  6. pygeosimplify-0.0.20/pygeosimplify/simplify/__init__.py +0 -0
  7. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/simplify/helpers.py +2 -3
  8. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/simplify/layer.py +5 -5
  9. pygeosimplify-0.0.20/pygeosimplify/utils/__init__.py +0 -0
  10. pygeosimplify-0.0.20/pygeosimplify/vis/__init__.py +0 -0
  11. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/vis/cylinder.py +5 -5
  12. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/vis/geo.py +14 -14
  13. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pyproject.toml +18 -15
  14. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/LICENSE +0 -0
  15. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/README.md +0 -0
  16. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/__init__.py +0 -0
  17. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/cfg/config.py +0 -0
  18. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/cfg/test_data.py +0 -0
  19. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/coordinate/definitions.py +0 -0
  20. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/geo/base.py +0 -0
  21. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/geo/cells.py +0 -0
  22. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/io/geo_handler.py +0 -0
  23. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/simplify/cylinder.py +0 -0
  24. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/simplify/detector.py +0 -0
  25. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/simplify/post_process.py +0 -0
  26. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/utils/message_type.py +0 -0
  27. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/utils/path_resolver.py +0 -0
  28. {pygeosimplify-0.0.19 → pygeosimplify-0.0.20}/pygeosimplify/vis/scene.py +0 -0
@@ -1,17 +1,19 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: pygeosimplify
3
- Version: 0.0.19
3
+ Version: 0.0.20
4
4
  Summary: Python package for automatic, cell-based inference of clash-free simplified detector geometry.
5
+ License-File: LICENSE
5
6
  Author: Joshua Falco Beirer
6
7
  Author-email: jbeirer@cern.ch
7
- Requires-Python: >=3.9,<3.13
8
+ Requires-Python: >=3.10,<4.0
8
9
  Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
13
15
  Requires-Dist: distinctipy (>=1.3.4,<2.0.0)
14
- Requires-Dist: matplotlib (>=3.9.0,<4.0.0)
16
+ Requires-Dist: matplotlib (>=3.9.0,<3.11)
15
17
  Requires-Dist: numpy (>=2.0.2,<3.0.0)
16
18
  Requires-Dist: pandas (>=2.2.3,<3.0.0)
17
19
  Requires-Dist: pyg4ometry (>=1.3.5,<2.0.0)
File without changes
File without changes
File without changes
@@ -1,6 +1,5 @@
1
1
  from itertools import combinations
2
2
  from re import Match
3
- from typing import Optional
4
3
 
5
4
  import numpy as np
6
5
  import pandas as pd
@@ -89,8 +88,8 @@ def check_world_overlap(
89
88
 
90
89
  for pair in overlap_lines:
91
90
  # Extract the actual layer names without the "Layer_" prefix and "_Phys" suffix
92
- first_match: Optional[Match[str]] = re.search(r"Layer_(.*?)_Phys", pair[0])
93
- second_match: Optional[Match[str]] = re.search(r"Layer_(.*?)_Phys", pair[1])
91
+ first_match: Match[str] | None = re.search(r"Layer_(.*?)_Phys", pair[0])
92
+ second_match: Match[str] | None = re.search(r"Layer_(.*?)_Phys", pair[1])
94
93
 
95
94
  if first_match and second_match:
96
95
  first = first_match.group(1)
@@ -100,22 +100,22 @@ class GeoLayer:
100
100
  if self.coordinate_system == "XYZ":
101
101
  return [
102
102
  XYZCell(dx, dy, dz, pos=XYZ(x, y, z))
103
- for dx, dy, dz, x, y, z in zip(df.dx, df.dy, df.dz, df.x, df.y, df.z)
103
+ for dx, dy, dz, x, y, z in zip(df.dx, df.dy, df.dz, df.x, df.y, df.z, strict=False)
104
104
  ]
105
105
  elif self.coordinate_system == "EtaPhiR":
106
106
  return [
107
107
  EtaPhiRCell(deta, dphi, dr, pos=EtaPhiR(eta, phi, r))
108
- for deta, dphi, dr, eta, phi, r in zip(df.deta, df.dphi, df.dr, df.eta, df.phi, df.r)
108
+ for deta, dphi, dr, eta, phi, r in zip(df.deta, df.dphi, df.dr, df.eta, df.phi, df.r, strict=False)
109
109
  ]
110
110
  elif self.coordinate_system == "EtaPhiZ":
111
111
  return [
112
112
  EtaPhiZCell(deta, dphi, dz, pos=EtaPhiZ(eta, phi, z))
113
- for deta, dphi, dz, eta, phi, z in zip(df.deta, df.dphi, df.dz, df.eta, df.phi, df.z)
113
+ for deta, dphi, dz, eta, phi, z in zip(df.deta, df.dphi, df.dz, df.eta, df.phi, df.z, strict=False)
114
114
  ]
115
115
  elif self.coordinate_system == "RPhiZ":
116
116
  return [
117
117
  RPhiZCell(dr, dphi, dz, pos=RPhiZ(r, phi, z))
118
- for dr, dphi, dz, r, phi, z in zip(df.dr, df.dphi, df.dz, df.r, df.phi, df.z)
118
+ for dr, dphi, dz, r, phi, z in zip(df.dr, df.dphi, df.dz, df.r, df.phi, df.z, strict=False)
119
119
  ]
120
120
  else:
121
121
  raise Exception(f"Invalid coordinate system {self.coordinate_system}.")
@@ -238,7 +238,7 @@ class GeoLayer:
238
238
 
239
239
  def plot_cell_vertices_rz(
240
240
  self,
241
- ax: Union[None, plt.Axes] = None,
241
+ ax: Union[plt.Axes, None] = None,
242
242
  color: Union[tuple[float, float, float], str] = "tab:blue",
243
243
  marker_size: float = 0.01,
244
244
  x_label: str = "z",
File without changes
File without changes
@@ -49,14 +49,14 @@ def generate_cylinder_endcap_points(rmin: float, rmax: float, z: float, linspace
49
49
  radii = np.linspace(rmin, rmax, linspace_count)
50
50
 
51
51
  # Create a grid of points in polar coordinates
52
- theta, radii = np.meshgrid(theta, radii)
52
+ theta_grid, radii_grid = np.meshgrid(theta, radii)
53
53
 
54
54
  # Convert polar coordinates to Cartesian coordinates
55
- x = radii * np.cos(theta)
56
- y = radii * np.sin(theta)
57
- z = np.full_like(y, z) # Z coordinate remains constant
55
+ x = radii_grid * np.cos(theta_grid)
56
+ y = radii_grid * np.sin(theta_grid)
57
+ z_values = np.full_like(y, z) # Z coordinate remains constant
58
58
 
59
- return x, y, z
59
+ return x, y, z_values
60
60
 
61
61
 
62
62
  def plot_cylinder(
@@ -1,4 +1,4 @@
1
- from typing import Any, Optional, Union
1
+ from typing import Any, 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: 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,
19
+ ax: Union[Axes3D, None] = None,
20
+ layer_list: list[int] | None = None,
21
+ eta_range: list | None = None,
22
+ phi_range: list | None = None,
23
+ axis_labels: list | None = None,
24
+ color: str | None = None,
25
25
  unit_scale: float = 1,
26
- cell_energy_col: Optional[str] = None,
26
+ cell_energy_col: str | None = None,
27
27
  unit_scale_energy: float = 1,
28
28
  energy_label: str = "Cell Energy",
29
29
  color_map: str = "gist_heat_r",
@@ -75,10 +75,10 @@ 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), strict=False))
79
79
  # If color is specifically provided, override the color dict
80
80
  if color:
81
- layer_color_dict = {layer: color for layer in layer_list}
81
+ layer_color_dict = dict.fromkeys(layer_list, color)
82
82
  add_cells_to_scene(
83
83
  df=df,
84
84
  scene=vis,
@@ -149,10 +149,10 @@ def add_cells_to_scene(
149
149
  df: pd.DataFrame,
150
150
  scene: CellScene,
151
151
  unit_scale: float,
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,
152
+ unit_scale_energy: float | None = 1,
153
+ layer_color_dict: dict | None = None,
154
+ colormap: Any | None = None,
155
+ norm: mcolors.Normalize | None = None,
156
156
  ) -> None:
157
157
  """
158
158
  Adds cells to a given scene.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pygeosimplify"
3
- version = "v0.0.19"
3
+ version = "0.0.20"
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,41 +12,42 @@ packages = [
12
12
  { include = "pygeosimplify" }
13
13
  ]
14
14
 
15
- requires-python = ">=3.9,<3.13"
15
+ requires-python = ">=3.10,<4.0"
16
16
  dynamic = ["dependencies"]
17
17
 
18
18
  [tool.poetry.dependencies]
19
- python = ">=3.9,<3.13"
19
+ python = ">=3.10,<4.0"
20
20
  uproot = "^5.6.0"
21
21
  pandas = "^2.2.3"
22
22
  numpy = "^2.0.2"
23
- matplotlib = "^3.9.0"
23
+ matplotlib = ">=3.9.0,<3.11"
24
24
  scipy = "^1.13.1"
25
25
  tqdm = "^4.67.1"
26
26
  distinctipy = "^1.3.4"
27
27
  pyg4ometry = ">=1.3.5,<2.0.0"
28
28
 
29
29
  [tool.poetry.group.dev.dependencies]
30
- pytest = "^8.3.4"
31
- pytest-cov = "^6.0.0"
32
- deptry = "^0.22.0"
33
- mypy = "^1.14.1"
30
+ pytest = "^9.1.1"
31
+ pytest-cov = "^7.1.0"
32
+ deptry = "^0.25.1"
33
+ mypy = "^2.3.1"
34
34
  pre-commit = "^4.0.1"
35
35
  tox = "^4.23.2"
36
- ipykernel = "^6.29.5"
36
+ ipykernel = "^7.3.0"
37
+ pytest-xdist = "^3.8.0"
37
38
 
38
39
  [tool.poetry.group.docs.dependencies]
39
40
  mkdocs = "^1.6.1"
40
41
  mkdocs-material = "^9.5.49"
41
- mkdocstrings = {extras = ["python"], version = "^0.27.0"}
42
+ mkdocstrings = {extras = ["python"], version = "^1.0.6"}
42
43
 
43
44
  [build-system]
44
- requires = ["poetry-core>=2.1.1"]
45
+ requires = ["poetry-core>=2.4.1"]
45
46
  build-backend = "poetry.core.masonry.api"
46
47
 
47
48
  [tool.black]
48
49
  line-length = 120
49
- target-version = ['py39']
50
+ target-version = ['py310']
50
51
  preview = true
51
52
 
52
53
  [tool.mypy]
@@ -69,10 +70,12 @@ filterwarnings = [
69
70
  ]
70
71
 
71
72
  [tool.ruff]
72
- target-version = "py39"
73
+ target-version = "py310"
73
74
  line-length = 120
74
75
  fix = true
75
- lint.select = [
76
+
77
+ [tool.ruff.lint]
78
+ select = [
76
79
  # flake8-2020
77
80
  "YTT",
78
81
  # flake8-bandit
@@ -104,7 +107,7 @@ lint.select = [
104
107
  # tryceratops
105
108
  "TRY",
106
109
  ]
107
- lint.ignore = [
110
+ ignore = [
108
111
  # LineTooLong
109
112
  "E501",
110
113
  # DoNotAssignLambda
File without changes
File without changes