sdfr 1.4.2__py3-none-win32.whl → 1.4.4__py3-none-win32.whl
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.
- sdfr/SDF.py +20 -8
- sdfr/_commit_info.py +2 -2
- sdfr/loadlib.py +3 -3
- sdfr/sdf_helper.py +24 -26
- sdfr/sdfc_shared.dll +0 -0
- sdfr/sdfc_shared.lib +0 -0
- {sdfr-1.4.2.dist-info → sdfr-1.4.4.dist-info}/METADATA +1 -1
- sdfr-1.4.4.dist-info/RECORD +12 -0
- sdfr-1.4.2.dist-info/RECORD +0 -11
- {sdfr-1.4.2.dist-info → sdfr-1.4.4.dist-info}/WHEEL +0 -0
- {sdfr-1.4.2.dist-info → sdfr-1.4.4.dist-info}/licenses/LICENSE +0 -0
- {sdfr-1.4.2.dist-info → sdfr-1.4.4.dist-info}/licenses/LICENSE_README.txt +0 -0
sdfr/SDF.py
CHANGED
|
@@ -340,6 +340,7 @@ class BlockList:
|
|
|
340
340
|
"""Contains all the blocks"""
|
|
341
341
|
|
|
342
342
|
def __init__(self, filename, convert=False, derived=True):
|
|
343
|
+
self._handle = None
|
|
343
344
|
clib = sdf_lib
|
|
344
345
|
self._clib = clib
|
|
345
346
|
clib.sdf_open.restype = ct.POINTER(SdfFile)
|
|
@@ -417,6 +418,7 @@ class BlockList:
|
|
|
417
418
|
if block.datatype_out != 0:
|
|
418
419
|
newblock = BlockLagrangianMesh(block)
|
|
419
420
|
newblock_mid = block
|
|
421
|
+
newblock_mid._grid_block = newblock
|
|
420
422
|
mesh_id_map[newblock.id] = newblock
|
|
421
423
|
elif blocktype == SdfBlockType.SDF_BLOCKTYPE_NAMEVALUE:
|
|
422
424
|
newblock = BlockNameValue(block)
|
|
@@ -430,6 +432,7 @@ class BlockList:
|
|
|
430
432
|
if block.datatype_out != 0:
|
|
431
433
|
newblock = BlockPlainMesh(block)
|
|
432
434
|
newblock_mid = block
|
|
435
|
+
newblock_mid._grid_block = newblock
|
|
433
436
|
mesh_id_map[newblock.id] = newblock
|
|
434
437
|
elif (
|
|
435
438
|
blocktype == SdfBlockType.SDF_BLOCKTYPE_POINT_DERIVED
|
|
@@ -474,6 +477,7 @@ class BlockList:
|
|
|
474
477
|
self._block_ids.update({nm: newblock})
|
|
475
478
|
nm = block_mid.name.decode() + "_mid"
|
|
476
479
|
self._block_names.update({nm: newblock})
|
|
480
|
+
newblock_mid._grid_block._grid_mid = newblock
|
|
477
481
|
|
|
478
482
|
for var in mesh_vars:
|
|
479
483
|
gid = var.grid_id
|
|
@@ -481,10 +485,12 @@ class BlockList:
|
|
|
481
485
|
var._grid = mesh_id_map[gid]
|
|
482
486
|
|
|
483
487
|
def __del__(self):
|
|
484
|
-
self.
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
+
if self._handle:
|
|
489
|
+
self._clib.sdf_stack_destroy.argtypes = [ct.c_void_p]
|
|
490
|
+
self._clib.sdf_close.argtypes = [ct.c_void_p]
|
|
491
|
+
self._clib.sdf_stack_destroy(self._handle)
|
|
492
|
+
self._clib.sdf_close(self._handle)
|
|
493
|
+
self._handle = None
|
|
488
494
|
|
|
489
495
|
@property
|
|
490
496
|
def name_dict(self):
|
|
@@ -600,6 +606,11 @@ class BlockPlainVariable(Block):
|
|
|
600
606
|
"""Associated mesh"""
|
|
601
607
|
return self._grid
|
|
602
608
|
|
|
609
|
+
@property
|
|
610
|
+
def grid_mid(self):
|
|
611
|
+
"""Associated median mesh"""
|
|
612
|
+
return self._grid._grid_mid
|
|
613
|
+
|
|
603
614
|
@property
|
|
604
615
|
def grid_id(self):
|
|
605
616
|
"""Associated mesh id"""
|
|
@@ -901,7 +912,8 @@ def get_header(h):
|
|
|
901
912
|
|
|
902
913
|
|
|
903
914
|
def get_run_info(block):
|
|
904
|
-
from datetime import datetime
|
|
915
|
+
from datetime import datetime as dtm
|
|
916
|
+
from datetime import UTC
|
|
905
917
|
|
|
906
918
|
h = ct.cast(block.data, ct.POINTER(RunInfo)).contents
|
|
907
919
|
d = {}
|
|
@@ -910,9 +922,9 @@ def get_run_info(block):
|
|
|
910
922
|
d["sha1sum"] = h.sha1sum.decode()
|
|
911
923
|
d["compile_machine"] = h.compile_machine.decode()
|
|
912
924
|
d["compile_flags"] = h.compile_flags.decode()
|
|
913
|
-
d["compile_date"] =
|
|
914
|
-
d["run_date"] =
|
|
915
|
-
d["io_data"] =
|
|
925
|
+
d["compile_date"] = dtm.fromtimestamp(h.compile_date, UTC).strftime("%c")
|
|
926
|
+
d["run_date"] = dtm.fromtimestamp(h.run_date, UTC).strftime("%c")
|
|
927
|
+
d["io_data"] = dtm.fromtimestamp(h.io_date, UTC).strftime("%c")
|
|
916
928
|
return d
|
|
917
929
|
|
|
918
930
|
|
sdfr/_commit_info.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__commit_date__ = "
|
|
2
|
-
__commit_id__ = "
|
|
1
|
+
__commit_date__ = "Thu Jun 19 14:32:34 2025 +0100"
|
|
2
|
+
__commit_id__ = "1b49a56a9b844067b2d9900ef3cb45824821cefb"
|
sdfr/loadlib.py
CHANGED
|
@@ -40,9 +40,9 @@ def _loadlib():
|
|
|
40
40
|
local_dir = Path(__file__).resolve().parent
|
|
41
41
|
site_dirs = [Path(x) / "sdfr" for x in getsitepackages()]
|
|
42
42
|
path_dirs = [Path(x) for x in sys.path]
|
|
43
|
-
|
|
44
|
-
for lib_dir,
|
|
45
|
-
if (lib := lib_dir /
|
|
43
|
+
libs = ("libsdfc_shared.so", "libsdfc_shared.dylib", "sdfc_shared.dll")
|
|
44
|
+
for lib_dir, libname in product([local_dir, *site_dirs, *path_dirs], libs):
|
|
45
|
+
if (lib := lib_dir / libname).exists():
|
|
46
46
|
return ct.cdll.LoadLibrary(str(lib))
|
|
47
47
|
raise RuntimeError("Could not find library 'libsdfc_shared'")
|
|
48
48
|
|
sdfr/sdf_helper.py
CHANGED
|
@@ -888,7 +888,7 @@ def plot1d(
|
|
|
888
888
|
if title:
|
|
889
889
|
subplot.set_title(get_title(var), fontsize="large", y=1.03)
|
|
890
890
|
|
|
891
|
-
figure.
|
|
891
|
+
figure.set_layout_engine("tight")
|
|
892
892
|
figure.canvas.draw()
|
|
893
893
|
|
|
894
894
|
|
|
@@ -997,7 +997,7 @@ def plot_path(
|
|
|
997
997
|
elif figure is None:
|
|
998
998
|
figure = subplot.figure
|
|
999
999
|
subplot.axis(plot_path.axis)
|
|
1000
|
-
figure.
|
|
1000
|
+
figure.set_layout_engine("tight")
|
|
1001
1001
|
figure.canvas.draw()
|
|
1002
1002
|
return
|
|
1003
1003
|
|
|
@@ -1251,7 +1251,7 @@ def plot_path(
|
|
|
1251
1251
|
subplot.axis(lim)
|
|
1252
1252
|
|
|
1253
1253
|
if update:
|
|
1254
|
-
figure.
|
|
1254
|
+
figure.set_layout_engine("tight")
|
|
1255
1255
|
figure.canvas.draw()
|
|
1256
1256
|
|
|
1257
1257
|
|
|
@@ -1300,6 +1300,11 @@ def plot_rays(var, skip=1, rays=None, **kwargs):
|
|
|
1300
1300
|
kwargs["hold"] = True
|
|
1301
1301
|
return
|
|
1302
1302
|
|
|
1303
|
+
if rays:
|
|
1304
|
+
ray_list = [var.data[i] for i in rays]
|
|
1305
|
+
else:
|
|
1306
|
+
ray_list = var.data[ray_slice]
|
|
1307
|
+
|
|
1303
1308
|
if not isinstance(v, sdf.BlockLagrangianMesh):
|
|
1304
1309
|
k = "cbar_label"
|
|
1305
1310
|
if k not in kwargs or (
|
|
@@ -1311,30 +1316,23 @@ def plot_rays(var, skip=1, rays=None, **kwargs):
|
|
|
1311
1316
|
k0 = "vmin"
|
|
1312
1317
|
k1 = "vmax"
|
|
1313
1318
|
k = "vrange"
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
vmax = v.data.max()
|
|
1318
|
-
if rays:
|
|
1319
|
-
ray_list = [var.data[i] for i in rays]
|
|
1320
|
-
else:
|
|
1321
|
-
ray_list = var.data[ray_slice]
|
|
1319
|
+
vmin, vmax = 1e99, -1e99
|
|
1320
|
+
if k not in kwargs and not (k0 in kwargs and k1 in kwargs) \
|
|
1321
|
+
and len(ray_list) > 0:
|
|
1322
1322
|
for v in ray_list:
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
kwargs[k0] = vmin
|
|
1327
|
-
if k1 not in kwargs:
|
|
1328
|
-
kwargs[k1] = vmax
|
|
1323
|
+
if len(v.data) > 0:
|
|
1324
|
+
vmin = min(vmin, v.data.min())
|
|
1325
|
+
vmax = max(vmax, v.data.max())
|
|
1329
1326
|
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1327
|
+
if k0 not in kwargs:
|
|
1328
|
+
kwargs[k0] = vmin
|
|
1329
|
+
if k1 not in kwargs:
|
|
1330
|
+
kwargs[k1] = vmax
|
|
1334
1331
|
|
|
1335
1332
|
for v in ray_list:
|
|
1336
|
-
|
|
1337
|
-
|
|
1333
|
+
if len(v.data) > 0:
|
|
1334
|
+
plot_auto(v, update=False, **kwargs)
|
|
1335
|
+
kwargs["hold"] = True
|
|
1338
1336
|
|
|
1339
1337
|
plot_auto(var.data[0], axis_only=True, **kwargs)
|
|
1340
1338
|
kwargs["hold"] = True
|
|
@@ -1635,7 +1633,7 @@ def plot2d_array(
|
|
|
1635
1633
|
cbar.set_label(var_label, fontsize="large", x=1.2)
|
|
1636
1634
|
figure.canvas.draw()
|
|
1637
1635
|
|
|
1638
|
-
figure.
|
|
1636
|
+
figure.set_layout_engine("tight")
|
|
1639
1637
|
figure.canvas.draw()
|
|
1640
1638
|
|
|
1641
1639
|
|
|
@@ -1959,7 +1957,7 @@ def plot_levels(
|
|
|
1959
1957
|
# gs.update(right=1-tw/fw)
|
|
1960
1958
|
# ax.set_position([box.x0, box.y0, box.width + bw, box.height])
|
|
1961
1959
|
else:
|
|
1962
|
-
fig.
|
|
1960
|
+
fig.set_layout_engine("tight")
|
|
1963
1961
|
plt.draw()
|
|
1964
1962
|
|
|
1965
1963
|
|
|
@@ -2225,7 +2223,7 @@ def plotgrid(fname=None, iso=None, title=True):
|
|
|
2225
2223
|
plt.draw()
|
|
2226
2224
|
|
|
2227
2225
|
fig = plt.gcf()
|
|
2228
|
-
fig.
|
|
2226
|
+
fig.set_layout_engine("tight")
|
|
2229
2227
|
plt.draw()
|
|
2230
2228
|
|
|
2231
2229
|
|
sdfr/sdfc_shared.dll
CHANGED
|
Binary file
|
sdfr/sdfc_shared.lib
ADDED
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
sdfr/__init__.py,sha256=OxcJAJ0ADoE54vgqMQqxhoFWyU2ldb3fb-_LFyeZZfQ,1209
|
|
2
|
+
sdfr/_commit_info.py,sha256=hqXwlOqYzU29y9NaKyuTotIZ84sBacjNh7bvhYqVsaE,112
|
|
3
|
+
sdfr/loadlib.py,sha256=xxp5MX-u7ZHIc12mcvN-y8L5UEjY-aEgINj2r-1swWk,2358
|
|
4
|
+
sdfr/SDF.py,sha256=fawFbkOiSIzeKOtc6Vic0OQ96q2on213IP4jSxLTbRo,31570
|
|
5
|
+
sdfr/sdf_helper.py,sha256=n-2h-MrqQM-5p-lsmLhIealtSnsOeQTd-nNezYp0EgA,63670
|
|
6
|
+
sdfr/sdfc_shared.dll,sha256=pgGjFHIHVQf0iuJvYF0W_3kdJyZOUN3bH_Vud3K2m1c,102400
|
|
7
|
+
sdfr/sdfc_shared.lib,sha256=3tq7FEdM0AIZ5XN6oilKzMfrbTk29r7JWvPq5UQpJw0,3652
|
|
8
|
+
sdfr-1.4.4.dist-info/METADATA,sha256=_2w8TOMMbZPmHFAhTMZOQ67AsYJEk7hCQioGlhVOItk,370
|
|
9
|
+
sdfr-1.4.4.dist-info/WHEEL,sha256=2gMiQ9URLdcVSVn--wWLd3wXucnRxZtbu4ekGokbEAk,99
|
|
10
|
+
sdfr-1.4.4.dist-info/licenses/LICENSE,sha256=gpLeavs1KxgJFrpL_uVDh0MoDvPfJoZ89A5dSCl4P5U,1652
|
|
11
|
+
sdfr-1.4.4.dist-info/licenses/LICENSE_README.txt,sha256=KlBSoHArwoXbiygx3IJTjtgM7hLNO9o8ZMlZV77nrXs,235
|
|
12
|
+
sdfr-1.4.4.dist-info/RECORD,,
|
sdfr-1.4.2.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
sdfr/__init__.py,sha256=OxcJAJ0ADoE54vgqMQqxhoFWyU2ldb3fb-_LFyeZZfQ,1209
|
|
2
|
-
sdfr/_commit_info.py,sha256=jwTvStv8tg4Qb70lnQJKYmLqt8iKXFkCWyjp6Nny_v8,111
|
|
3
|
-
sdfr/loadlib.py,sha256=EMcnZhh68fS72Bjv8QtfDzPbowx1FfaqX4TPhDl-o94,2328
|
|
4
|
-
sdfr/SDF.py,sha256=bt4DOuOTmbc_lvtTBz7khVtbaFStiO6RKN2FAq3DjrI,31144
|
|
5
|
-
sdfr/sdf_helper.py,sha256=cI6F9531e7hbp6oe_hnjPi9pdl6QddsTbohqlNdyg6c,63755
|
|
6
|
-
sdfr/sdfc_shared.dll,sha256=gFEUnchXoZ0R7kaItozUs8g7oqDt6Qd1fxgLH5A-6P8,11264
|
|
7
|
-
sdfr-1.4.2.dist-info/METADATA,sha256=qv9qETHA5SXPuwveGOfKF2t8B3sUMBgvpV6j7hda6tI,370
|
|
8
|
-
sdfr-1.4.2.dist-info/WHEEL,sha256=2gMiQ9URLdcVSVn--wWLd3wXucnRxZtbu4ekGokbEAk,99
|
|
9
|
-
sdfr-1.4.2.dist-info/licenses/LICENSE,sha256=gpLeavs1KxgJFrpL_uVDh0MoDvPfJoZ89A5dSCl4P5U,1652
|
|
10
|
-
sdfr-1.4.2.dist-info/licenses/LICENSE_README.txt,sha256=KlBSoHArwoXbiygx3IJTjtgM7hLNO9o8ZMlZV77nrXs,235
|
|
11
|
-
sdfr-1.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|