turbx 1.0.2__py3-none-any.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.
turbx/ztmd_loader.py ADDED
@@ -0,0 +1,56 @@
1
+ import os
2
+ import types
3
+
4
+ import h5py
5
+ import numpy as np
6
+
7
+ # ======================================================================
8
+
9
+ def ztmd_loader(fn,names):
10
+ '''
11
+ Loader function for ZTMD files, return blank object with datasets attached
12
+ '''
13
+
14
+ if not os.path.isfile(fn):
15
+ raise FileNotFoundError(fn)
16
+
17
+ obj = types.SimpleNamespace()
18
+
19
+ with h5py.File(fn,'r') as hf:
20
+
21
+ ## 0D: Attach top-level attributes
22
+ for k,v in hf.attrs.items():
23
+ setattr(obj, k, v)
24
+
25
+ ## tmp
26
+ obj.mu_inf = obj.mu_Suth_ref*(obj.T_inf/obj.T_Suth_ref)**(3/2) * ((obj.T_Suth_ref+obj.S_Suth)/(obj.T_inf+obj.S_Suth))
27
+ obj.rho_inf = obj.p_inf/(obj.R*obj.T_inf)
28
+ obj.nu_inf = obj.mu_inf/obj.rho_inf
29
+ obj.a_inf = np.sqrt(obj.kappa*obj.R*obj.T_inf)
30
+ obj.U_inf = obj.Ma*obj.a_inf
31
+ obj.cp = obj.R*obj.kappa/(obj.kappa-1.)
32
+ obj.cv = obj.cp/obj.kappa
33
+ obj.recov_fac = obj.Pr**(1/3)
34
+ obj.Taw = obj.T_inf + obj.recov_fac*obj.U_inf**2/(2*obj.cp)
35
+ obj.lchar = obj.Re*obj.nu_inf/obj.U_inf
36
+
37
+ ## 1D: Attach contents of group dims/
38
+ if 'dims' in hf:
39
+ for dsn in hf['dims']:
40
+ ds = hf[f'dims/{dsn}']
41
+ setattr(obj, dsn, ds[()])
42
+
43
+ ## 1D: Attach contents of group data_1Dx/
44
+ if 'data_1Dx' in hf:
45
+ for dsn in hf['data_1Dx']:
46
+ ds = hf[f'data_1Dx/{dsn}']
47
+ setattr(obj, dsn, ds[()])
48
+
49
+ ## 2D : Attach contents of group data/
50
+ if 'data' in hf:
51
+ for dsn in hf['data']:
52
+ if dsn in names: ## only load if explicitly asked for
53
+ ds = hf[f'data/{dsn}']
54
+ setattr(obj, dsn, ds[()].T)
55
+
56
+ return obj
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 iagappel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.2
2
+ Name: turbx
3
+ Version: 1.0.2
4
+ Summary: Extensible toolkit for analyzing turbulent flow datasets
5
+ Author: Jason A
6
+ Maintainer: Jason A
7
+ License: MIT
8
+ Keywords: turbulence,fluid mechanics,DNS,MPI,HPC
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Topic :: Scientific/Engineering :: Physics
14
+ Classifier: Topic :: System :: Distributed Computing
15
+ Classifier: Topic :: Database
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: mpi4py>=4.0
20
+ Requires-Dist: numpy>=2.0
21
+ Requires-Dist: scipy>=1.14
22
+ Requires-Dist: h5py>=3.11
23
+ Requires-Dist: matplotlib>=3.9
24
+ Requires-Dist: tqdm>=4.66
25
+ Requires-Dist: psutil>=6.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: ruff>=0.6; extra == "dev"
28
+ Requires-Dist: pytest>=8.0; extra == "dev"
29
+ Requires-Dist: pyright>=1.1; extra == "dev"
30
+
31
+ # turbx
32
+ [![PyPI version](https://badge.fury.io/py/turbx.svg)](https://badge.fury.io/py/turbx)
33
+ [![Downloads](https://pepy.tech/badge/turbx)](https://pepy.tech/project/turbx)
34
+ <!---
35
+ [![pipeline status](https://gitlab.iag.uni-stuttgart.de/transi/turbx/badges/master/pipeline.svg)](https://gitlab.iag.uni-stuttgart.de/transi/turbx/-/commits/master)
36
+ -->
37
+
38
+ ## About
39
+
40
+ `turbx` is a package for processing turbulent flow datasets. Primary data access classes are `super()`ed wrappers of `h5py.File` that make data & metadata access tidy and performant. Workloads requiring heavy I/O and compute are made scalable using parallelization and high-performance collective MPI-IO.
41
+
42
+ ## Pre-installation requirements
43
+
44
+ ### `h5py`
45
+ `turbx` is designed to be used with parallel-mode `h5py`, the `python3` API for `HDF5`. Most basic workflows will still work transparently with the basic serial install of `h5py`, however data-heavy workflows will require the full API functionality. This requires:
46
+
47
+ - A parallel `HDF5` installation
48
+ - `h5py` built with `HDF5_MPI="ON"`; see [h5py docs](https://docs.h5py.org/en/stable/mpi.html)
49
+
50
+ <br>
51
+
52
+ Confirm that `h5py` was built with MPI support:
53
+ ```python
54
+ >>> import h5py
55
+ >>> h5py.get_config().mpi
56
+ True
57
+ ```
58
+
59
+
60
+ ### `mpi4py`
61
+
62
+ High-performance collective MPI-IO and MPI operations are handled with `mpi4py`. This requires:
63
+
64
+ - An MPI implementation such as `OpenMPI` or `MPICH`
65
+ - `mpi4py`; see [mpi4py docs](https://mpi4py.readthedocs.io/en/stable/install.html)
66
+
67
+
68
+
69
+
70
+ ## Installation
71
+
72
+ ### TL;DR
73
+ Install binary directly from [PyPI](https://pypi.org/project/turbx):
74
+
75
+ ```
76
+ python3 -m pip install --upgrade turbx
77
+ ```
78
+
79
+ ---
80
+
81
+ ### Non-root install with `--user`
82
+
83
+ The `--user` flag can be added to install to `~/.local/lib/pythonX.Y/site-packages` rather than `site-packages` of the `python3` installation itself. This is often required for HPC environments where installing packages for the system `python3` is not allowed for regular users.
84
+
85
+ <br>
86
+
87
+ ### Editable installs
88
+
89
+ `turbx` can also be installed from source in `editable` mode (see [setuptools docs](https://setuptools.pypa.io/en/latest/userguide/development_mode.html)). Once the source is acquired (PyPI or GitLab), the source can be installed from the project root folder:
90
+
91
+ ```
92
+ python3 -m pip install --upgrade -e .
93
+ ```
94
+
95
+ <br>
96
+
97
+ ### Installing on systems with no outbound network access
98
+
99
+ If the restricted install environment requires `devpi-server`:
100
+
101
+
102
+ **On a local machine with internet access:**
103
+ ```
104
+ devpi-server
105
+ ```
106
+
107
+ **On a local machine with internet access:**
108
+ ```
109
+ ssh -R <remote_port>:localhost:<local_devpi_port> user@domain.com
110
+ ```
111
+
112
+ - `<local_devpi_port>` is the port on which `devpi-server` is running locally
113
+ - `<remote_port>` is an arbitrary free port on the system login node used to expose the mirror remotely
114
+ - After connecting, the PyPI mirror will be reachable on the server side at: `http://localhost:<remote_port>`
115
+
116
+ **On the remote system:**
117
+ ```
118
+ python3 -m pip install --upgrade [--user] [--editable] --index-url http://localhost:<remote_port>/root/pypi/+simple/ <package-or-path>
119
+ ```
120
+
@@ -0,0 +1,41 @@
1
+ turbx/__init__.py,sha256=y9u_gPAfDSbZB_Cmf-lcQ8RpMeMxjUBeA9RnzwWtPpo,1371
2
+ turbx/bl.py,sha256=lFyhPvgOMbzY9as9pvBNGJRlsiY_cvYbyCUC9cOxB0k,18183
3
+ turbx/blasius.py,sha256=aDvTWMWo1oKehkQjhjwSQYonHOBF5sqzieXxZYZ7-IU,2128
4
+ turbx/cli.py,sha256=ZEvG7TCcGT6V7nOd46zXa71VrvDQpaxpKT9EvmH8r08,504
5
+ turbx/composite_profile.py,sha256=iGQdvtbua4p0h9oUWTFLsasvLKz7fy_bXKh-MEbIUd0,8901
6
+ turbx/confidence_interval.py,sha256=Y8Ke6gYH5RALxzDLJWWbJoB30aBB46uEBLvcUJsQ-0M,2184
7
+ turbx/eas3.py,sha256=XxaCjArLGQ_qP6zUrTYEgLrsEA1V1SJrIErnE3CnkbM,17906
8
+ turbx/eas4.py,sha256=gmKakvFfs_7sRHI8zmKbXszJarcfc7jwF4nGFGWjjcM,26713
9
+ turbx/fig_ax_constructor.py,sha256=o9D1Sk_vo2Q5E7HEI5UofKECSqKqF8LMl7VpOkn7qFA,1491
10
+ turbx/freestream_parameters.py,sha256=H_XmgOt78mdd1Ru2gd2fUeSO1ZUIjOc7A0pV1NwVjU4,12583
11
+ turbx/gradient.py,sha256=H7EdzQstlnZueAJeuH_5ts0CII89h42dAfEwMBJnkVQ,14377
12
+ turbx/grid_metric.py,sha256=n_iYC8dlusTLi4-n9pByZfG_MWFs7mvUJwMMVF91nlQ,10787
13
+ turbx/h5.py,sha256=XIjd0MnLp83fYCkAJv5AqxbhZlNXvnV_SksCnTaebKI,9094
14
+ turbx/mvp.py,sha256=W3kvMN8t2uWGEpTDH03P_W0Gw5Fz2BysKcK2e26-VWs,12035
15
+ turbx/rgd.py,sha256=FSNcuI3c_v_7TpoLIUa7n12CWGlxsx8nNqeuo_IJZd4,129597
16
+ turbx/rgd_mean.py,sha256=sMyz9K6Pki2Rq2P9d2gEHhFx_ASTaHAgIK-RM9fDEFE,21840
17
+ turbx/rgd_testing.py,sha256=M3c4F2SsJeqU5t4jcgXansI9bumWr_C_QLaUPZEe9QU,12836
18
+ turbx/rgd_xpln_ccor.py,sha256=fDik9G9RsoVWxRQQs3qKAa8tcsocWgrUazvg7n6Wcxk,29637
19
+ turbx/rgd_xpln_coh.py,sha256=xTX4FTig7Dp6qXFhWdoeOcvuJY3E8l0W0n0J-Rv_mCM,40989
20
+ turbx/rgd_xpln_mean_dim.py,sha256=iKVnMJRI8WtCAkEivs49bOwQzUTZFX7kPITX0ddLb1M,14099
21
+ turbx/rgd_xpln_spectrum.py,sha256=0TwIdQIEAnNjMjbWYS0VdLzzuaQDjzfeyda9Gs45r84,38332
22
+ turbx/rgd_xpln_stats.py,sha256=gvrl-1CKQF6B8menlB29JEVoRh-cQW1m9HL3N54YXOw,32522
23
+ turbx/rgd_xpln_turb_budget.py,sha256=EyHHatJZb1Kfuts9HDH2pXHFdJ8J3o9-KojT0NSXzDU,52785
24
+ turbx/set_mpl_env.py,sha256=-1h5bqI2FUcqOSbOVW2-hQzKv-h9OzagBVzAk5S01Rw,3195
25
+ turbx/signal.py,sha256=cvnBwbpaIO6uPdedvZeQCzqk93bpAIggThdF-ynNVnM,8842
26
+ turbx/spd.py,sha256=OreeuAEnrL9wkYBpCi-dI8_hAAqt_mRGd2jzAdalJOw,55150
27
+ turbx/spd_wall_ccor.py,sha256=2YKyW01BfW9h5wh3iwoCs1-tqxOq1N7rS7pY3LUDmBs,26063
28
+ turbx/spd_wall_ci.py,sha256=UBFAqd3AQ3n77NtHeHklmFKQAC2uBStQ0DmFOyw908g,14750
29
+ turbx/spd_wall_import.py,sha256=dpqWpNMiM3S6sAGDde_afBnpjzMvtQpHyLAfhKG6Dh0,27830
30
+ turbx/spd_wall_spectrum.py,sha256=Qbua9fWrRk4Ap9FqrPnliI6mqGHdXAek9J3Fljb1oOE,25805
31
+ turbx/spd_wall_stats.py,sha256=sG2i7P1FOqxL2xHEWuZfgZcQvyyFrnqRA5u22vBICOE,26664
32
+ turbx/utils.py,sha256=mQtrZaU3BI_SXi02Tze55q4ZR8cS5Vtb4R73fgDjCzc,2317
33
+ turbx/ztmd.py,sha256=P-TQRBGfUVwErkoVs9EAH9s4p7EWsokbwXgl7EMsnCw,113405
34
+ turbx/ztmd_analysis.py,sha256=r8DHoTeYA6yzSniwsefjo9fEI3LvowIzKC33vefTlU8,87734
35
+ turbx/ztmd_loader.py,sha256=BebSmoxUYKWk16_xFoRQ04AoU8Mfr_JFb5kkr2yJmNI,1839
36
+ turbx-1.0.2.dist-info/LICENSE,sha256=jpVnztpA1ZGgf3THAye-vf4NiJ2YclY6U5KODPnANxo,1065
37
+ turbx-1.0.2.dist-info/METADATA,sha256=wDVbBF7RFSn4yRHeAuJhv5qc1c8bN8sRsZcdfxjfx10,4033
38
+ turbx-1.0.2.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
39
+ turbx-1.0.2.dist-info/entry_points.txt,sha256=_krRugpZJMkvcAox_g0T1KqCXfbQ4MARyspQMSAIkVA,41
40
+ turbx-1.0.2.dist-info/top_level.txt,sha256=LPn4NGmMN4N44Virr-EaKGcVGcbWNVmT171RUWnGOPs,6
41
+ turbx-1.0.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (76.1.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ turbx = turbx.cli:main
@@ -0,0 +1 @@
1
+ turbx