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.
Files changed (201) hide show
  1. pyrestoolbox-3.7.6/.github/complexity-baseline.json +34 -0
  2. pyrestoolbox-3.7.6/.github/scripts/check_complexity.py +84 -0
  3. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/.github/workflows/tests.yml +34 -0
  4. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/.gitignore +11 -0
  5. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/Cargo.lock +1 -1
  6. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/Cargo.toml +1 -1
  7. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/PKG-INFO +29 -28
  8. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/README.rst +28 -27
  9. pyrestoolbox-3.7.6/clippy.toml +7 -0
  10. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyproject.toml +1 -1
  11. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/_lib_maoduan_viscosity.py +6 -4
  12. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/_lib_vle_engine.py +141 -100
  13. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/brine.py +97 -60
  14. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/pr_vphi.py +4 -1
  15. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/viscosity_route.py +2 -1
  16. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/dca/dca.py +1623 -1623
  17. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/brine.rst +113 -89
  18. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/changelist.rst +55 -21
  19. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/dca.rst +1003 -1003
  20. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/gas.rst +154 -39
  21. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/index.rst +6 -5
  22. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/layer.rst +10 -10
  23. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/library.rst +8 -8
  24. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/matbal.rst +7 -7
  25. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/nodal.rst +14 -13
  26. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/oil.rst +56 -47
  27. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/plyasunov.rst +6 -5
  28. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/recommend.rst +7 -7
  29. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/sensitivity.rst +157 -157
  30. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/simtools.rst +25 -23
  31. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/gas/gas.py +272 -42
  32. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/matbal/matbal.py +115 -88
  33. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/nodal/nodal.py +146 -138
  34. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/__init__.py +1 -1
  35. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_compressibility.py +7 -1
  36. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_constants.py +5 -0
  37. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_correlations.py +49 -10
  38. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_density.py +14 -2
  39. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/_decks.py +178 -158
  40. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/_relperm.py +30 -25
  41. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/_vfp.py +288 -258
  42. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/bessel.rs +5 -0
  43. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/critical_properties/mod.rs +2 -2
  44. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/dca/hyperbolic.rs +6 -6
  45. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/dca/ransac.rs +10 -10
  46. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/gwr.rs +2 -3
  47. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/matbal/objective.rs +4 -2
  48. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/oil/density.rs +16 -7
  49. pyrestoolbox-3.7.6/src/pseudopressure.rs +371 -0
  50. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/spycher_pruess/mod.rs +3 -2
  51. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/spycher_pruess/solubility.rs +25 -16
  52. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/alpha.rs +6 -6
  53. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/bip.rs +412 -297
  54. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/components.rs +123 -123
  55. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/eos.rs +6 -6
  56. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/flash.rs +36 -17
  57. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/fugacity.rs +5 -5
  58. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/k_init.rs +6 -6
  59. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/mod.rs +22 -10
  60. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vle/rachford_rice.rs +8 -8
  61. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/constants.rs +3 -3
  62. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/friction.rs +2 -2
  63. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/holdup_bb.rs +4 -4
  64. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/holdup_gray.rs +2 -2
  65. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/holdup_wg.rs +2 -2
  66. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/ift.rs +2 -2
  67. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/march.rs +4 -4
  68. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/mod.rs +11 -5
  69. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/pvt_helpers.rs +9 -2
  70. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/vlp/static_column.rs +3 -2
  71. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/zfactor/mod.rs +4 -4
  72. pyrestoolbox-3.7.4/benchmark_batch.py +0 -160
  73. pyrestoolbox-3.7.4/benchmark_rust_vs_python.py +0 -220
  74. pyrestoolbox-3.7.4/benchmark_viscosity.py +0 -213
  75. pyrestoolbox-3.7.4/benchmark_zfactor.py +0 -207
  76. pyrestoolbox-3.7.4/benchmarks/_bench_worker.py +0 -192
  77. pyrestoolbox-3.7.4/benchmarks/bench_acceleration.py +0 -103
  78. pyrestoolbox-3.7.4/pyresToolbox_rust_acceleration_instructions.md +0 -1415
  79. pyrestoolbox-3.7.4/pyrestoolbox-mcp-0.1.0.zip +0 -0
  80. pyrestoolbox-3.7.4/pyrestoolbox-mcp-email.txt +0 -39
  81. pyrestoolbox-3.7.4/reviews/CONSOLIDATED.md +0 -101
  82. pyrestoolbox-3.7.4/reviews/README.md +0 -68
  83. pyrestoolbox-3.7.4/reviews/api_ux/_summary.md +0 -85
  84. pyrestoolbox-3.7.4/reviews/api_ux/brine.md +0 -74
  85. pyrestoolbox-3.7.4/reviews/api_ux/dca.md +0 -83
  86. pyrestoolbox-3.7.4/reviews/api_ux/gas.md +0 -114
  87. pyrestoolbox-3.7.4/reviews/api_ux/layer.md +0 -63
  88. pyrestoolbox-3.7.4/reviews/api_ux/matbal.md +0 -86
  89. pyrestoolbox-3.7.4/reviews/api_ux/nodal.md +0 -109
  90. pyrestoolbox-3.7.4/reviews/api_ux/oil.md +0 -71
  91. pyrestoolbox-3.7.4/reviews/api_ux/plyasunov.md +0 -55
  92. pyrestoolbox-3.7.4/reviews/api_ux/recommend.md +0 -56
  93. pyrestoolbox-3.7.4/reviews/api_ux/sensitivity.md +0 -62
  94. pyrestoolbox-3.7.4/reviews/api_ux/simtools.md +0 -79
  95. pyrestoolbox-3.7.4/reviews/correctness/_summary.md +0 -49
  96. pyrestoolbox-3.7.4/reviews/correctness/brine.md +0 -45
  97. pyrestoolbox-3.7.4/reviews/correctness/dca.md +0 -186
  98. pyrestoolbox-3.7.4/reviews/correctness/gas.md +0 -18
  99. pyrestoolbox-3.7.4/reviews/correctness/layer.md +0 -106
  100. pyrestoolbox-3.7.4/reviews/correctness/matbal.md +0 -193
  101. pyrestoolbox-3.7.4/reviews/correctness/nodal.md +0 -33
  102. pyrestoolbox-3.7.4/reviews/correctness/oil.md +0 -32
  103. pyrestoolbox-3.7.4/reviews/correctness/plyasunov.md +0 -140
  104. pyrestoolbox-3.7.4/reviews/correctness/recommend.md +0 -73
  105. pyrestoolbox-3.7.4/reviews/correctness/sensitivity.md +0 -31
  106. pyrestoolbox-3.7.4/reviews/correctness/simtools.md +0 -43
  107. pyrestoolbox-3.7.4/reviews/review-2026-06-10.md +0 -138
  108. pyrestoolbox-3.7.4/reviews/tech_debt/_summary.md +0 -95
  109. pyrestoolbox-3.7.4/reviews/tech_debt/brine.md +0 -68
  110. pyrestoolbox-3.7.4/reviews/tech_debt/dca.md +0 -108
  111. pyrestoolbox-3.7.4/reviews/tech_debt/gas.md +0 -134
  112. pyrestoolbox-3.7.4/reviews/tech_debt/layer.md +0 -95
  113. pyrestoolbox-3.7.4/reviews/tech_debt/matbal.md +0 -78
  114. pyrestoolbox-3.7.4/reviews/tech_debt/nodal.md +0 -95
  115. pyrestoolbox-3.7.4/reviews/tech_debt/oil.md +0 -80
  116. pyrestoolbox-3.7.4/reviews/tech_debt/plyasunov.md +0 -103
  117. pyrestoolbox-3.7.4/reviews/tech_debt/recommend.md +0 -81
  118. pyrestoolbox-3.7.4/reviews/tech_debt/sensitivity.md +0 -72
  119. pyrestoolbox-3.7.4/reviews/tech_debt/simtools.md +0 -112
  120. pyrestoolbox-3.7.4/src/pseudopressure.rs +0 -432
  121. pyrestoolbox-3.7.4/zstar_residual_plots.py +0 -302
  122. pyrestoolbox-3.7.4/zstar_vs_z_comparison.zip +0 -0
  123. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/.github/workflows/build-wheels.yml +0 -0
  124. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/LICENSE +0 -0
  125. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/MANIFEST.in +0 -0
  126. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/ResToolbox/privacy_policy.md +0 -0
  127. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/build_pure_python.py +0 -0
  128. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/DEPLOYMENT.md +0 -0
  129. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/Dockerfile +0 -0
  130. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/README.md +0 -0
  131. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/pyproject.toml +0 -0
  132. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/pyrestoolbox_mcp/__init__.py +0 -0
  133. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/pyrestoolbox_mcp/serialize.py +0 -0
  134. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/pyrestoolbox_mcp/server.py +0 -0
  135. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/mcp/tests/test_server.py +0 -0
  136. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/__init__.py +0 -0
  137. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/_accelerator.py +0 -0
  138. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/__init__.py +0 -0
  139. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/_lib_dielectric.py +0 -0
  140. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/_lib_pitzer_params.py +0 -0
  141. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/_lib_salting_library.py +0 -0
  142. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/appelo_volumes.py +0 -0
  143. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/iapws_viscosity.py +0 -0
  144. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/jones_dole_viscosity.py +0 -0
  145. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/kestin_nacl_viscosity.py +0 -0
  146. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/brine/vphi_route.py +0 -0
  147. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/classes/__init__.py +0 -0
  148. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/classes/classes.py +0 -0
  149. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/constants/__init__.py +0 -0
  150. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/constants/constants.py +0 -0
  151. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/dca/__init__.py +0 -0
  152. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/examples.ipynb +0 -0
  153. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/bot.png +0 -0
  154. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/bot_PVTO.png +0 -0
  155. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/bot_img.png +0 -0
  156. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/dry_gas.png +0 -0
  157. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/grid_sat_df.png +0 -0
  158. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/influence.png +0 -0
  159. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/properties_df.png +0 -0
  160. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/sgof.png +0 -0
  161. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/img/swof.png +0 -0
  162. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/nodal_examples.ipynb +0 -0
  163. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/docs/nodal_hydrate_demo.ipynb +0 -0
  164. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/gas/__init__.py +0 -0
  165. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/gas/_hydrate.py +0 -0
  166. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/layer/__init__.py +0 -0
  167. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/layer/layer.py +0 -0
  168. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/library/__init__.py +0 -0
  169. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/library/component_library.xlsx +0 -0
  170. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/library/library.py +0 -0
  171. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/matbal/__init__.py +0 -0
  172. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/nodal/__init__.py +0 -0
  173. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_harmonize.py +0 -0
  174. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_pvt_class.py +0 -0
  175. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_rate.py +0 -0
  176. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_separator.py +0 -0
  177. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_tables.py +0 -0
  178. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/oil/_utils.py +0 -0
  179. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/plyasunov/__init__.py +0 -0
  180. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/plyasunov/iapws_if97.py +0 -0
  181. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/plyasunov/plyasunov_model.py +0 -0
  182. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/plyasunov/water_properties.py +0 -0
  183. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/recommend/__init__.py +0 -0
  184. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/recommend/recommend.py +0 -0
  185. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/sensitivity/__init__.py +0 -0
  186. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/sensitivity/sensitivity.py +0 -0
  187. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/shared_fns/__init__.py +0 -0
  188. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/shared_fns/shared_fns.py +0 -0
  189. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/__init__.py +0 -0
  190. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/_aquifer.py +0 -0
  191. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/_pvt_tables.py +0 -0
  192. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/simtools/simtools.py +0 -0
  193. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/validate/__init__.py +0 -0
  194. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/pyrestoolbox/validate/validate.py +0 -0
  195. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/setup.cfg +0 -0
  196. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/setup.py +0 -0
  197. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/dca/mod.rs +0 -0
  198. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/gas_viscosity/mod.rs +0 -0
  199. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/lib.rs +0 -0
  200. {pyrestoolbox-3.7.4 → pyrestoolbox-3.7.6}/src/matbal/mod.rs +0 -0
  201. {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
@@ -152,7 +152,7 @@ dependencies = [
152
152
 
153
153
  [[package]]
154
154
  name = "pyrestoolbox-native"
155
- version = "3.7.0"
155
+ version = "3.7.6"
156
156
  dependencies = [
157
157
  "pyo3",
158
158
  "rug",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "pyrestoolbox-native"
3
- version = "3.7.0"
3
+ version = "3.7.6"
4
4
  edition = "2021"
5
5
  license = "GPL-3.0-or-later"
6
6
  description = "Rust acceleration extensions for pyResToolbox"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyrestoolbox
3
- Version: 3.7.4
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 — fitting, forecasting, EUR, windowed fitting, secondary phase ratio models, and uptime inference
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** — all 8 VLP method functions (4 methods x gas/oil)
72
- - **Gas Z-factor** — DAK, Hall-Yarborough, and BNS full-pipeline calculations
73
- - **Gas viscosity** — LGE and LBC correlations
74
- - **Gas pseudopressure** — Gauss-Legendre quadrature integration
75
- - **Oil density** — Standing-Witte-McCain-Hill (iterative and above-Pb)
76
- - **Oil FVF** — McCain density-based method
77
- - **DCA hyperbolic fitting** — grid search with RANSAC (``fit_decline``, ``fit_decline_cum``)
78
- - **Material balance** — oil matbal regression objective function
79
- - **CO2-Brine solubility** — Spycher-Pruess iterative RK-EOS solver
80
- - **VLE flash** — Soreide-Whitson multi-component Peng-Robinson 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 — any Rust-side error falls back to the Python implementation transparently
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`` — Force pure Python mode (skip Rust extension entirely)
91
- - ``PYRESTOOLBOX_RETRY_RUST=1`` — Ignore the sentinel file and retry loading the extension
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 =0.72, pbmethod ='VALMC')
160
- 5179.51086900132
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
- (1000.0000000000007, 0.05000000000000006)
173
+ (999.9999999999953, 0.049999999999999885)
173
174
  >>> dca.eur(qi=result.qi, di=result.di, b=0, q_min=10)
174
- 19799.99999999999
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.602774253829
188
+ 87.60264634235122
188
189
  >>> r.r_squared
189
- 0.9734794008096929
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 — fitting, forecasting, EUR, windowed fitting, secondary phase ratio models, and uptime inference
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** — all 8 VLP method functions (4 methods x gas/oil)
46
- - **Gas Z-factor** — DAK, Hall-Yarborough, and BNS full-pipeline calculations
47
- - **Gas viscosity** — LGE and LBC correlations
48
- - **Gas pseudopressure** — Gauss-Legendre quadrature integration
49
- - **Oil density** — Standing-Witte-McCain-Hill (iterative and above-Pb)
50
- - **Oil FVF** — McCain density-based method
51
- - **DCA hyperbolic fitting** — grid search with RANSAC (``fit_decline``, ``fit_decline_cum``)
52
- - **Material balance** — oil matbal regression objective function
53
- - **CO2-Brine solubility** — Spycher-Pruess iterative RK-EOS solver
54
- - **VLE flash** — Soreide-Whitson multi-component Peng-Robinson 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 — any Rust-side error falls back to the Python implementation transparently
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`` — Force pure Python mode (skip Rust extension entirely)
65
- - ``PYRESTOOLBOX_RETRY_RUST=1`` — Ignore the sentinel file and retry loading the extension
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 =0.72, pbmethod ='VALMC')
134
- 5179.51086900132
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
- (1000.0000000000007, 0.05000000000000006)
147
+ (999.9999999999953, 0.049999999999999885)
147
148
  >>> dca.eur(qi=result.qi, di=result.di, b=0, q_min=10)
148
- 19799.99999999999
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.602774253829
162
+ 87.60264634235122
162
163
  >>> r.r_squared
163
- 0.9734794008096929
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.4"
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; it is NaCl
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
- McCain Table 4-14 (Mao & Duan 2009).
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, 2885310.0, -11072.577, -9.0834095, 0.030925651, -0.0000274071,
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.0000002085244]
22
+ _MD_B = [0.069161945, -0.00027292263, 0.00000020852448]
21
23
  _MD_C = [-0.0025988855, 0.0000077989227]
22
24
 
23
25