pyrestoolbox 3.0.4__tar.gz → 3.1.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 (139) hide show
  1. pyrestoolbox-3.1.0/.github/workflows/build-wheels.yml +182 -0
  2. pyrestoolbox-3.1.0/.gitignore +44 -0
  3. pyrestoolbox-3.1.0/Cargo.lock +230 -0
  4. pyrestoolbox-3.1.0/Cargo.toml +21 -0
  5. pyrestoolbox-3.1.0/MANIFEST.in +11 -0
  6. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/PKG-INFO +54 -20
  7. pyrestoolbox-3.0.4/pyrestoolbox.egg-info/PKG-INFO → pyrestoolbox-3.1.0/README.rst +39 -32
  8. pyrestoolbox-3.1.0/ResToolbox/privacy_policy.md +48 -0
  9. pyrestoolbox-3.1.0/build_pure_python.py +57 -0
  10. pyrestoolbox-3.1.0/pyproject.toml +58 -0
  11. pyrestoolbox-3.1.0/pyrestoolbox/_accelerator.py +174 -0
  12. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/brine/_lib_vle_engine.py +59 -0
  13. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/brine/brine.py +36 -7
  14. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/dca/dca.py +27 -0
  15. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/brine.rst +14 -12
  16. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/changelist.rst +13 -0
  17. pyrestoolbox-3.1.0/pyrestoolbox/docs/img/bot.png +0 -0
  18. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/matbal.rst +20 -1
  19. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/oil.rst +121 -13
  20. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/simtools.rst +1 -1
  21. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/gas/gas.py +65 -1
  22. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/layer/layer.py +3 -1
  23. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/matbal/matbal.py +32 -1
  24. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/nodal/nodal.py +63 -0
  25. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/oil/oil.py +283 -62
  26. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/simtools/simtools.py +17 -11
  27. pyrestoolbox-3.1.0/setup.cfg +30 -0
  28. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/setup.py +5 -3
  29. pyrestoolbox-3.1.0/src/bessel.rs +188 -0
  30. pyrestoolbox-3.1.0/src/critical_properties/mod.rs +166 -0
  31. pyrestoolbox-3.1.0/src/dca/hyperbolic.rs +252 -0
  32. pyrestoolbox-3.1.0/src/dca/mod.rs +51 -0
  33. pyrestoolbox-3.1.0/src/dca/ransac.rs +228 -0
  34. pyrestoolbox-3.1.0/src/gas_viscosity/mod.rs +161 -0
  35. pyrestoolbox-3.1.0/src/gwr.rs +630 -0
  36. pyrestoolbox-3.1.0/src/lib.rs +81 -0
  37. pyrestoolbox-3.1.0/src/matbal/mod.rs +25 -0
  38. pyrestoolbox-3.1.0/src/matbal/objective.rs +61 -0
  39. pyrestoolbox-3.1.0/src/oil/density.rs +287 -0
  40. pyrestoolbox-3.1.0/src/oil/mod.rs +64 -0
  41. pyrestoolbox-3.1.0/src/pseudopressure.rs +255 -0
  42. pyrestoolbox-3.1.0/src/spycher_pruess/mod.rs +29 -0
  43. pyrestoolbox-3.1.0/src/spycher_pruess/solubility.rs +794 -0
  44. pyrestoolbox-3.1.0/src/vle/alpha.rs +71 -0
  45. pyrestoolbox-3.1.0/src/vle/bip.rs +297 -0
  46. pyrestoolbox-3.1.0/src/vle/components.rs +123 -0
  47. pyrestoolbox-3.1.0/src/vle/eos.rs +233 -0
  48. pyrestoolbox-3.1.0/src/vle/flash.rs +419 -0
  49. pyrestoolbox-3.1.0/src/vle/fugacity.rs +124 -0
  50. pyrestoolbox-3.1.0/src/vle/k_init.rs +165 -0
  51. pyrestoolbox-3.1.0/src/vle/mod.rs +188 -0
  52. pyrestoolbox-3.1.0/src/vle/rachford_rice.rs +249 -0
  53. pyrestoolbox-3.1.0/src/vlp/friction.rs +28 -0
  54. pyrestoolbox-3.1.0/src/vlp/holdup_bb.rs +116 -0
  55. pyrestoolbox-3.1.0/src/vlp/holdup_gray.rs +69 -0
  56. pyrestoolbox-3.1.0/src/vlp/holdup_hb.rs +80 -0
  57. pyrestoolbox-3.1.0/src/vlp/holdup_wg.rs +94 -0
  58. pyrestoolbox-3.1.0/src/vlp/ift.rs +59 -0
  59. pyrestoolbox-3.1.0/src/vlp/mod.rs +135 -0
  60. pyrestoolbox-3.1.0/src/vlp/pvt_helpers.rs +185 -0
  61. pyrestoolbox-3.1.0/src/vlp/segment_gas.rs +569 -0
  62. pyrestoolbox-3.1.0/src/vlp/segment_oil.rs +617 -0
  63. pyrestoolbox-3.1.0/src/vlp/static_column.rs +53 -0
  64. pyrestoolbox-3.1.0/src/zfactor/mod.rs +479 -0
  65. pyrestoolbox-3.0.4/MANIFEST.in +0 -6
  66. pyrestoolbox-3.0.4/README.rst +0 -328
  67. pyrestoolbox-3.0.4/pyproject.toml +0 -3
  68. pyrestoolbox-3.0.4/pyrestoolbox/docs/.ipynb_checkpoints/examples-checkpoint.ipynb +0 -1458
  69. pyrestoolbox-3.0.4/pyrestoolbox/docs/.ipynb_checkpoints/nodal_examples-checkpoint.ipynb +0 -825
  70. pyrestoolbox-3.0.4/pyrestoolbox/docs/.ipynb_checkpoints/nodal_hydrate_demo-checkpoint.ipynb +0 -1345
  71. pyrestoolbox-3.0.4/pyrestoolbox/docs/img/bot.png +0 -0
  72. pyrestoolbox-3.0.4/pyrestoolbox/tests/__init__.py +0 -0
  73. pyrestoolbox-3.0.4/pyrestoolbox/tests/run_all_tests.py +0 -98
  74. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_brine.py +0 -266
  75. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_dca.py +0 -675
  76. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_doc_examples.py +0 -1394
  77. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_gas.py +0 -849
  78. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_layer.py +0 -115
  79. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_matbal.py +0 -724
  80. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_nodal.py +0 -836
  81. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_oil.py +0 -499
  82. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_recommend.py +0 -104
  83. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_sensitivity.py +0 -122
  84. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_simtools.py +0 -405
  85. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_unified_brine_design.py +0 -351
  86. pyrestoolbox-3.0.4/pyrestoolbox/tests/test_viscosity_scaling.py +0 -464
  87. pyrestoolbox-3.0.4/pyrestoolbox.egg-info/SOURCES.txt +0 -91
  88. pyrestoolbox-3.0.4/pyrestoolbox.egg-info/dependency_links.txt +0 -1
  89. pyrestoolbox-3.0.4/pyrestoolbox.egg-info/requires.txt +0 -7
  90. pyrestoolbox-3.0.4/pyrestoolbox.egg-info/top_level.txt +0 -1
  91. pyrestoolbox-3.0.4/setup.cfg +0 -30
  92. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/LICENSE +0 -0
  93. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/__init__.py +0 -0
  94. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/brine/__init__.py +0 -0
  95. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/brine/_lib_salting_library.py +0 -0
  96. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/classes/__init__.py +0 -0
  97. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/classes/classes.py +0 -0
  98. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/constants/__init__.py +0 -0
  99. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/constants/constants.py +0 -0
  100. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/dca/__init__.py +0 -0
  101. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/dca.rst +0 -0
  102. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/examples.ipynb +0 -0
  103. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/gas.rst +0 -0
  104. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/img/bot_PVTO.png +0 -0
  105. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/img/bot_img.png +0 -0
  106. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/img/dry_gas.png +0 -0
  107. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/img/grid_sat_df.png +0 -0
  108. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/img/influence.png +0 -0
  109. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/img/properties_df.png +0 -0
  110. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/img/sgof.png +0 -0
  111. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/img/swof.png +0 -0
  112. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/layer.rst +0 -0
  113. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/library.rst +0 -0
  114. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/nodal.rst +0 -0
  115. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/nodal_examples.ipynb +0 -0
  116. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/nodal_hydrate_demo.ipynb +0 -0
  117. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/recommend.rst +0 -0
  118. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/docs/sensitivity.rst +0 -0
  119. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/gas/__init__.py +0 -0
  120. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/layer/__init__.py +0 -0
  121. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/library/__init__.py +0 -0
  122. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/library/component_library.xlsx +0 -0
  123. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/library/library.py +0 -0
  124. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/matbal/__init__.py +0 -0
  125. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/nodal/__init__.py +0 -0
  126. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/oil/__init__.py +0 -0
  127. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/plyasunov/__init__.py +0 -0
  128. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/plyasunov/iapws_if97.py +0 -0
  129. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/plyasunov/plyasunov_model.py +0 -0
  130. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/plyasunov/water_properties.py +0 -0
  131. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/recommend/__init__.py +0 -0
  132. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/recommend/recommend.py +0 -0
  133. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/sensitivity/__init__.py +0 -0
  134. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/sensitivity/sensitivity.py +0 -0
  135. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/shared_fns/__init__.py +0 -0
  136. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/shared_fns/shared_fns.py +0 -0
  137. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/simtools/__init__.py +0 -0
  138. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/validate/__init__.py +0 -0
  139. {pyrestoolbox-3.0.4 → pyrestoolbox-3.1.0}/pyrestoolbox/validate/validate.py +0 -0
@@ -0,0 +1,182 @@
1
+ name: Build and publish wheels
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ - "[0-9]*"
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ # ── Build Rust-accelerated wheels for each platform ──────────────────
15
+ build-wheels:
16
+ name: Build wheels (${{ matrix.os }})
17
+ runs-on: ${{ matrix.os }}
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ os: [ubuntu-latest, macos-14, windows-latest]
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.12"
28
+
29
+ - name: Install Rust toolchain
30
+ if: matrix.os != 'windows-latest'
31
+ uses: dtolnay/rust-toolchain@stable
32
+ with:
33
+ targets: ${{ matrix.os == 'macos-14' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
34
+
35
+ - name: Install Rust toolchain (Windows GNU)
36
+ if: matrix.os == 'windows-latest'
37
+ run: |
38
+ rustup toolchain install stable-x86_64-pc-windows-gnu
39
+ rustup default stable-x86_64-pc-windows-gnu
40
+ shell: bash
41
+
42
+ - name: Build wheels via cibuildwheel
43
+ uses: pypa/cibuildwheel@v2.21
44
+ env:
45
+ # Use maturin as the build frontend
46
+ CIBW_BUILD_FRONTEND: "build"
47
+ # Build for CPython 3.10-3.13 (drop 3.9 — scipy 1.14+ requires 3.10)
48
+ CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
49
+ # Skip 32-bit and musl (uncommon for scientific Python)
50
+ CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
51
+ # maturin needs Rust in the build container
52
+ CIBW_BEFORE_ALL_LINUX: >
53
+ yum install -y m4 diffutils &&
54
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
55
+ CIBW_ENVIRONMENT_LINUX: 'PATH="$HOME/.cargo/bin:$PATH"'
56
+ # macOS: build native arch only per runner (no cross-compilation)
57
+ CIBW_ARCHS_MACOS: "arm64"
58
+ CIBW_ARCHS_LINUX: "x86_64"
59
+ CIBW_ARCHS_WINDOWS: "AMD64"
60
+ # Windows: use gnu target so GMP can build with MinGW GCC.
61
+ # MSYS2 is pre-installed on windows-latest runners.
62
+ CIBW_BEFORE_ALL_WINDOWS: >
63
+ C:\msys64\usr\bin\pacman.exe -S --noconfirm
64
+ mingw-w64-x86_64-gcc
65
+ m4
66
+ diffutils
67
+ make
68
+ CIBW_ENVIRONMENT_WINDOWS: >
69
+ PATH="C:\\msys64\\mingw64\\bin;C:\\msys64\\usr\\bin;$PATH"
70
+ # Rust cross-compile env for macOS x86_64 on arm64 runner
71
+ CIBW_ENVIRONMENT_MACOS: >
72
+ CARGO_BUILD_TARGET="aarch64-apple-darwin"
73
+ # Test: only verify import works (avoid building scipy from source in containers)
74
+ CIBW_TEST_COMMAND: >
75
+ python -c "from pyrestoolbox._accelerator import get_status; s = get_status(); print(s); assert s['rust_available'], f'Rust not loaded: {s}'"
76
+ CIBW_TEST_REQUIRES: "numpy"
77
+ # Skip tests on Linux (scipy needs OpenBLAS absent in manylinux) and cross-arch
78
+ CIBW_TEST_SKIP: "*-manylinux* *-macosx_x86_64"
79
+
80
+ - uses: actions/upload-artifact@v4
81
+ with:
82
+ name: wheels-${{ matrix.os }}
83
+ path: ./wheelhouse/*.whl
84
+
85
+ # ── Build macOS x86_64 wheels on separate Intel runner ───────────────
86
+ build-wheels-macos-x86:
87
+ name: Build wheels (macos-x86_64)
88
+ runs-on: macos-13
89
+ if: false # Enable when macos-13 runners are available, or use cross-compilation
90
+ steps:
91
+ - uses: actions/checkout@v4
92
+
93
+ - uses: actions/setup-python@v5
94
+ with:
95
+ python-version: "3.12"
96
+
97
+ - name: Install Rust toolchain
98
+ uses: dtolnay/rust-toolchain@stable
99
+
100
+ - name: Build wheels via cibuildwheel
101
+ uses: pypa/cibuildwheel@v2.21
102
+ env:
103
+ CIBW_BUILD_FRONTEND: "build"
104
+ CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
105
+ CIBW_ARCHS_MACOS: "x86_64"
106
+ CIBW_TEST_COMMAND: >
107
+ python -c "from pyrestoolbox._accelerator import get_status; s = get_status(); print(s); assert s['rust_available'], f'Rust not loaded: {s}'"
108
+ CIBW_TEST_REQUIRES: "numpy"
109
+
110
+ - uses: actions/upload-artifact@v4
111
+ with:
112
+ name: wheels-macos-x86
113
+ path: ./wheelhouse/*.whl
114
+
115
+ # ── Build pure-Python fallback wheel ─────────────────────────────────
116
+ build-pure-python:
117
+ name: Build pure-Python wheel
118
+ runs-on: ubuntu-latest
119
+ steps:
120
+ - uses: actions/checkout@v4
121
+
122
+ - uses: actions/setup-python@v5
123
+ with:
124
+ python-version: "3.12"
125
+
126
+ - name: Install build tools
127
+ run: pip install build wheel setuptools
128
+
129
+ - name: Build pure-Python wheel
130
+ run: python build_pure_python.py
131
+
132
+ - uses: actions/upload-artifact@v4
133
+ with:
134
+ name: wheels-pure-python
135
+ path: ./dist/*.whl
136
+
137
+ # ── Build sdist ──────────────────────────────────────────────────────
138
+ build-sdist:
139
+ name: Build source distribution
140
+ runs-on: ubuntu-latest
141
+ steps:
142
+ - uses: actions/checkout@v4
143
+
144
+ - uses: actions/setup-python@v5
145
+ with:
146
+ python-version: "3.12"
147
+
148
+ - name: Install Rust toolchain
149
+ uses: dtolnay/rust-toolchain@stable
150
+
151
+ - name: Install maturin
152
+ run: pip install maturin
153
+
154
+ - name: Build sdist
155
+ run: maturin sdist --out dist
156
+
157
+ - uses: actions/upload-artifact@v4
158
+ with:
159
+ name: sdist
160
+ path: ./dist/*.tar.gz
161
+
162
+ # ── Publish to PyPI on tag push ──────────────────────────────────────
163
+ publish:
164
+ name: Publish to PyPI
165
+ needs: [build-wheels, build-pure-python, build-sdist]
166
+ runs-on: ubuntu-latest
167
+ if: startsWith(github.ref, 'refs/tags/')
168
+ environment:
169
+ name: pypi
170
+ url: https://pypi.org/project/pyrestoolbox/
171
+ permissions:
172
+ id-token: write # trusted publishing
173
+ steps:
174
+ - uses: actions/download-artifact@v4
175
+ with:
176
+ path: dist
177
+ merge-multiple: true
178
+
179
+ - name: Publish to PyPI
180
+ uses: pypa/gh-action-pypi-publish@release/v1
181
+ with:
182
+ packages-dir: dist/
@@ -0,0 +1,44 @@
1
+ # Build artifacts
2
+ build/
3
+ dist/
4
+ *.egg-info/
5
+
6
+ # Byte-compiled / cached
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.pyo
11
+
12
+ # IDE / editor
13
+ .vscode/
14
+ .idea/
15
+ *.swp
16
+ *.swo
17
+
18
+ # Claude Code
19
+ .claude/
20
+ CLAUDE.md
21
+
22
+ # Jupyter checkpoints
23
+ .ipynb_checkpoints/
24
+
25
+ # Windows NTFS artifacts
26
+ *Zone.Identifier
27
+
28
+ # Rust build artifacts
29
+ target/
30
+ *.so
31
+ *.pyd
32
+ *.dll
33
+
34
+ # Local working files
35
+ *.pdf
36
+ *.rtf
37
+ *.VFP
38
+ *.png
39
+
40
+ # Standalone ILT development (lives in ilt-inversion repo)
41
+ ilt/
42
+ benchmark_ilt.py
43
+ benchmark_rust.py
44
+ BUILD_INSTRUCTIONS.txt
@@ -0,0 +1,230 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "autocfg"
7
+ version = "1.5.0"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
10
+
11
+ [[package]]
12
+ name = "az"
13
+ version = "1.3.0"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "be5eb007b7cacc6c660343e96f650fedf4b5a77512399eb952ca6642cf8d13f7"
16
+
17
+ [[package]]
18
+ name = "cfg-if"
19
+ version = "1.0.4"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
22
+
23
+ [[package]]
24
+ name = "gmp-mpfr-sys"
25
+ version = "1.7.0"
26
+ source = "registry+https://github.com/rust-lang/crates.io-index"
27
+ checksum = "8cfc928d8ff4ab3767a3674cf55f81186436fb6070866bb1443ffe65a640d2d6"
28
+ dependencies = [
29
+ "libc",
30
+ "windows-sys",
31
+ ]
32
+
33
+ [[package]]
34
+ name = "heck"
35
+ version = "0.5.0"
36
+ source = "registry+https://github.com/rust-lang/crates.io-index"
37
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
38
+
39
+ [[package]]
40
+ name = "indoc"
41
+ version = "2.0.7"
42
+ source = "registry+https://github.com/rust-lang/crates.io-index"
43
+ checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
44
+ dependencies = [
45
+ "rustversion",
46
+ ]
47
+
48
+ [[package]]
49
+ name = "libc"
50
+ version = "0.2.184"
51
+ source = "registry+https://github.com/rust-lang/crates.io-index"
52
+ checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
53
+
54
+ [[package]]
55
+ name = "libm"
56
+ version = "0.2.16"
57
+ source = "registry+https://github.com/rust-lang/crates.io-index"
58
+ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
59
+
60
+ [[package]]
61
+ name = "memoffset"
62
+ version = "0.9.1"
63
+ source = "registry+https://github.com/rust-lang/crates.io-index"
64
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
65
+ dependencies = [
66
+ "autocfg",
67
+ ]
68
+
69
+ [[package]]
70
+ name = "once_cell"
71
+ version = "1.21.4"
72
+ source = "registry+https://github.com/rust-lang/crates.io-index"
73
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
74
+
75
+ [[package]]
76
+ name = "portable-atomic"
77
+ version = "1.13.1"
78
+ source = "registry+https://github.com/rust-lang/crates.io-index"
79
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
80
+
81
+ [[package]]
82
+ name = "proc-macro2"
83
+ version = "1.0.106"
84
+ source = "registry+https://github.com/rust-lang/crates.io-index"
85
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
86
+ dependencies = [
87
+ "unicode-ident",
88
+ ]
89
+
90
+ [[package]]
91
+ name = "pyo3"
92
+ version = "0.23.5"
93
+ source = "registry+https://github.com/rust-lang/crates.io-index"
94
+ checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872"
95
+ dependencies = [
96
+ "cfg-if",
97
+ "indoc",
98
+ "libc",
99
+ "memoffset",
100
+ "once_cell",
101
+ "portable-atomic",
102
+ "pyo3-build-config",
103
+ "pyo3-ffi",
104
+ "pyo3-macros",
105
+ "unindent",
106
+ ]
107
+
108
+ [[package]]
109
+ name = "pyo3-build-config"
110
+ version = "0.23.5"
111
+ source = "registry+https://github.com/rust-lang/crates.io-index"
112
+ checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
113
+ dependencies = [
114
+ "once_cell",
115
+ "target-lexicon",
116
+ ]
117
+
118
+ [[package]]
119
+ name = "pyo3-ffi"
120
+ version = "0.23.5"
121
+ source = "registry+https://github.com/rust-lang/crates.io-index"
122
+ checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d"
123
+ dependencies = [
124
+ "libc",
125
+ "pyo3-build-config",
126
+ ]
127
+
128
+ [[package]]
129
+ name = "pyo3-macros"
130
+ version = "0.23.5"
131
+ source = "registry+https://github.com/rust-lang/crates.io-index"
132
+ checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da"
133
+ dependencies = [
134
+ "proc-macro2",
135
+ "pyo3-macros-backend",
136
+ "quote",
137
+ "syn",
138
+ ]
139
+
140
+ [[package]]
141
+ name = "pyo3-macros-backend"
142
+ version = "0.23.5"
143
+ source = "registry+https://github.com/rust-lang/crates.io-index"
144
+ checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028"
145
+ dependencies = [
146
+ "heck",
147
+ "proc-macro2",
148
+ "pyo3-build-config",
149
+ "quote",
150
+ "syn",
151
+ ]
152
+
153
+ [[package]]
154
+ name = "pyrestoolbox-native"
155
+ version = "0.1.0"
156
+ dependencies = [
157
+ "pyo3",
158
+ "rug",
159
+ ]
160
+
161
+ [[package]]
162
+ name = "quote"
163
+ version = "1.0.45"
164
+ source = "registry+https://github.com/rust-lang/crates.io-index"
165
+ checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
166
+ dependencies = [
167
+ "proc-macro2",
168
+ ]
169
+
170
+ [[package]]
171
+ name = "rug"
172
+ version = "1.29.0"
173
+ source = "registry+https://github.com/rust-lang/crates.io-index"
174
+ checksum = "25f6c8f906c90b48e0c1745c9f814c3a31c5eba847043b05c3e9a934dec7c4b3"
175
+ dependencies = [
176
+ "az",
177
+ "gmp-mpfr-sys",
178
+ "libc",
179
+ "libm",
180
+ ]
181
+
182
+ [[package]]
183
+ name = "rustversion"
184
+ version = "1.0.22"
185
+ source = "registry+https://github.com/rust-lang/crates.io-index"
186
+ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
187
+
188
+ [[package]]
189
+ name = "syn"
190
+ version = "2.0.117"
191
+ source = "registry+https://github.com/rust-lang/crates.io-index"
192
+ checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
193
+ dependencies = [
194
+ "proc-macro2",
195
+ "quote",
196
+ "unicode-ident",
197
+ ]
198
+
199
+ [[package]]
200
+ name = "target-lexicon"
201
+ version = "0.12.16"
202
+ source = "registry+https://github.com/rust-lang/crates.io-index"
203
+ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
204
+
205
+ [[package]]
206
+ name = "unicode-ident"
207
+ version = "1.0.24"
208
+ source = "registry+https://github.com/rust-lang/crates.io-index"
209
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
210
+
211
+ [[package]]
212
+ name = "unindent"
213
+ version = "0.2.4"
214
+ source = "registry+https://github.com/rust-lang/crates.io-index"
215
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
216
+
217
+ [[package]]
218
+ name = "windows-link"
219
+ version = "0.2.1"
220
+ source = "registry+https://github.com/rust-lang/crates.io-index"
221
+ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
222
+
223
+ [[package]]
224
+ name = "windows-sys"
225
+ version = "0.61.2"
226
+ source = "registry+https://github.com/rust-lang/crates.io-index"
227
+ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
228
+ dependencies = [
229
+ "windows-link",
230
+ ]
@@ -0,0 +1,21 @@
1
+ [package]
2
+ name = "pyrestoolbox-native"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ license = "GPL-3.0-or-later"
6
+ description = "Rust acceleration extensions for pyResToolbox"
7
+ homepage = "https://github.com/mwburgoyne/pyResToolbox"
8
+
9
+ [lib]
10
+ name = "_native"
11
+ crate-type = ["cdylib"]
12
+
13
+ [dependencies]
14
+ pyo3 = { version = "0.23", features = ["extension-module"] }
15
+ rug = { version = "1", default-features = false, features = ["float"] }
16
+
17
+ [profile.release]
18
+ opt-level = 3
19
+ lto = "fat"
20
+ codegen-units = 1
21
+ strip = true
@@ -0,0 +1,11 @@
1
+ include README.rst
2
+ include LICENSE
3
+ include Cargo.toml
4
+ include Cargo.lock
5
+ recursive-include pyrestoolbox *.py *.xlsx *.rst *.ipynb *.png
6
+ recursive-include src *.rs
7
+ global-exclude *.pyc
8
+ global-exclude *Zone.Identifier
9
+ prune pyrestoolbox/tests
10
+ prune pyrestoolbox/docs/.ipynb_checkpoints
11
+ recursive-exclude * __pycache__
@@ -1,34 +1,28 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyrestoolbox
3
- Version: 3.0.4
4
- Summary: pyResToolbox - A collection of Reservoir Engineering Utilities
5
- Home-page: https://github.com/mwburgoyne/pyResToolbox
6
- Author: Mark W. Burgoyne
7
- Author-email: mark.w.burgoyne@gmail.com
8
- License: GNU General Public License v3 or later (GPLv3+)
9
- Keywords: restoolbox,petroleum,reservoir
3
+ Version: 3.1.0
10
4
  Classifier: Programming Language :: Python :: 3
5
+ Classifier: Programming Language :: Rust
11
6
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
12
7
  Classifier: Operating System :: OS Independent
13
- Description-Content-Type: text/x-rst
14
- License-File: LICENSE
15
8
  Requires-Dist: numpy
16
9
  Requires-Dist: scipy
17
10
  Requires-Dist: pandas
18
11
  Requires-Dist: tabulate
19
- Requires-Dist: gwr_inversion
12
+ Requires-Dist: ilt-inversion
20
13
  Requires-Dist: mpmath
14
+ Requires-Dist: gmpy2
15
+ Requires-Dist: python-flint
21
16
  Requires-Dist: openpyxl
22
- Dynamic: author
23
- Dynamic: author-email
24
- Dynamic: description
25
- Dynamic: description-content-type
26
- Dynamic: home-page
27
- Dynamic: keywords
28
- Dynamic: license
29
- Dynamic: license-file
30
- Dynamic: requires-dist
31
- Dynamic: summary
17
+ License-File: LICENSE
18
+ Summary: pyResToolbox - A collection of Reservoir Engineering Utilities
19
+ Keywords: restoolbox,petroleum,reservoir
20
+ Home-Page: https://github.com/mwburgoyne/pyResToolbox
21
+ Author-email: "Mark W. Burgoyne" <mark.w.burgoyne@gmail.com>
22
+ License: GPL-3.0-or-later
23
+ Requires-Python: >=3.9
24
+ Description-Content-Type: text/x-rst; charset=UTF-8
25
+ Project-URL: Homepage, https://github.com/mwburgoyne/pyResToolbox
32
26
 
33
27
  ===================================
34
28
  ``pyrestoolbox``
@@ -66,6 +60,45 @@ Includes functions to perform calculations including;
66
60
 
67
61
  All public PVT, flow rate, and simulation table functions support both oilfield (psia, deg F, ft) and Eclipse METRIC (barsa, deg C, m) unit systems via an optional ``metric=False`` parameter. See individual module documentation for unit mapping details.
68
62
 
63
+ Rust Acceleration (Optional)
64
+ -----------------------------
65
+
66
+ pyResToolbox includes optional Rust-compiled extensions that accelerate computationally intensive algorithms. When the compiled extension is present and loadable, these functions run automatically through Rust with no API changes. When the extension is unavailable, all functions fall back silently to the pure Python implementation.
67
+
68
+ **Accelerated functions:**
69
+
70
+ - **Nodal VLP segment loops** — all 8 VLP method functions (4 methods x gas/oil)
71
+ - **Gas Z-factor** — DAK, Hall-Yarborough, and BNS full-pipeline calculations
72
+ - **Gas viscosity** — LGE and LBC correlations
73
+ - **Gas pseudopressure** — Gauss-Legendre quadrature integration
74
+ - **Oil density** — Standing-Witte-McCain-Hill (iterative and above-Pb)
75
+ - **Oil FVF** — McCain density-based method
76
+ - **DCA hyperbolic fitting** — grid search with RANSAC (``fit_decline``, ``fit_decline_cum``)
77
+ - **Material balance** — oil matbal regression objective function
78
+ - **CO2-Brine solubility** — Spycher-Pruess iterative RK-EOS solver
79
+ - **VLE flash** — Soreide-Whitson multi-component Peng-Robinson flash
80
+
81
+ **Behavior:**
82
+
83
+ - If the Rust extension is not found on disk, pure Python is used with no warning
84
+ - If the extension fails to load (e.g. OS permission restrictions, architecture mismatch), a sentinel file is written to avoid repeated probe attempts on subsequent imports. The sentinel is automatically invalidated when the extension file changes (new build or update)
85
+ - All Rust-accelerated paths use ``try/except`` wrappers — any Rust-side error falls back to the Python implementation transparently
86
+
87
+ **Environment variables:**
88
+
89
+ - ``PYRESTOOLBOX_NO_RUST=1`` — Force pure Python mode (skip Rust extension entirely)
90
+ - ``PYRESTOOLBOX_RETRY_RUST=1`` — Ignore the sentinel file and retry loading the extension
91
+
92
+ **Programmatic status check:**
93
+
94
+ .. code-block:: python
95
+
96
+ >>> from pyrestoolbox._accelerator import get_status, clear_block
97
+ >>> get_status()
98
+ {'rust_available': True, 'failure_reason': '', 'forced_python': False, ...}
99
+ >>> # If blocked by a sentinel, clear it and restart Python:
100
+ >>> clear_block()
101
+
69
102
  `Changelist <https://github.com/mwburgoyne/pyResToolbox/blob/main/pyrestoolbox/docs/changelist.rst>`_
70
103
 
71
104
  Upgrade previous installations with
@@ -358,3 +391,4 @@ With ability to generate Live Oil PVTO style table data as well
358
391
  Development
359
392
  ===========
360
393
  ``pyrestoolbox`` is maintained by Mark W. Burgoyne (`github.com/mwburgoyne <https://github.com/mwburgoyne>`_).
394
+
@@ -1,35 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: pyrestoolbox
3
- Version: 3.0.4
4
- Summary: pyResToolbox - A collection of Reservoir Engineering Utilities
5
- Home-page: https://github.com/mwburgoyne/pyResToolbox
6
- Author: Mark W. Burgoyne
7
- Author-email: mark.w.burgoyne@gmail.com
8
- License: GNU General Public License v3 or later (GPLv3+)
9
- Keywords: restoolbox,petroleum,reservoir
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
12
- Classifier: Operating System :: OS Independent
13
- Description-Content-Type: text/x-rst
14
- License-File: LICENSE
15
- Requires-Dist: numpy
16
- Requires-Dist: scipy
17
- Requires-Dist: pandas
18
- Requires-Dist: tabulate
19
- Requires-Dist: gwr_inversion
20
- Requires-Dist: mpmath
21
- Requires-Dist: openpyxl
22
- Dynamic: author
23
- Dynamic: author-email
24
- Dynamic: description
25
- Dynamic: description-content-type
26
- Dynamic: home-page
27
- Dynamic: keywords
28
- Dynamic: license
29
- Dynamic: license-file
30
- Dynamic: requires-dist
31
- Dynamic: summary
32
-
33
1
  ===================================
34
2
  ``pyrestoolbox``
35
3
  ===================================
@@ -66,6 +34,45 @@ Includes functions to perform calculations including;
66
34
 
67
35
  All public PVT, flow rate, and simulation table functions support both oilfield (psia, deg F, ft) and Eclipse METRIC (barsa, deg C, m) unit systems via an optional ``metric=False`` parameter. See individual module documentation for unit mapping details.
68
36
 
37
+ Rust Acceleration (Optional)
38
+ -----------------------------
39
+
40
+ pyResToolbox includes optional Rust-compiled extensions that accelerate computationally intensive algorithms. When the compiled extension is present and loadable, these functions run automatically through Rust with no API changes. When the extension is unavailable, all functions fall back silently to the pure Python implementation.
41
+
42
+ **Accelerated functions:**
43
+
44
+ - **Nodal VLP segment loops** — all 8 VLP method functions (4 methods x gas/oil)
45
+ - **Gas Z-factor** — DAK, Hall-Yarborough, and BNS full-pipeline calculations
46
+ - **Gas viscosity** — LGE and LBC correlations
47
+ - **Gas pseudopressure** — Gauss-Legendre quadrature integration
48
+ - **Oil density** — Standing-Witte-McCain-Hill (iterative and above-Pb)
49
+ - **Oil FVF** — McCain density-based method
50
+ - **DCA hyperbolic fitting** — grid search with RANSAC (``fit_decline``, ``fit_decline_cum``)
51
+ - **Material balance** — oil matbal regression objective function
52
+ - **CO2-Brine solubility** — Spycher-Pruess iterative RK-EOS solver
53
+ - **VLE flash** — Soreide-Whitson multi-component Peng-Robinson flash
54
+
55
+ **Behavior:**
56
+
57
+ - If the Rust extension is not found on disk, pure Python is used with no warning
58
+ - If the extension fails to load (e.g. OS permission restrictions, architecture mismatch), a sentinel file is written to avoid repeated probe attempts on subsequent imports. The sentinel is automatically invalidated when the extension file changes (new build or update)
59
+ - All Rust-accelerated paths use ``try/except`` wrappers — any Rust-side error falls back to the Python implementation transparently
60
+
61
+ **Environment variables:**
62
+
63
+ - ``PYRESTOOLBOX_NO_RUST=1`` — Force pure Python mode (skip Rust extension entirely)
64
+ - ``PYRESTOOLBOX_RETRY_RUST=1`` — Ignore the sentinel file and retry loading the extension
65
+
66
+ **Programmatic status check:**
67
+
68
+ .. code-block:: python
69
+
70
+ >>> from pyrestoolbox._accelerator import get_status, clear_block
71
+ >>> get_status()
72
+ {'rust_available': True, 'failure_reason': '', 'forced_python': False, ...}
73
+ >>> # If blocked by a sentinel, clear it and restart Python:
74
+ >>> clear_block()
75
+
69
76
  `Changelist <https://github.com/mwburgoyne/pyResToolbox/blob/main/pyrestoolbox/docs/changelist.rst>`_
70
77
 
71
78
  Upgrade previous installations with