pyrestoolbox 3.7.4__tar.gz → 3.7.6__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.
- pyrestoolbox-3.7.6/.github/complexity-baseline.json +34 -0
- pyrestoolbox-3.7.6/.github/scripts/check_complexity.py +84 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/.github/workflows/tests.yml +34 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/.gitignore +11 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/Cargo.lock +1 -1
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/Cargo.toml +1 -1
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/PKG-INFO +29 -28
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/README.rst +28 -27
- pyrestoolbox-3.7.6/clippy.toml +7 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyproject.toml +1 -1
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/_lib_maoduan_viscosity.py +6 -4
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/_lib_vle_engine.py +141 -100
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/brine.py +97 -60
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/pr_vphi.py +4 -1
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/viscosity_route.py +2 -1
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/dca/dca.py +1623 -1623
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/brine.rst +113 -89
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/changelist.rst +55 -21
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/dca.rst +1003 -1003
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/gas.rst +154 -39
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/index.rst +6 -5
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/layer.rst +10 -10
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/library.rst +8 -8
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/matbal.rst +7 -7
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/nodal.rst +14 -13
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/oil.rst +56 -47
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/plyasunov.rst +6 -5
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/recommend.rst +7 -7
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/sensitivity.rst +157 -157
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/simtools.rst +25 -23
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/gas/gas.py +272 -42
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/matbal/matbal.py +115 -88
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/nodal/nodal.py +146 -138
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/__init__.py +1 -1
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_compressibility.py +7 -1
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_constants.py +5 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_correlations.py +49 -10
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_density.py +14 -2
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/_decks.py +178 -158
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/_relperm.py +30 -25
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/_vfp.py +288 -258
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/bessel.rs +5 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/critical_properties/mod.rs +2 -2
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/dca/hyperbolic.rs +6 -6
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/dca/ransac.rs +10 -10
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/gwr.rs +2 -3
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/matbal/objective.rs +4 -2
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/oil/density.rs +16 -7
- pyrestoolbox-3.7.6/src/pseudopressure.rs +371 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/spycher_pruess/mod.rs +3 -2
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/spycher_pruess/solubility.rs +25 -16
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/alpha.rs +6 -6
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/bip.rs +412 -297
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/components.rs +123 -123
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/eos.rs +6 -6
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/flash.rs +36 -17
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/fugacity.rs +5 -5
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/k_init.rs +6 -6
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/mod.rs +22 -10
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/rachford_rice.rs +8 -8
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/constants.rs +3 -3
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/friction.rs +2 -2
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/holdup_bb.rs +4 -4
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/holdup_gray.rs +2 -2
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/holdup_wg.rs +2 -2
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/ift.rs +2 -2
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/march.rs +4 -4
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/mod.rs +11 -5
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/pvt_helpers.rs +9 -2
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/static_column.rs +3 -2
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/zfactor/mod.rs +4 -4
- pyrestoolbox-3.7.4/benchmark_batch.py +0 -160
- pyrestoolbox-3.7.4/benchmark_rust_vs_python.py +0 -220
- pyrestoolbox-3.7.4/benchmark_viscosity.py +0 -213
- pyrestoolbox-3.7.4/benchmark_zfactor.py +0 -207
- pyrestoolbox-3.7.4/benchmarks/_bench_worker.py +0 -192
- pyrestoolbox-3.7.4/benchmarks/bench_acceleration.py +0 -103
- pyrestoolbox-3.7.4/pyresToolbox_rust_acceleration_instructions.md +0 -1415
- pyrestoolbox-3.7.4/pyrestoolbox-mcp-0.1.0.zip +0 -0
- pyrestoolbox-3.7.4/pyrestoolbox-mcp-email.txt +0 -39
- pyrestoolbox-3.7.4/reviews/CONSOLIDATED.md +0 -101
- pyrestoolbox-3.7.4/reviews/README.md +0 -68
- pyrestoolbox-3.7.4/reviews/api_ux/_summary.md +0 -85
- pyrestoolbox-3.7.4/reviews/api_ux/brine.md +0 -74
- pyrestoolbox-3.7.4/reviews/api_ux/dca.md +0 -83
- pyrestoolbox-3.7.4/reviews/api_ux/gas.md +0 -114
- pyrestoolbox-3.7.4/reviews/api_ux/layer.md +0 -63
- pyrestoolbox-3.7.4/reviews/api_ux/matbal.md +0 -86
- pyrestoolbox-3.7.4/reviews/api_ux/nodal.md +0 -109
- pyrestoolbox-3.7.4/reviews/api_ux/oil.md +0 -71
- pyrestoolbox-3.7.4/reviews/api_ux/plyasunov.md +0 -55
- pyrestoolbox-3.7.4/reviews/api_ux/recommend.md +0 -56
- pyrestoolbox-3.7.4/reviews/api_ux/sensitivity.md +0 -62
- pyrestoolbox-3.7.4/reviews/api_ux/simtools.md +0 -79
- pyrestoolbox-3.7.4/reviews/correctness/_summary.md +0 -49
- pyrestoolbox-3.7.4/reviews/correctness/brine.md +0 -45
- pyrestoolbox-3.7.4/reviews/correctness/dca.md +0 -186
- pyrestoolbox-3.7.4/reviews/correctness/gas.md +0 -18
- pyrestoolbox-3.7.4/reviews/correctness/layer.md +0 -106
- pyrestoolbox-3.7.4/reviews/correctness/matbal.md +0 -193
- pyrestoolbox-3.7.4/reviews/correctness/nodal.md +0 -33
- pyrestoolbox-3.7.4/reviews/correctness/oil.md +0 -32
- pyrestoolbox-3.7.4/reviews/correctness/plyasunov.md +0 -140
- pyrestoolbox-3.7.4/reviews/correctness/recommend.md +0 -73
- pyrestoolbox-3.7.4/reviews/correctness/sensitivity.md +0 -31
- pyrestoolbox-3.7.4/reviews/correctness/simtools.md +0 -43
- pyrestoolbox-3.7.4/reviews/review-2026-06-10.md +0 -138
- pyrestoolbox-3.7.4/reviews/tech_debt/_summary.md +0 -95
- pyrestoolbox-3.7.4/reviews/tech_debt/brine.md +0 -68
- pyrestoolbox-3.7.4/reviews/tech_debt/dca.md +0 -108
- pyrestoolbox-3.7.4/reviews/tech_debt/gas.md +0 -134
- pyrestoolbox-3.7.4/reviews/tech_debt/layer.md +0 -95
- pyrestoolbox-3.7.4/reviews/tech_debt/matbal.md +0 -78
- pyrestoolbox-3.7.4/reviews/tech_debt/nodal.md +0 -95
- pyrestoolbox-3.7.4/reviews/tech_debt/oil.md +0 -80
- pyrestoolbox-3.7.4/reviews/tech_debt/plyasunov.md +0 -103
- pyrestoolbox-3.7.4/reviews/tech_debt/recommend.md +0 -81
- pyrestoolbox-3.7.4/reviews/tech_debt/sensitivity.md +0 -72
- pyrestoolbox-3.7.4/reviews/tech_debt/simtools.md +0 -112
- pyrestoolbox-3.7.4/src/pseudopressure.rs +0 -432
- pyrestoolbox-3.7.4/zstar_residual_plots.py +0 -302
- pyrestoolbox-3.7.4/zstar_vs_z_comparison.zip +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/.github/workflows/build-wheels.yml +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/LICENSE +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/MANIFEST.in +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/ResToolbox/privacy_policy.md +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/build_pure_python.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/DEPLOYMENT.md +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/Dockerfile +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/README.md +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/pyproject.toml +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/pyrestoolbox_mcp/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/pyrestoolbox_mcp/serialize.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/pyrestoolbox_mcp/server.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/tests/test_server.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/_accelerator.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/_lib_dielectric.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/_lib_pitzer_params.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/_lib_salting_library.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/appelo_volumes.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/iapws_viscosity.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/jones_dole_viscosity.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/kestin_nacl_viscosity.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/vphi_route.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/classes/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/classes/classes.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/constants/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/constants/constants.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/dca/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/examples.ipynb +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/bot.png +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/bot_PVTO.png +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/bot_img.png +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/dry_gas.png +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/grid_sat_df.png +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/influence.png +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/properties_df.png +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/sgof.png +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/swof.png +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/nodal_examples.ipynb +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/nodal_hydrate_demo.ipynb +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/gas/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/gas/_hydrate.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/layer/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/layer/layer.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/library/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/library/component_library.xlsx +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/library/library.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/matbal/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/nodal/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_harmonize.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_pvt_class.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_rate.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_separator.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_tables.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_utils.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/plyasunov/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/plyasunov/iapws_if97.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/plyasunov/plyasunov_model.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/plyasunov/water_properties.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/recommend/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/recommend/recommend.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/sensitivity/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/sensitivity/sensitivity.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/shared_fns/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/shared_fns/shared_fns.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/_aquifer.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/_pvt_tables.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/simtools.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/validate/__init__.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/validate/validate.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/setup.cfg +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/setup.py +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/dca/mod.rs +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/gas_viscosity/mod.rs +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/lib.rs +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/matbal/mod.rs +0 -0
- {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/oil/mod.rs +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pyrestoolbox/brine/_lib_vle_engine.py::SWBinaryVLE.calc_gas_solubility": 16,
|
|
3
|
+
"pyrestoolbox/brine/_lib_vle_engine.py::SWMultiComponentFlash.build_kij_matrix": 18,
|
|
4
|
+
"pyrestoolbox/brine/_lib_vle_engine.py::SWMultiComponentFlash.calc_equilibrium": 24,
|
|
5
|
+
"pyrestoolbox/brine/_lib_vle_engine.py::calc_gas_brine_equilibrium": 29,
|
|
6
|
+
"pyrestoolbox/brine/brine.py::CO2_Brine_Mixture.__init__": 18,
|
|
7
|
+
"pyrestoolbox/brine/brine.py::SoreideWhitson.__init__": 28,
|
|
8
|
+
"pyrestoolbox/brine/brine.py::SoreideWhitson._calc_properties": 19,
|
|
9
|
+
"pyrestoolbox/brine/brine.py::brine_props": 19,
|
|
10
|
+
"pyrestoolbox/dca/dca.py::fit_decline": 17,
|
|
11
|
+
"pyrestoolbox/dca/dca.py::fit_decline_cum": 22,
|
|
12
|
+
"pyrestoolbox/dca/dca.py::forecast": 16,
|
|
13
|
+
"pyrestoolbox/dca/dca.py::hyp2_from_eur": 18,
|
|
14
|
+
"pyrestoolbox/gas/_hydrate.py::gas_hydrate": 26,
|
|
15
|
+
"pyrestoolbox/gas/gas.py::gas_ponz2p": 16,
|
|
16
|
+
"pyrestoolbox/gas/gas.py::gas_tc_pc": 16,
|
|
17
|
+
"pyrestoolbox/gas/gas.py::gas_ug": 16,
|
|
18
|
+
"pyrestoolbox/matbal/matbal.py::gas_matbal": 26,
|
|
19
|
+
"pyrestoolbox/matbal/matbal.py::oil_matbal": 35,
|
|
20
|
+
"pyrestoolbox/nodal/nodal.py::Completion.__init__": 21,
|
|
21
|
+
"pyrestoolbox/nodal/nodal.py::_bb_flow_pattern": 18,
|
|
22
|
+
"pyrestoolbox/nodal/nodal.py::_prepare_flow_inputs": 16,
|
|
23
|
+
"pyrestoolbox/nodal/nodal.py::ipr_curve": 27,
|
|
24
|
+
"pyrestoolbox/nodal/nodal.py::operating_point": 18,
|
|
25
|
+
"pyrestoolbox/oil/_compressibility.py::oil_co": 16,
|
|
26
|
+
"pyrestoolbox/oil/_correlations.py::oil_pbub": 16,
|
|
27
|
+
"pyrestoolbox/oil/_harmonize.py::oil_harmonize": 16,
|
|
28
|
+
"pyrestoolbox/shared_fns/shared_fns.py::validate_pe_inputs": 43,
|
|
29
|
+
"pyrestoolbox/simtools/_decks.py::_crawl_deck_includes": 16,
|
|
30
|
+
"pyrestoolbox/simtools/_decks.py::ix_extract_problem_cells": 41,
|
|
31
|
+
"pyrestoolbox/simtools/_vfp.py::_format_vfpprod": 19,
|
|
32
|
+
"pyrestoolbox/simtools/_vfp.py::_vfpprod_axes_to_oilfield": 24,
|
|
33
|
+
"pyrestoolbox/simtools/_vfp.py::make_vfpinj": 20
|
|
34
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Cyclomatic-complexity ratchet for pyrestoolbox.
|
|
3
|
+
|
|
4
|
+
Fails when a function's McCabe complexity exceeds MAX_COMPLEXITY unless that
|
|
5
|
+
function is already recorded in the baseline at its recorded value or lower.
|
|
6
|
+
The point is to stop new branching accreting, not to force a rewrite of the
|
|
7
|
+
functions that are already large - those are listed in the baseline and can only
|
|
8
|
+
get simpler.
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
python3 .github/scripts/check_complexity.py # check
|
|
12
|
+
python3 .github/scripts/check_complexity.py --update # rewrite the baseline
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
import json
|
|
16
|
+
import subprocess
|
|
17
|
+
import sys
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
MAX_COMPLEXITY = 15
|
|
21
|
+
PACKAGE = "pyrestoolbox"
|
|
22
|
+
BASELINE = Path(__file__).resolve().parent.parent / "complexity-baseline.json"
|
|
23
|
+
SKIP_DIRS = ("/tests/", "\\tests\\")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def measure():
|
|
27
|
+
"""Return {"path::function": complexity} for every function in the package."""
|
|
28
|
+
out = subprocess.run(
|
|
29
|
+
[sys.executable, "-m", "radon", "cc", "-j", PACKAGE],
|
|
30
|
+
capture_output=True, text=True, check=True,
|
|
31
|
+
).stdout
|
|
32
|
+
scores = {}
|
|
33
|
+
for path, blocks in json.loads(out).items():
|
|
34
|
+
if any(d in "/" + path.replace("\\", "/") + "/" for d in ("/tests/",)):
|
|
35
|
+
continue
|
|
36
|
+
if isinstance(blocks, dict): # radon reports parse errors as a dict
|
|
37
|
+
continue
|
|
38
|
+
for b in blocks:
|
|
39
|
+
name = f"{b['classname']}.{b['name']}" if b.get("classname") else b["name"]
|
|
40
|
+
key = f"{path.replace(chr(92), '/')}::{name}"
|
|
41
|
+
scores[key] = max(scores.get(key, 0), b["complexity"])
|
|
42
|
+
return scores
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def main():
|
|
46
|
+
scores = measure()
|
|
47
|
+
over = {k: v for k, v in scores.items() if v > MAX_COMPLEXITY}
|
|
48
|
+
|
|
49
|
+
if "--update" in sys.argv:
|
|
50
|
+
BASELINE.write_text(json.dumps(dict(sorted(over.items())), indent=2) + "\n")
|
|
51
|
+
print(f"Wrote {len(over)} entries to {BASELINE.name}")
|
|
52
|
+
return 0
|
|
53
|
+
|
|
54
|
+
baseline = json.loads(BASELINE.read_text()) if BASELINE.exists() else {}
|
|
55
|
+
|
|
56
|
+
new = {k: v for k, v in over.items() if k not in baseline}
|
|
57
|
+
worse = {k: (baseline[k], v) for k, v in over.items() if k in baseline and v > baseline[k]}
|
|
58
|
+
better = {k: (baseline[k], scores.get(k, 0)) for k in baseline
|
|
59
|
+
if scores.get(k, 0) < baseline[k]}
|
|
60
|
+
|
|
61
|
+
for key, (was, now) in sorted(better.items()):
|
|
62
|
+
print(f"improved {key}: {was} -> {now}")
|
|
63
|
+
|
|
64
|
+
if not new and not worse:
|
|
65
|
+
if better:
|
|
66
|
+
print("\nRun with --update to lock in the improvements above.")
|
|
67
|
+
print(f"\nOK - no function above {MAX_COMPLEXITY} outside the baseline.")
|
|
68
|
+
return 0
|
|
69
|
+
|
|
70
|
+
print(f"\nCyclomatic complexity above {MAX_COMPLEXITY}:")
|
|
71
|
+
for key, val in sorted(new.items()):
|
|
72
|
+
print(f" NEW {key}: {val}")
|
|
73
|
+
for key, (was, now) in sorted(worse.items()):
|
|
74
|
+
print(f" WORSE {key}: {was} -> {now}")
|
|
75
|
+
print(
|
|
76
|
+
"\nSplit the function, or - if the branching is irreducible - run\n"
|
|
77
|
+
" python3 .github/scripts/check_complexity.py --update\n"
|
|
78
|
+
"and say why in the commit message."
|
|
79
|
+
)
|
|
80
|
+
return 1
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
if __name__ == "__main__":
|
|
84
|
+
sys.exit(main())
|
|
@@ -62,3 +62,37 @@ jobs:
|
|
|
62
62
|
|
|
63
63
|
- name: Run full test suite (Rust + parity)
|
|
64
64
|
run: python3 -m pytest pyrestoolbox/tests/ -q
|
|
65
|
+
|
|
66
|
+
# ── Complexity ratchet (new code only; existing offenders baselined) ─
|
|
67
|
+
complexity:
|
|
68
|
+
name: Complexity ratchet
|
|
69
|
+
runs-on: ubuntu-latest
|
|
70
|
+
steps:
|
|
71
|
+
- uses: actions/checkout@v5
|
|
72
|
+
|
|
73
|
+
- uses: actions/setup-python@v6
|
|
74
|
+
with:
|
|
75
|
+
python-version: "3.12"
|
|
76
|
+
|
|
77
|
+
- name: Install radon
|
|
78
|
+
run: pip install radon
|
|
79
|
+
|
|
80
|
+
- name: Check cyclomatic complexity against baseline
|
|
81
|
+
run: python3 .github/scripts/check_complexity.py
|
|
82
|
+
|
|
83
|
+
# ── Rust lint ratchet (clippy clean; any new warning fails) ─────────
|
|
84
|
+
rust-lint:
|
|
85
|
+
name: Clippy
|
|
86
|
+
runs-on: ubuntu-latest
|
|
87
|
+
steps:
|
|
88
|
+
- uses: actions/checkout@v5
|
|
89
|
+
|
|
90
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
91
|
+
with:
|
|
92
|
+
components: clippy
|
|
93
|
+
|
|
94
|
+
- name: Install m4 (needed by gmp-mpfr-sys for the rug crate)
|
|
95
|
+
run: sudo apt-get update -qq && sudo apt-get install -y -qq m4
|
|
96
|
+
|
|
97
|
+
- name: Clippy
|
|
98
|
+
run: cargo clippy --all-targets -- -D warnings
|
|
@@ -46,3 +46,14 @@ BUILD_INSTRUCTIONS.txt
|
|
|
46
46
|
|
|
47
47
|
# local virtualenv (389 MB, never committed)
|
|
48
48
|
.venv/
|
|
49
|
+
|
|
50
|
+
# Internal development artifacts (kept locally, not published)
|
|
51
|
+
reviews/
|
|
52
|
+
benchmarks/
|
|
53
|
+
benchmark_*.py
|
|
54
|
+
zstar_*
|
|
55
|
+
pyresToolbox_rust_acceleration_instructions.md
|
|
56
|
+
pyrestoolbox-mcp-email.txt
|
|
57
|
+
DEFECTS-FOUND-*.md
|
|
58
|
+
PORT-SPEC-*.md
|
|
59
|
+
*.zip
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyrestoolbox
|
|
3
|
-
Version: 3.7.
|
|
3
|
+
Version: 3.7.6
|
|
4
4
|
Classifier: Programming Language :: Python :: 3
|
|
5
5
|
Classifier: Programming Language :: Rust
|
|
6
6
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
@@ -24,13 +24,13 @@ Requires-Python: >=3.8
|
|
|
24
24
|
Description-Content-Type: text/x-rst; charset=UTF-8
|
|
25
25
|
Project-URL: Homepage, https://github.com/mwburgoyne/pyResToolbox
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
================
|
|
28
28
|
``pyrestoolbox``
|
|
29
|
-
|
|
29
|
+
================
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
-----------------------------------------------
|
|
32
32
|
A collection of Reservoir Engineering Utilities
|
|
33
|
-
|
|
33
|
+
-----------------------------------------------
|
|
34
34
|
|
|
35
35
|
This set of functions focuses on those that the author uses often while crafting programming solutions.
|
|
36
36
|
These are the scripts that are often copy/pasted from previous work - sometimes slightly modified - resulting in a trail of slightly different versions over the years. Some attempt has been made here to make this implementation flexible enough such that it can be relied on as-is going forward.
|
|
@@ -39,7 +39,7 @@ Note: Version 3.0 consolidates simulation-oriented functions under the simtools
|
|
|
39
39
|
|
|
40
40
|
Includes functions to perform calculations including;
|
|
41
41
|
|
|
42
|
-
- Decline Curve Analysis with Arps and Duong models
|
|
42
|
+
- Decline Curve Analysis with Arps and Duong models - fitting, forecasting, EUR, windowed fitting, secondary phase ratio models, and uptime inference
|
|
43
43
|
- Material Balance for gas (P/Z with Cole plot and Havlena-Odeh aquifer support) and oil (Havlena-Odeh with drive indices, parameter regression, and tabulated PVT)
|
|
44
44
|
- Inflow Performance Relationships (IPR) for oil and gas wells
|
|
45
45
|
- Vertical Lift Performance (VLP) with four multiphase flow correlations (Hagedorn-Brown, Woldesemayat-Ghajar, Gray, Beggs & Brill)
|
|
@@ -47,6 +47,7 @@ Includes functions to perform calculations including;
|
|
|
47
47
|
- Eclipse VFP table generation (VFPPROD and VFPINJ keywords)
|
|
48
48
|
- PVT Calculations for oil
|
|
49
49
|
- PVT calculation for gas, including up to 100% inerts for CO2, H2S, N2 and H2
|
|
50
|
+
- Gas caloric properties (enthalpy, Cp, Cv, Joule-Thomson coefficient) from the BNS tuned Peng Robinson EOS
|
|
50
51
|
- Gas hydrate formation prediction with thermodynamic inhibitor calculations
|
|
51
52
|
- Return critical parameters for typical components
|
|
52
53
|
- Creation of Black Oil Table information (PVDO, PVDG, PVTO, PVTW keywords)
|
|
@@ -62,33 +63,33 @@ Includes functions to perform calculations including;
|
|
|
62
63
|
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.
|
|
63
64
|
|
|
64
65
|
Rust Acceleration (Optional)
|
|
65
|
-
|
|
66
|
+
----------------------------
|
|
66
67
|
|
|
67
68
|
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.
|
|
68
69
|
|
|
69
70
|
**Accelerated functions:**
|
|
70
71
|
|
|
71
|
-
- **Nodal VLP segment loops**
|
|
72
|
-
- **Gas Z-factor**
|
|
73
|
-
- **Gas viscosity**
|
|
74
|
-
- **Gas pseudopressure**
|
|
75
|
-
- **Oil density**
|
|
76
|
-
- **Oil FVF**
|
|
77
|
-
- **DCA hyperbolic fitting**
|
|
78
|
-
- **Material balance**
|
|
79
|
-
- **CO2-Brine solubility**
|
|
80
|
-
- **VLE flash**
|
|
72
|
+
- **Nodal VLP segment loops** - all 8 VLP method functions (4 methods x gas/oil)
|
|
73
|
+
- **Gas Z-factor** - DAK, Hall-Yarborough, and BNS full-pipeline calculations
|
|
74
|
+
- **Gas viscosity** - LGE and LBC correlations
|
|
75
|
+
- **Gas pseudopressure** - Gauss-Legendre quadrature integration
|
|
76
|
+
- **Oil density** - Standing-Witte-McCain-Hill (iterative and above-Pb)
|
|
77
|
+
- **Oil FVF** - McCain density-based method
|
|
78
|
+
- **DCA hyperbolic fitting** - grid search with RANSAC (``fit_decline``, ``fit_decline_cum``)
|
|
79
|
+
- **Material balance** - oil matbal regression objective function
|
|
80
|
+
- **CO2-Brine solubility** - Spycher-Pruess iterative RK-EOS solver
|
|
81
|
+
- **VLE flash** - Soreide-Whitson multi-component Peng-Robinson flash
|
|
81
82
|
|
|
82
83
|
**Behavior:**
|
|
83
84
|
|
|
84
85
|
- If the Rust extension is not found on disk, pure Python is used with no warning
|
|
85
86
|
- 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)
|
|
86
|
-
- All Rust-accelerated paths use ``try/except`` wrappers
|
|
87
|
+
- All Rust-accelerated paths use ``try/except`` wrappers - any Rust-side error falls back to the Python implementation transparently
|
|
87
88
|
|
|
88
89
|
**Environment variables:**
|
|
89
90
|
|
|
90
|
-
- ``PYRESTOOLBOX_NO_RUST=1``
|
|
91
|
-
- ``PYRESTOOLBOX_RETRY_RUST=1``
|
|
91
|
+
- ``PYRESTOOLBOX_NO_RUST=1`` - Force pure Python mode (skip Rust extension entirely)
|
|
92
|
+
- ``PYRESTOOLBOX_RETRY_RUST=1`` - Ignore the sentinel file and retry loading the extension
|
|
92
93
|
|
|
93
94
|
**Programmatic status check:**
|
|
94
95
|
|
|
@@ -110,7 +111,7 @@ Upgrade previous installations with
|
|
|
110
111
|
|
|
111
112
|
|
|
112
113
|
Module List
|
|
113
|
-
|
|
114
|
+
===========
|
|
114
115
|
|
|
115
116
|
.. list-table::
|
|
116
117
|
:widths: 30 70
|
|
@@ -120,7 +121,7 @@ Module List
|
|
|
120
121
|
* - `matbal <https://github.com/mwburgoyne/pyResToolbox/blob/main/pyrestoolbox/docs/matbal.rst>`_
|
|
121
122
|
- Gas P/Z material balance (OGIP), Cole plot diagnostics, Havlena-Odeh with aquifer influx, Oil Havlena-Odeh material balance (OOIP) with drive indices, Parameter regression with bounds, Tabulated PVT support
|
|
122
123
|
* - `gas <https://github.com/mwburgoyne/pyResToolbox/blob/main/pyrestoolbox/docs/gas.rst>`_
|
|
123
|
-
- Gas Tc & Pc Calculation, Gas Z-Factor Calculation, Gas Viscosity, Gas Viscosity \* Z, Gas Compressibility, Gas Formation Volume Factor, Gas Density, Gas Water of Condensation, Convert P/Z to P, Convert Gas Gradient to SG, Delta Pseudopressure, Gas Condensate FWS SG, Gas Flow Rate Radial, Gas Flow Rate Linear, Gas Hydrate Prediction
|
|
124
|
+
- Gas Tc & Pc Calculation, Gas Z-Factor Calculation, Gas Viscosity, Gas Viscosity \* Z, Gas Compressibility, Gas Formation Volume Factor, Gas Density, Gas Water of Condensation, Convert P/Z to P, Convert Gas Gradient to SG, Delta Pseudopressure, Gas Condensate FWS SG, Gas Flow Rate Radial, Gas Flow Rate Linear, Gas Hydrate Prediction, Gas Caloric Properties (H, Cp, Cv, Joule-Thomson), Non-Darcy and Partial-Penetration Pseudoskins
|
|
124
125
|
* - `oil <https://github.com/mwburgoyne/pyResToolbox/blob/main/pyrestoolbox/docs/oil.rst>`_
|
|
125
126
|
- Oil Density from MW, Oil Critical Properties with Twu, Incremental GOR post Separation, Oil Bubble Point Pressure, Oil GOR at Pb, Oil GOR at P, Oil Compressibility, Oil Density, Oil Formation Volume Factor, Oil Viscosity, Harmonize Pb and Rsb, Estimate soln gas SG from oil, Estimate SG of gas post separator, Calculate weighted average surface gas SG, Oil API to SG, Oil SG to API, Oil Flow Rate Radial, Oil Flow Rate Linear
|
|
126
127
|
* - `nodal <https://github.com/mwburgoyne/pyResToolbox/blob/main/pyrestoolbox/docs/nodal.rst>`_
|
|
@@ -156,8 +157,8 @@ A simple example below of estimating oil bubble point pressure.
|
|
|
156
157
|
.. code-block:: python
|
|
157
158
|
|
|
158
159
|
>>> from pyrestoolbox import oil
|
|
159
|
-
>>> oil.oil_pbub(api=43, degf=185, rsb=2350, sg_g
|
|
160
|
-
|
|
160
|
+
>>> oil.oil_pbub(api=43, degf=185, rsb=2350, sg_g=0.72, pbmethod='VALMC')
|
|
161
|
+
5199.2406069808885
|
|
161
162
|
|
|
162
163
|
Fit a decline curve to production data and estimate ultimate recovery.
|
|
163
164
|
|
|
@@ -169,9 +170,9 @@ Fit a decline curve to production data and estimate ultimate recovery.
|
|
|
169
170
|
>>> q = 1000 * np.exp(-0.05 * t)
|
|
170
171
|
>>> result = dca.fit_decline(t, q, method='exponential')
|
|
171
172
|
>>> result.qi, result.di
|
|
172
|
-
(
|
|
173
|
+
(999.9999999999953, 0.049999999999999885)
|
|
173
174
|
>>> dca.eur(qi=result.qi, di=result.di, b=0, q_min=10)
|
|
174
|
-
19799.
|
|
175
|
+
19799.999999999953
|
|
175
176
|
|
|
176
177
|
Estimate gas in place from pressure-production history.
|
|
177
178
|
|
|
@@ -184,9 +185,9 @@ Estimate gas in place from pressure-production history.
|
|
|
184
185
|
... degf=200, sg=0.65
|
|
185
186
|
... )
|
|
186
187
|
>>> r.ogip
|
|
187
|
-
87.
|
|
188
|
+
87.60264634235122
|
|
188
189
|
>>> r.r_squared
|
|
189
|
-
0.
|
|
190
|
+
0.9734793606102145
|
|
190
191
|
|
|
191
192
|
A set of Gas-Oil relative permeability curves with the LET method
|
|
192
193
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
================
|
|
2
2
|
``pyrestoolbox``
|
|
3
|
-
|
|
3
|
+
================
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
-----------------------------------------------
|
|
6
6
|
A collection of Reservoir Engineering Utilities
|
|
7
|
-
|
|
7
|
+
-----------------------------------------------
|
|
8
8
|
|
|
9
9
|
This set of functions focuses on those that the author uses often while crafting programming solutions.
|
|
10
10
|
These are the scripts that are often copy/pasted from previous work - sometimes slightly modified - resulting in a trail of slightly different versions over the years. Some attempt has been made here to make this implementation flexible enough such that it can be relied on as-is going forward.
|
|
@@ -13,7 +13,7 @@ Note: Version 3.0 consolidates simulation-oriented functions under the simtools
|
|
|
13
13
|
|
|
14
14
|
Includes functions to perform calculations including;
|
|
15
15
|
|
|
16
|
-
- Decline Curve Analysis with Arps and Duong models
|
|
16
|
+
- Decline Curve Analysis with Arps and Duong models - fitting, forecasting, EUR, windowed fitting, secondary phase ratio models, and uptime inference
|
|
17
17
|
- Material Balance for gas (P/Z with Cole plot and Havlena-Odeh aquifer support) and oil (Havlena-Odeh with drive indices, parameter regression, and tabulated PVT)
|
|
18
18
|
- Inflow Performance Relationships (IPR) for oil and gas wells
|
|
19
19
|
- Vertical Lift Performance (VLP) with four multiphase flow correlations (Hagedorn-Brown, Woldesemayat-Ghajar, Gray, Beggs & Brill)
|
|
@@ -21,6 +21,7 @@ Includes functions to perform calculations including;
|
|
|
21
21
|
- Eclipse VFP table generation (VFPPROD and VFPINJ keywords)
|
|
22
22
|
- PVT Calculations for oil
|
|
23
23
|
- PVT calculation for gas, including up to 100% inerts for CO2, H2S, N2 and H2
|
|
24
|
+
- Gas caloric properties (enthalpy, Cp, Cv, Joule-Thomson coefficient) from the BNS tuned Peng Robinson EOS
|
|
24
25
|
- Gas hydrate formation prediction with thermodynamic inhibitor calculations
|
|
25
26
|
- Return critical parameters for typical components
|
|
26
27
|
- Creation of Black Oil Table information (PVDO, PVDG, PVTO, PVTW keywords)
|
|
@@ -36,33 +37,33 @@ Includes functions to perform calculations including;
|
|
|
36
37
|
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.
|
|
37
38
|
|
|
38
39
|
Rust Acceleration (Optional)
|
|
39
|
-
|
|
40
|
+
----------------------------
|
|
40
41
|
|
|
41
42
|
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.
|
|
42
43
|
|
|
43
44
|
**Accelerated functions:**
|
|
44
45
|
|
|
45
|
-
- **Nodal VLP segment loops**
|
|
46
|
-
- **Gas Z-factor**
|
|
47
|
-
- **Gas viscosity**
|
|
48
|
-
- **Gas pseudopressure**
|
|
49
|
-
- **Oil density**
|
|
50
|
-
- **Oil FVF**
|
|
51
|
-
- **DCA hyperbolic fitting**
|
|
52
|
-
- **Material balance**
|
|
53
|
-
- **CO2-Brine solubility**
|
|
54
|
-
- **VLE flash**
|
|
46
|
+
- **Nodal VLP segment loops** - all 8 VLP method functions (4 methods x gas/oil)
|
|
47
|
+
- **Gas Z-factor** - DAK, Hall-Yarborough, and BNS full-pipeline calculations
|
|
48
|
+
- **Gas viscosity** - LGE and LBC correlations
|
|
49
|
+
- **Gas pseudopressure** - Gauss-Legendre quadrature integration
|
|
50
|
+
- **Oil density** - Standing-Witte-McCain-Hill (iterative and above-Pb)
|
|
51
|
+
- **Oil FVF** - McCain density-based method
|
|
52
|
+
- **DCA hyperbolic fitting** - grid search with RANSAC (``fit_decline``, ``fit_decline_cum``)
|
|
53
|
+
- **Material balance** - oil matbal regression objective function
|
|
54
|
+
- **CO2-Brine solubility** - Spycher-Pruess iterative RK-EOS solver
|
|
55
|
+
- **VLE flash** - Soreide-Whitson multi-component Peng-Robinson flash
|
|
55
56
|
|
|
56
57
|
**Behavior:**
|
|
57
58
|
|
|
58
59
|
- If the Rust extension is not found on disk, pure Python is used with no warning
|
|
59
60
|
- 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)
|
|
60
|
-
- All Rust-accelerated paths use ``try/except`` wrappers
|
|
61
|
+
- All Rust-accelerated paths use ``try/except`` wrappers - any Rust-side error falls back to the Python implementation transparently
|
|
61
62
|
|
|
62
63
|
**Environment variables:**
|
|
63
64
|
|
|
64
|
-
- ``PYRESTOOLBOX_NO_RUST=1``
|
|
65
|
-
- ``PYRESTOOLBOX_RETRY_RUST=1``
|
|
65
|
+
- ``PYRESTOOLBOX_NO_RUST=1`` - Force pure Python mode (skip Rust extension entirely)
|
|
66
|
+
- ``PYRESTOOLBOX_RETRY_RUST=1`` - Ignore the sentinel file and retry loading the extension
|
|
66
67
|
|
|
67
68
|
**Programmatic status check:**
|
|
68
69
|
|
|
@@ -84,7 +85,7 @@ Upgrade previous installations with
|
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
Module List
|
|
87
|
-
|
|
88
|
+
===========
|
|
88
89
|
|
|
89
90
|
.. list-table::
|
|
90
91
|
:widths: 30 70
|
|
@@ -94,7 +95,7 @@ Module List
|
|
|
94
95
|
* - `matbal <https://github.com/mwburgoyne/pyResToolbox/blob/main/pyrestoolbox/docs/matbal.rst>`_
|
|
95
96
|
- Gas P/Z material balance (OGIP), Cole plot diagnostics, Havlena-Odeh with aquifer influx, Oil Havlena-Odeh material balance (OOIP) with drive indices, Parameter regression with bounds, Tabulated PVT support
|
|
96
97
|
* - `gas <https://github.com/mwburgoyne/pyResToolbox/blob/main/pyrestoolbox/docs/gas.rst>`_
|
|
97
|
-
- Gas Tc & Pc Calculation, Gas Z-Factor Calculation, Gas Viscosity, Gas Viscosity \* Z, Gas Compressibility, Gas Formation Volume Factor, Gas Density, Gas Water of Condensation, Convert P/Z to P, Convert Gas Gradient to SG, Delta Pseudopressure, Gas Condensate FWS SG, Gas Flow Rate Radial, Gas Flow Rate Linear, Gas Hydrate Prediction
|
|
98
|
+
- Gas Tc & Pc Calculation, Gas Z-Factor Calculation, Gas Viscosity, Gas Viscosity \* Z, Gas Compressibility, Gas Formation Volume Factor, Gas Density, Gas Water of Condensation, Convert P/Z to P, Convert Gas Gradient to SG, Delta Pseudopressure, Gas Condensate FWS SG, Gas Flow Rate Radial, Gas Flow Rate Linear, Gas Hydrate Prediction, Gas Caloric Properties (H, Cp, Cv, Joule-Thomson), Non-Darcy and Partial-Penetration Pseudoskins
|
|
98
99
|
* - `oil <https://github.com/mwburgoyne/pyResToolbox/blob/main/pyrestoolbox/docs/oil.rst>`_
|
|
99
100
|
- Oil Density from MW, Oil Critical Properties with Twu, Incremental GOR post Separation, Oil Bubble Point Pressure, Oil GOR at Pb, Oil GOR at P, Oil Compressibility, Oil Density, Oil Formation Volume Factor, Oil Viscosity, Harmonize Pb and Rsb, Estimate soln gas SG from oil, Estimate SG of gas post separator, Calculate weighted average surface gas SG, Oil API to SG, Oil SG to API, Oil Flow Rate Radial, Oil Flow Rate Linear
|
|
100
101
|
* - `nodal <https://github.com/mwburgoyne/pyResToolbox/blob/main/pyrestoolbox/docs/nodal.rst>`_
|
|
@@ -130,8 +131,8 @@ A simple example below of estimating oil bubble point pressure.
|
|
|
130
131
|
.. code-block:: python
|
|
131
132
|
|
|
132
133
|
>>> from pyrestoolbox import oil
|
|
133
|
-
>>> oil.oil_pbub(api=43, degf=185, rsb=2350, sg_g
|
|
134
|
-
|
|
134
|
+
>>> oil.oil_pbub(api=43, degf=185, rsb=2350, sg_g=0.72, pbmethod='VALMC')
|
|
135
|
+
5199.2406069808885
|
|
135
136
|
|
|
136
137
|
Fit a decline curve to production data and estimate ultimate recovery.
|
|
137
138
|
|
|
@@ -143,9 +144,9 @@ Fit a decline curve to production data and estimate ultimate recovery.
|
|
|
143
144
|
>>> q = 1000 * np.exp(-0.05 * t)
|
|
144
145
|
>>> result = dca.fit_decline(t, q, method='exponential')
|
|
145
146
|
>>> result.qi, result.di
|
|
146
|
-
(
|
|
147
|
+
(999.9999999999953, 0.049999999999999885)
|
|
147
148
|
>>> dca.eur(qi=result.qi, di=result.di, b=0, q_min=10)
|
|
148
|
-
19799.
|
|
149
|
+
19799.999999999953
|
|
149
150
|
|
|
150
151
|
Estimate gas in place from pressure-production history.
|
|
151
152
|
|
|
@@ -158,9 +159,9 @@ Estimate gas in place from pressure-production history.
|
|
|
158
159
|
... degf=200, sg=0.65
|
|
159
160
|
... )
|
|
160
161
|
>>> r.ogip
|
|
161
|
-
87.
|
|
162
|
+
87.60264634235122
|
|
162
163
|
>>> r.r_squared
|
|
163
|
-
0.
|
|
164
|
+
0.9734793606102145
|
|
164
165
|
|
|
165
166
|
A set of Gas-Oil relative permeability curves with the LET method
|
|
166
167
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Reservoir-engineering kernels legitimately carry ~10 physical quantities
|
|
2
|
+
# (composition, criticals, temperature, geometry), and grouping unrelated
|
|
3
|
+
# scalars into a struct just to satisfy a count makes them harder to read, not
|
|
4
|
+
# easier. 12 is the line: past that you are passing a record and should say so,
|
|
5
|
+
# which is why pseudopressure.rs has GasState. Clippy's default of 7 is too low
|
|
6
|
+
# for this crate.
|
|
7
|
+
too-many-arguments-threshold = 12
|
|
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pyrestoolbox"
|
|
7
|
-
version = "3.7.
|
|
7
|
+
version = "3.7.6"
|
|
8
8
|
description = "pyResToolbox - A collection of Reservoir Engineering Utilities"
|
|
9
9
|
license = {text = "GPL-3.0-or-later"}
|
|
10
10
|
authors = [{name = "Mark W. Burgoyne", email = "mark.w.burgoyne@gmail.com"}]
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"""Mao-Duan (2009) water and NaCl viscosity, the SUPERSEDED route.
|
|
2
2
|
|
|
3
3
|
Ported from brine_props `salt_viscosity_benchmark.py`. Retained only so
|
|
4
|
-
`viscosity_route(route='mao_duan')` reproduces pre-3.7.3 results
|
|
4
|
+
`viscosity_route(route='mao_duan')` reproduces pre-3.7.3 results (to within
|
|
5
|
+
0.0094% since the d1/b2 fix below); it is NaCl
|
|
5
6
|
only and carries no pressure dependence on the salt ratio. Coefficients are
|
|
6
|
-
|
|
7
|
+
Mao & Duan (2009) Tables 2-3, verified against the primary 2026-08-08; the
|
|
8
|
+
McCain Table 4-14 lineage carried two last-digit defects (d1, b2, <=0.0094%).
|
|
7
9
|
|
|
8
10
|
Against Kestin's measured NaCl viscosity this ties the default Jones-Dole leg
|
|
9
11
|
(0.443% against 0.415% mean) and loses at reservoir temperature (0.754% against
|
|
@@ -14,10 +16,10 @@ import math
|
|
|
14
16
|
|
|
15
17
|
from ..plyasunov.iapws_if97 import rho_if97
|
|
16
18
|
|
|
17
|
-
_MD_D = [0,
|
|
19
|
+
_MD_D = [0, 2885317.0, -11072.577, -9.0834095, 0.030925651, -0.0000274071,
|
|
18
20
|
-1928385.1, 5621.6046, 13.82725, -0.047609523, 0.000035545041]
|
|
19
21
|
_MD_A = [-0.21319213, 0.0013651589, -0.0000012191756]
|
|
20
|
-
_MD_B = [0.069161945, -0.00027292263, 0.
|
|
22
|
+
_MD_B = [0.069161945, -0.00027292263, 0.00000020852448]
|
|
21
23
|
_MD_C = [-0.0025988855, 0.0000077989227]
|
|
22
24
|
|
|
23
25
|
|