pyviewfactor 0.1.17__tar.gz → 1.0.0__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 (23) hide show
  1. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/PKG-INFO +7 -7
  2. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor/_version.py +1 -1
  3. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor/pvf_geometry_preprocess.py +12 -10
  4. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor/pvf_visibility_obstruction.py +7 -6
  5. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor.egg-info/PKG-INFO +7 -7
  6. pyviewfactor-1.0.0/pyviewfactor.egg-info/requires.txt +4 -0
  7. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/setup.cfg +6 -6
  8. pyviewfactor-0.1.17/pyviewfactor.egg-info/requires.txt +0 -4
  9. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/LICENSE.txt +0 -0
  10. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/README.md +0 -0
  11. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor/__init__.py +0 -0
  12. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor/pvf_integrators.py +0 -0
  13. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor/pvf_plot.py +0 -0
  14. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor/pvf_viewfactor_computations.py +0 -0
  15. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor.egg-info/SOURCES.txt +0 -0
  16. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor.egg-info/dependency_links.txt +0 -0
  17. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/pyviewfactor.egg-info/top_level.txt +0 -0
  18. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/setup.py +0 -0
  19. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/test/__init__.py +0 -0
  20. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/test/test_geometry_preprocess.py +0 -0
  21. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/test/test_plot.py +0 -0
  22. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/test/test_view_factor.py +0 -0
  23. {pyviewfactor-0.1.17 → pyviewfactor-1.0.0}/test/test_visibility_obstruction.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyviewfactor
3
- Version: 0.1.17
4
- Summary: A python library to calculate numerically exact radiation view factors between planar faces.
3
+ Version: 1.0.0
4
+ Summary: "A lightweight open-source Python library for exact view-factor computations on polygonal meshes"
5
5
  Home-page: https://gitlab.com/arep-dev/pyViewFactor/
6
6
  Author: Mateusz BOGDAN, Edouard WALTHER, Marc ALECIAN, Mina CHAPON
7
7
  Author-email: mateusz.bogdan@arep.fr
@@ -11,13 +11,13 @@ Classifier: Programming Language :: Python :: 3
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Topic :: Scientific/Engineering :: Physics
13
13
  Classifier: Operating System :: OS Independent
14
- Requires-Python: >=3.8
14
+ Requires-Python: >=3.9
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE.txt
17
- Requires-Dist: numpy>=1.19
18
- Requires-Dist: scipy>=1.7
19
- Requires-Dist: numba>=0.55
20
- Requires-Dist: pyvista>=0.32
17
+ Requires-Dist: numpy>=1.26
18
+ Requires-Dist: scipy>=1.11
19
+ Requires-Dist: numba>=0.61
20
+ Requires-Dist: pyvista>=0.45
21
21
 
22
22
  # PyViewFactor
23
23
 
@@ -1,5 +1,5 @@
1
1
  """Version info for pyViewFactor"""
2
- version_info = 0, 1, 17
2
+ version_info = 1,0,0
3
3
 
4
4
  # Nice string for the version
5
5
  __version__ = ".".join(map(str, version_info))
@@ -47,7 +47,7 @@ def fc_unstruc2poly(mesh_unstruc):
47
47
  return pv.PolyData(points, faces)
48
48
 
49
49
 
50
- def face_to_array(face):
50
+ def face_to_array(face,rounding_decimal=8):
51
51
  """
52
52
  Extract the vertex coordinates of a single PolyData face as a NumPy array.
53
53
 
@@ -63,7 +63,7 @@ def face_to_array(face):
63
63
 
64
64
  > The (x, y, z) coordinates of the face's vertices.
65
65
  """
66
- return face.get_cell(0).points.astype(np.float64)
66
+ return face.get_cell(0).points.round(decimals=rounding_decimal).astype(np.float64)
67
67
 
68
68
 
69
69
  @njit
@@ -295,7 +295,7 @@ class ProcessedGeometry:
295
295
  # idxs = faces_i[1:1 + n_i]
296
296
  raw = mesh.extract_cells(i)
297
297
  face = fc_unstruc2poly(raw)
298
- pts = face.get_cell(0).points.astype(np.float64)
298
+ pts = face.get_cell(0).points.round(rounding_decimal).astype(np.float64)
299
299
 
300
300
  self.points.append(pts)
301
301
  self.centroids[i] = polygon_centroid(pts)
@@ -356,10 +356,11 @@ class FaceMeshPreprocessor:
356
356
 
357
357
  > Remove triangles that exactly match either pts1 or pts2.
358
358
  """
359
- def __init__(self, mesh: pv.PolyData):
359
+ def __init__(self, mesh: pv.PolyData, rounding_decimal=8):
360
360
  if not mesh.is_all_triangles:
361
361
  mesh = mesh.triangulate()
362
- self.points = mesh.points.astype(np.float64)
362
+ self.rounding_decimal = rounding_decimal
363
+ self.points = mesh.points.round(rounding_decimal).astype(np.float64)
363
364
  # cells array is [n, i0, i1, i2, n, ...]
364
365
  cells = mesh.faces.reshape(-1, 4)[:, 1:]
365
366
  self.faces = cells # shape (n_cells,3)
@@ -372,14 +373,15 @@ class FaceMeshPreprocessor:
372
373
  kept.append(tri)
373
374
  return np.array(kept, dtype=np.float64)
374
375
 
375
- def exclude_exact_match(self, pts1, pts2, tris):
376
+ def exclude_exact_match(self, pts1, pts2, tris, rounding_decimal=8):
376
377
  # build frozensets of each vertex array
377
- vs1 = frozenset(sorted(tuple(np.round(p, 8)) for p in pts1))
378
- vs2 = frozenset(sorted(tuple(np.round(p, 8)) for p in pts2))
378
+ vs1 = frozenset(sorted(tuple(np.round(p, rounding_decimal)) for p in pts1))
379
+ vs2 = frozenset(sorted(tuple(np.round(p, rounding_decimal)) for p in pts2))
379
380
  out = []
380
381
  for tri in tris:
381
- tri_set = frozenset(sorted(tuple(np.round(p, 8)) for p in tri))
382
- if not tri_set.isdisjoint(vs1) or not tri_set.isdisjoint(vs2):
382
+ tri_set = frozenset(sorted(tuple(np.round(p, rounding_decimal)) for p in tri))
383
+ # if not tri_set.isdisjoint(vs1) or not tri_set.isdisjoint(vs2):
384
+ if tri_set == vs1 or tri_set == vs2:
383
385
  continue
384
386
  out.append(tri)
385
387
  return np.array(out, dtype=np.float64)
@@ -331,7 +331,8 @@ def is_ray_blocked(start, end, triangles, eps=1e-6):
331
331
  def get_obstruction(cell1, cell2, obstacle,
332
332
  strict=False,
333
333
  verbose=False,
334
- eps=1e-6
334
+ eps=1e-6,
335
+ rounding_decimal=8
335
336
  ):
336
337
  """
337
338
  Test for geometric obstruction (occlusion) between two facets and an obstacle mesh.
@@ -380,12 +381,12 @@ def get_obstruction(cell1, cell2, obstacle,
380
381
  """
381
382
  # 1) Convert inputs to numpy arrays
382
383
  if isinstance(cell1, pv.PolyData):
383
- pts1 = face_to_array(cell1)
384
+ pts1 = face_to_array(cell1,rounding_decimal=rounding_decimal)
384
385
  else:
385
386
  pts1 = np.asarray(cell1, dtype=np.float64)
386
387
 
387
388
  if isinstance(cell2, pv.PolyData):
388
- pts2 = face_to_array(cell2)
389
+ pts2 = face_to_array(cell2,rounding_decimal=rounding_decimal)
389
390
  else:
390
391
  pts2 = np.asarray(cell2, dtype=np.float64)
391
392
 
@@ -393,7 +394,7 @@ def get_obstruction(cell1, cell2, obstacle,
393
394
  if isinstance(obstacle, FaceMeshPreprocessor):
394
395
  pre = obstacle
395
396
  else:
396
- pre = FaceMeshPreprocessor(obstacle)
397
+ pre = FaceMeshPreprocessor(obstacle, rounding_decimal=rounding_decimal)
397
398
  # 3) AABB cull
398
399
  # 2) Build combined AABB & cull triangles
399
400
  # 3) AABB cull
@@ -402,7 +403,7 @@ def get_obstruction(cell1, cell2, obstacle,
402
403
  cand = pre.aabb_filter(amin, amax)
403
404
 
404
405
  # 4) Exclude self‐triangles
405
- cand = pre.exclude_exact_match(pts1, pts2, cand)
406
+ cand = pre.exclude_exact_match(pts1, pts2, cand, rounding_decimal=rounding_decimal)
406
407
  if cand.size == 0:
407
408
  warning = "[PVF] [Obstruction] Unobstructed (no candidate within c1-c2 AABB)"
408
409
  if verbose:
@@ -438,7 +439,7 @@ def get_obstruction(cell1, cell2, obstacle,
438
439
 
439
440
 
440
441
  def get_obstruction_from_cache(i, j, cache, obstacle_mesh, strict=False,
441
- verbose=False, eps=1e-6):
442
+ verbose=False, eps=1e-6, rounding_decimal=8):
442
443
  """
443
444
  Test for geometric obstruction between cached faces i and j, using a preprocessed
444
445
  obstacle mesh.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyviewfactor
3
- Version: 0.1.17
4
- Summary: A python library to calculate numerically exact radiation view factors between planar faces.
3
+ Version: 1.0.0
4
+ Summary: "A lightweight open-source Python library for exact view-factor computations on polygonal meshes"
5
5
  Home-page: https://gitlab.com/arep-dev/pyViewFactor/
6
6
  Author: Mateusz BOGDAN, Edouard WALTHER, Marc ALECIAN, Mina CHAPON
7
7
  Author-email: mateusz.bogdan@arep.fr
@@ -11,13 +11,13 @@ Classifier: Programming Language :: Python :: 3
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Topic :: Scientific/Engineering :: Physics
13
13
  Classifier: Operating System :: OS Independent
14
- Requires-Python: >=3.8
14
+ Requires-Python: >=3.9
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE.txt
17
- Requires-Dist: numpy>=1.19
18
- Requires-Dist: scipy>=1.7
19
- Requires-Dist: numba>=0.55
20
- Requires-Dist: pyvista>=0.32
17
+ Requires-Dist: numpy>=1.26
18
+ Requires-Dist: scipy>=1.11
19
+ Requires-Dist: numba>=0.61
20
+ Requires-Dist: pyvista>=0.45
21
21
 
22
22
  # PyViewFactor
23
23
 
@@ -0,0 +1,4 @@
1
+ numpy>=1.26
2
+ scipy>=1.11
3
+ numba>=0.61
4
+ pyvista>=0.45
@@ -3,7 +3,7 @@ name = pyviewfactor
3
3
  version = attr: pyviewfactor._version.__version__
4
4
  author = Mateusz BOGDAN, Edouard WALTHER, Marc ALECIAN, Mina CHAPON
5
5
  author_email = mateusz.bogdan@arep.fr
6
- description = A python library to calculate numerically exact radiation view factors between planar faces.
6
+ description = "A lightweight open-source Python library for exact view-factor computations on polygonal meshes"
7
7
  long_description = file: README.md
8
8
  long_description_content_type = text/markdown
9
9
  url = https://gitlab.com/arep-dev/pyViewFactor/
@@ -24,11 +24,11 @@ classifiers =
24
24
  [options]
25
25
  packages = find:
26
26
  install_requires =
27
- numpy>=1.19
28
- scipy>=1.7
29
- numba>=0.55
30
- pyvista>=0.32
31
- python_requires = >=3.8
27
+ numpy>=1.26
28
+ scipy>=1.11
29
+ numba>=0.61
30
+ pyvista>=0.45
31
+ python_requires = >=3.9
32
32
 
33
33
  [options.packages.find]
34
34
  where = .
@@ -1,4 +0,0 @@
1
- numpy>=1.19
2
- scipy>=1.7
3
- numba>=0.55
4
- pyvista>=0.32
File without changes
File without changes
File without changes