fdsreader 0.9.16__tar.gz → 0.9.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.
- {fdsreader-0.9.16 → fdsreader-0.9.20}/LICENSE +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/MANIFEST.in +0 -0
- {fdsreader-0.9.16/fdsreader.egg-info → fdsreader-0.9.20}/PKG-INFO +1 -1
- {fdsreader-0.9.16 → fdsreader-0.9.20}/README.md +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/__init__.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/_version.py +1 -1
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/bndf/ObstructionCollection.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/bndf/__init__.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/bndf/obstruction.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/geom/GeometryCollection.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/geom/__init__.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/geom/geometry.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/isof/IsosurfaceCollection.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/isof/__init__.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/isof/isosurface.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/part/ParticleCollection.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/part/__init__.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/part/particle.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/pl3d/Plot3dCollection.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/pl3d/__init__.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/pl3d/pl3d.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/settings.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/simulation.py +9 -8
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/slcf/SliceCollection.py +15 -4
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/slcf/__init__.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/slcf/slice.py +30 -5
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/utils/__init__.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/utils/data.py +1 -1
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/utils/dimension.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/utils/extent.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/utils/fds_classes/__init__.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/utils/fds_classes/mesh.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/utils/fds_classes/surface.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/utils/fds_classes/ventilation.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/utils/fortran_data.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader/utils/misc.py +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20/fdsreader.egg-info}/PKG-INFO +1 -1
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader.egg-info/SOURCES.txt +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader.egg-info/dependency_links.txt +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader.egg-info/requires.txt +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/fdsreader.egg-info/top_level.txt +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/requirements.txt +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/setup.cfg +0 -0
- {fdsreader-0.9.16 → fdsreader-0.9.20}/setup.py +0 -0
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -70,15 +70,16 @@ class Simulation:
|
|
|
70
70
|
return super(Simulation, cls).__new__(cls)
|
|
71
71
|
|
|
72
72
|
def __repr__(self):
|
|
73
|
-
|
|
73
|
+
r = f"Simulation(chid={self.chid},\n" + \
|
|
74
74
|
f" meshes={len(self.meshes)},\n" + \
|
|
75
|
-
f" obstructions={len(self.obstructions)},\n" if len(self.obstructions) > 0 else "" + \
|
|
76
|
-
f" geometries={len(self.geoms)},\n" if len(self.geoms) > 0 else "" + \
|
|
77
|
-
f" slices={len(self.slices)},\n" if len(self.slices) > 0 else "" + \
|
|
78
|
-
f" plot3d={len(self.data_3d)},\n" if len(self.data_3d) > 0 else "" + \
|
|
79
|
-
f" isosurfaces={len(self.isosurfaces)},\n" if len(self.isosurfaces) > 0 else "" + \
|
|
80
|
-
f" particles={len(self.particles)},\n" if len(self.particles) > 0 else "" + \
|
|
81
|
-
f" devices={len(self.devices)}
|
|
75
|
+
(f" obstructions={len(self.obstructions)},\n" if len(self.obstructions) > 0 else "") + \
|
|
76
|
+
(f" geometries={len(self.geoms)},\n" if len(self.geoms) > 0 else "") + \
|
|
77
|
+
(f" slices={len(self.slices)},\n" if len(self.slices) > 0 else "") + \
|
|
78
|
+
(f" plot3d={len(self.data_3d)},\n" if len(self.data_3d) > 0 else "") + \
|
|
79
|
+
(f" isosurfaces={len(self.isosurfaces)},\n" if len(self.isosurfaces) > 0 else "") + \
|
|
80
|
+
(f" particles={len(self.particles)},\n" if len(self.particles) > 0 else "") + \
|
|
81
|
+
(f" devices={len(self.devices)},\n" if len(self.devices) > 0 else "")
|
|
82
|
+
return r[:-2] + ')'
|
|
82
83
|
|
|
83
84
|
def __init__(self, path: str):
|
|
84
85
|
"""
|
|
@@ -29,19 +29,30 @@ class SliceCollection(FDSDataCollection):
|
|
|
29
29
|
|
|
30
30
|
def get_nearest(self, x: float = None, y: float = None, z: float = None) -> Slice:
|
|
31
31
|
"""Filters the slice with the shortest distance to the given point.
|
|
32
|
+
If there are multiple slices with the same distance, a random one will be selected.
|
|
32
33
|
"""
|
|
33
34
|
d_min = np.finfo(float).max
|
|
34
|
-
|
|
35
|
+
slices_min = list()
|
|
35
36
|
|
|
36
37
|
for slc in self:
|
|
37
38
|
dx = max(slc.extent.x_start - x, 0, x - slc.extent.x_end) if x is not None else 0
|
|
38
39
|
dy = max(slc.extent.y_start - y, 0, y - slc.extent.y_end) if y is not None else 0
|
|
39
40
|
dz = max(slc.extent.z_start - z, 0, z - slc.extent.z_end) if z is not None else 0
|
|
40
41
|
d = np.sqrt(dx * dx + dy * dy + dz * dz)
|
|
41
|
-
if d
|
|
42
|
+
if d <= d_min:
|
|
42
43
|
d_min = d
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
slices_min.append(slc)
|
|
45
|
+
|
|
46
|
+
if x is not None:
|
|
47
|
+
slices_min.sort(key=lambda slc: (slc.extent.x_end - slc.extent.x_start))
|
|
48
|
+
if y is not None:
|
|
49
|
+
slices_min.sort(key=lambda slc: (slc.extent.y_end - slc.extent.y_start))
|
|
50
|
+
if z is not None:
|
|
51
|
+
slices_min.sort(key=lambda slc: (slc.extent.z_end - slc.extent.z_start))
|
|
52
|
+
|
|
53
|
+
if len(slices_min) > 0:
|
|
54
|
+
return slices_min[0]
|
|
55
|
+
return None
|
|
45
56
|
|
|
46
57
|
def __repr__(self):
|
|
47
58
|
return "SliceCollection(" + super(SliceCollection, self).__repr__() + ")"
|
|
File without changes
|
|
@@ -211,8 +211,15 @@ class Slice(np.lib.mixins.NDArrayOperatorsMixin):
|
|
|
211
211
|
for _, subslice in self._subslices.items():
|
|
212
212
|
_ = subslice.data
|
|
213
213
|
|
|
214
|
-
def
|
|
215
|
-
"""Returns the :class:`SubSlice` that cuts through the given mesh.
|
|
214
|
+
def get_subslice(self, key: Union[int, Mesh]) -> SubSlice:
|
|
215
|
+
"""Returns the :class:`SubSlice` that cuts through the given mesh. When an int is provided
|
|
216
|
+
the nth SubSlice will be returned.
|
|
217
|
+
"""
|
|
218
|
+
return self[key]
|
|
219
|
+
|
|
220
|
+
def __getitem__(self, key: Union[int, Mesh]) -> SubSlice:
|
|
221
|
+
"""Returns the :class:`SubSlice` that cuts through the given mesh. When an int is provided
|
|
222
|
+
the nth SubSlice will be returned.
|
|
216
223
|
"""
|
|
217
224
|
if type(key) == int:
|
|
218
225
|
return tuple(self._subslices.values())[key]
|
|
@@ -221,6 +228,12 @@ class Slice(np.lib.mixins.NDArrayOperatorsMixin):
|
|
|
221
228
|
def __len__(self):
|
|
222
229
|
return len(self._subslices)
|
|
223
230
|
|
|
231
|
+
@property
|
|
232
|
+
def subslices(self) -> List[SubSlice]:
|
|
233
|
+
"""Get a list with all SubSlices.
|
|
234
|
+
"""
|
|
235
|
+
return list(self._subslices.values())
|
|
236
|
+
|
|
224
237
|
@property
|
|
225
238
|
def extent_dirs(self) -> Tuple[
|
|
226
239
|
Literal['x', 'y', 'z'], Literal['x', 'y', 'z'], Literal['x', 'y', 'z']]:
|
|
@@ -247,6 +260,8 @@ class Slice(np.lib.mixins.NDArrayOperatorsMixin):
|
|
|
247
260
|
return idx
|
|
248
261
|
|
|
249
262
|
def get_nearest_index(self, dimension: Literal['x', 'y', 'z'], value: float) -> int:
|
|
263
|
+
"""Get the nearest mesh coordinate index in a specific dimension.
|
|
264
|
+
"""
|
|
250
265
|
coords = self.coordinates[dimension]
|
|
251
266
|
idx = np.searchsorted(coords, value, side="left")
|
|
252
267
|
if idx > 0 and (idx == coords.size or np.math.fabs(value - coords[idx - 1]) < np.math.fabs(
|
|
@@ -263,11 +278,21 @@ class Slice(np.lib.mixins.NDArrayOperatorsMixin):
|
|
|
263
278
|
|
|
264
279
|
@property
|
|
265
280
|
def coordinates(self) -> Dict[Literal['x', 'y', 'z'], np.ndarray]:
|
|
281
|
+
"""Returns a dictionary containing a numpy ndarray with coordinates for each dimension.
|
|
282
|
+
For cell-centered slices, the coordinates are adjusted to represent cell-centered coordinates.
|
|
283
|
+
"""
|
|
266
284
|
coords = {'x': set(), 'y': set(), 'z': set()}
|
|
267
285
|
for dim in ('x', 'y', 'z'):
|
|
268
286
|
for mesh in self._subslices.keys():
|
|
269
|
-
|
|
287
|
+
co = mesh.coordinates[dim]
|
|
288
|
+
# In case the slice is cell-centered, we will shift the coordinates by half a cell
|
|
289
|
+
# and remove the last coordinate
|
|
290
|
+
if self.cell_centered:
|
|
291
|
+
co = co[:-1]
|
|
292
|
+
co += (co[1] - co[0]) / 2
|
|
293
|
+
coords[dim].update(co)
|
|
270
294
|
coords[dim] = np.array(sorted(list(coords[dim])))
|
|
295
|
+
|
|
271
296
|
return coords
|
|
272
297
|
|
|
273
298
|
def clear_cache(self):
|
|
@@ -397,8 +422,8 @@ class Slice(np.lib.mixins.NDArrayOperatorsMixin):
|
|
|
397
422
|
|
|
398
423
|
def __repr__(self):
|
|
399
424
|
if self.type == '3D': # 3D-Slice
|
|
400
|
-
return f"Slice([3D] cell_centered={self.cell_centered}, extent={self.extent}
|
|
425
|
+
return f"Slice([3D] cell_centered={self.cell_centered}, extent={self.extent})"
|
|
401
426
|
else: # 2D-Slice
|
|
402
|
-
return f"Slice([2D] cell_centered={self.cell_centered}, extent={self.extent}, extent_dirs={self.extent_dirs}, orientation={self.orientation}, times=[{self.times[0]:.2f}
|
|
427
|
+
return f"Slice([2D] cell_centered={self.cell_centered}, extent={self.extent}, extent_dirs={self.extent_dirs}, orientation={self.orientation}, times=[{self.times[0]:.2f})"
|
|
403
428
|
|
|
404
429
|
# __array_function__ implementations
|
|
File without changes
|
|
@@ -108,7 +108,7 @@ class FDSDataCollection:
|
|
|
108
108
|
return value in self._elements
|
|
109
109
|
|
|
110
110
|
def __repr__(self):
|
|
111
|
-
return "[" + str(self._elements) + "]"
|
|
111
|
+
return "[" + ",\n".join(str(e) for e in self._elements) + "]"
|
|
112
112
|
|
|
113
113
|
def clear_cache(self):
|
|
114
114
|
"""Remove all data from the internal cache that has been loaded so far to free memory.
|
|
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
|
|
File without changes
|
|
File without changes
|