Skip to content

Commit

Permalink
Merge pull request #46 from frank1010111/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
frank1010111 authored Jul 2, 2024
2 parents 9d7d83b + 5827c25 commit f03ebe5
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ repos:
args: [--prose-wrap=always]

- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
rev: 1.18.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.7.0]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.10"
rev: "v0.5.0"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
4 changes: 2 additions & 2 deletions docs/bayesian_fitting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"source": [
"import numpy as np\n",
"from scipy.interpolate import interp1d, UnivariateSpline\n",
"from scipy.integrate import cumtrapz\n",
"from scipy.integrate import cumulative_trapezoid\n",
"from scipy.misc import derivative\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -108,7 +108,7 @@
" 1, 0.1, size=len(time_on_production)\n",
")\n",
"time_on_production = time_on_production # [1:]\n",
"cum_production = cumtrapz(production, time_on_production, initial=0)\n",
"cum_production = cumulative_trapezoid(production, time_on_production, initial=0)\n",
"\n",
"fig, ax = plt.subplots()\n",
"ax.plot(time_on_production, production, color=\"peru\", label=\"Rate\")\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/forecast.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"source": [
"import numpy as np\n",
"from scipy.interpolate import interp1d\n",
"from scipy.integrate import cumtrapz\n",
"from scipy.integrate import cumulative_trapezoid\n",
"from scipy.misc import derivative\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -104,7 +104,7 @@
") / np.sqrt(time_on_production + 0.1)\n",
"fake_rf = rf_func(time_on_production / fake_tau)\n",
"fake_rate = m_factor * np.maximum(np.gradient(fake_rf) + randomness, 0)\n",
"cum_production = cumtrapz(fake_rate, time_on_production, initial=0)\n",
"cum_production = cumulative_trapezoid(fake_rate, time_on_production, initial=0)\n",
"\n",
"fig, ax = plt.subplots()\n",
"ax.plot(time_on_production, fake_rate, color=\"peru\", label=\"Rate\")\n",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
"Topic :: Scientific/Engineering",
]
readme = "README.md"
requires-python = ">=3.8,<3.12"
requires-python = ">=3.8,<3.13"
dependencies = [
"lmfit >=1.0",
"numpy >=1.22",
Expand Down
4 changes: 2 additions & 2 deletions src/bluebonnet/fluids/fluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pandas as pd
import scipy as sp
from numpy.typing import NDArray
from scipy.integrate import cumtrapz
from scipy.integrate import cumulative_trapezoid

from bluebonnet.fluids.gas import (
b_factor_DAK,
Expand Down Expand Up @@ -106,7 +106,7 @@ def build_pvt_gas(
"viscosity": viscosity,
}
)
pseudopressure = 2 * cumtrapz(
pseudopressure = 2 * cumulative_trapezoid(
pvt_gas["pressure"] / (pvt_gas["viscosity"] * pvt_gas["z-factor"]),
pvt_gas["pressure"],
initial=0.0,
Expand Down
6 changes: 4 additions & 2 deletions tests/fluids/test_fluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def test_bg(gas_properties):
elif gas_properties.fluid == "wet gas":
real_fvf = pytest.approx(0.000813928, rel=1e-3)
else:
ValueError("gas_properties.fluid must be one of 'wet gas' or 'dry gas'")
msg = "gas_properties.fluid must be one of 'wet gas' or 'dry gas'"
raise ValueError(msg)
fluid_instance = Fluid(
temperature=gas_properties.temperature,
api_gravity=10,
Expand All @@ -112,7 +113,8 @@ def test_mu_g(gas_properties):
elif gas_properties.fluid == "wet gas":
real_mu = pytest.approx(0.023553396, rel=1e-3)
else:
ValueError("gas_properties.fluid must be one of 'wet gas' or 'dry gas'")
msg = "haven't studied this pressure yet"
raise ValueError(msg)
fluid_instance = Fluid(
temperature=gas_properties.temperature,
api_gravity=10,
Expand Down

0 comments on commit f03ebe5

Please sign in to comment.