Skip to content

Commit

Permalink
Merge pull request #33 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 Mar 16, 2024
2 parents b741b14 + 51043d4 commit 0e79a9e
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 25 deletions.
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.7.0
rev: 24.2.0
hooks:
- id: black-jupyter

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.5.0
hooks:
- id: check-added-large-files
args: ["--maxkb=20000"]
Expand All @@ -23,7 +23,7 @@ repos:
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
Expand All @@ -34,20 +34,20 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.6.2"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]
args: [--prose-wrap=always]

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

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.246"
rev: "v0.3.2"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -63,12 +63,12 @@ repos:
# - scipy

- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
rev: v0.9.0.6
hooks:
- id: shellcheck

Expand All @@ -81,7 +81,7 @@ repos:
exclude: .pre-commit-config.yaml

- repo: https://github.com/mgedmin/check-manifest
rev: "0.48"
rev: "0.49"
hooks:
- id: check-manifest
stages: [manual]
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ have been used to make forecasts from the individual well level up to the basin
and play level, depending on the availability of fluid property and bottomhole
pressure data.

Compare to the most common unconventional production analysis tool. Emprical
Compare to the most common unconventional production analysis tool. Empirical
decline curve analysis (DCA) provides very fast answers, but lack physical
meaning. Bluebonnet fits include estimates of the resource within the drainage
volume and of permeability divided by interfracture spacing. A completion
Expand Down
1 change: 1 addition & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Nox sessions for linting, docs, and testing."""

from __future__ import annotations

import argparse
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ addopts = [
testpaths = ["tests"]

[tool.ruff]
line-length = 99
target-version = "py37"

[tool.ruff.lint]
select = [
"E",
"F",
Expand Down Expand Up @@ -115,8 +119,6 @@ extend-ignore = [
"PT004", # Use underscore for non-returning fixture (use usefixture instead)
"RET504", # 'unnecessary' variable assignment before return statement
]
line-length = 99
target-version = "py37"
unfixable = [
"T20", # Removes print statements
"F841", # Removes unused variables
Expand All @@ -125,7 +127,7 @@ exclude = []
flake8-unused-arguments.ignore-variadic-names = true
isort.required-imports = ["from __future__ import annotations"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"noxfile.py" = ["T", "T201"]
"tests/**.py" = ["D101", "D102", "D103"]
1 change: 1 addition & 0 deletions src/bluebonnet/flow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Flow, pressure changes, and production from hydraulically fractured reservoirs."""

from __future__ import annotations

from bluebonnet.flow.flowproperties import (
Expand Down
5 changes: 4 additions & 1 deletion src/bluebonnet/flow/flowproperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
module includes structures for storing these pressure-dependent properties
in order to aid the reservoir simulators in the `reservoir` module.
"""

from __future__ import annotations

import copy
Expand Down Expand Up @@ -80,7 +81,9 @@ def __init__(self, pvt_props: Mapping[str, ndarray], p_i: float):
pvt_props["pressure"], 1 / pvt_props["pseudopressure"]
)
warnings.warn(
"warning: scaling pseudopressure, using user's hydraulic diffusivity"
"warning: scaling pseudopressure, using user's hydraulic diffusivity",
RuntimeWarning,
stacklevel=2,
)
m_scaling_factor = m_scale_func(p_i)
else:
Expand Down
1 change: 1 addition & 0 deletions src/bluebonnet/fluids/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Uses common empirical correlations to get properties. These include density,
saturation pressure, viscosity, and the pseudopressure transform.
"""

from __future__ import annotations

from bluebonnet.fluids.fluid import Fluid, build_pvt_gas, pseudopressure
Expand Down
3 changes: 2 additions & 1 deletion src/bluebonnet/fluids/gas.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Gas pvt properties, using Dranchuk and Abou-Kassem's correlations."""

from __future__ import annotations

import math
Expand Down Expand Up @@ -165,7 +166,7 @@ def z_factor_hallyarbrough(pressure: float, temperature: float) -> float:
References
----------
`Hall-Yarbrough estimation <https://wiki.whitson.com/eos/eos_models/zfactor/index.html#hall-yarbrough-estimation-of-gas-z-factor>`_
""" # noqa: E501
"""
t = 1 / temperature
y = 0.001
fdum = 1
Expand Down
12 changes: 3 additions & 9 deletions src/bluebonnet/fluids/water.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""PVT and viscosity for water from the correlations provided by McCain."""

from __future__ import annotations

import numpy as np
Expand Down Expand Up @@ -150,12 +151,7 @@ def viscosity_water_McCain(
>>> viscosity_water_McCain(400, 3000, 15)
0.2627774655403418
"""
A = (
109.574
- 8.40564 * salinity
+ 0.313314 * salinity**2
+ 8.72213e-3 * salinity**3
)
A = 109.574 - 8.40564 * salinity + 0.313314 * salinity**2 + 8.72213e-3 * salinity**3
B = (
1.12166
- 2.63951e-2 * salinity
Expand All @@ -164,8 +160,6 @@ def viscosity_water_McCain(
- 1.55586e-6 * salinity**4
)
mu_water = (
A
* temperature**-B
* (0.9994 + 4.0295e-5 * pressure + 3.1062e-9 * pressure**2)
A * temperature**-B * (0.9994 + 4.0295e-5 * pressure + 3.1062e-9 * pressure**2)
)
return mu_water
1 change: 1 addition & 0 deletions src/bluebonnet/forecast/forecast.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fit and forecast production from hydrofractured reservoirs."""

from __future__ import annotations

from collections.abc import Callable
Expand Down
1 change: 1 addition & 0 deletions src/bluebonnet/forecast/forecast_pressure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Forecast when bottomhole/fracface pressure is known and varying."""

from __future__ import annotations

from typing import Any
Expand Down
3 changes: 2 additions & 1 deletion src/bluebonnet/plotting.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Ease plotting production and fluid flow information."""

from __future__ import annotations

from typing import Any, Union
Expand Down Expand Up @@ -37,7 +38,7 @@ def set_default_locators_and_formatters(self, axis):
axis.set_minor_locator(ticker.NullLocator())
axis.set_minor_formatter(ticker.NullFormatter())

def limit_range_for_scale(self, vmin, vmax, minpos): # noqa: ARG
def limit_range_for_scale(self, vmin, vmax, minpos): # noqa: ARG002
"""Do not allow negative values."""
return max(0.0, vmin), vmax

Expand Down
1 change: 1 addition & 0 deletions tests/flow/test_properties.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define a suite a tests for the flowproperties module."""

from __future__ import annotations

from copy import copy
Expand Down
1 change: 1 addition & 0 deletions tests/flow/test_reservoir.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define a suite a tests for the reservoir module."""

from __future__ import annotations

from itertools import product
Expand Down
1 change: 1 addition & 0 deletions tests/fluids/test_fluid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define a suite a tests for the fluid module."""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/fluids/test_gas.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define a suite a tests for the gas module."""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/fluids/test_oil.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define a suite a tests for the oil module."""

from __future__ import annotations

import math
Expand Down
1 change: 1 addition & 0 deletions tests/fluids/test_water.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define a suite a tests for the gas module."""

from __future__ import annotations

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/forecast/test_forecast.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test fitting and forecasting production."""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/test_bluebonnet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Smoke test that bluebonnet imports."""

from __future__ import annotations

import bluebonnet
Expand Down

0 comments on commit 0e79a9e

Please sign in to comment.