Skip to main content

Reservoir decline curve analysis and forecasting for production optimization and economic evaluation

Project description

ResSmith

ResSmith is a reservoir decline curve analysis and forecasting library with a strict 4-layer architecture, designed to work seamlessly with the Smith ecosystem (plotsmith, anomsmith, geosmith).

Architecture

ResSmith follows a strict 4-layer architecture with enforced one-way imports:

  • Layer 1 (Objects): Immutable dataclasses representing the core domain
  • Layer 2 (Primitives): Algorithms and base classes
  • Layer 3 (Tasks): Task orchestration
  • Layer 4 (Workflows): User-facing functions with I/O and plotting

See ARCHITECTURE_SUMMARY.md for details.

Quick Start

import pandas as pd
from ressmith import fit_forecast

# Load production data
data = pd.DataFrame({
    'oil': [100, 95, 90, 85, 80],
}, index=pd.date_range('2020-01-01', periods=5, freq='M'))

# Fit and forecast
forecast, params = fit_forecast(
    data,
    model_name='arps_hyperbolic',
    horizon=24
)

print(f"Forecast: {forecast.yhat.head()}")
print(f"Parameters: {params}")

Installation

pip install ressmith

Or with optional dependencies:

pip install ressmith[fit]  # Include scipy for optimization
pip install ressmith[viz]  # Include matplotlib (or use plotsmith)

Features

Current Models

  • ArpsHyperbolicModel - Hyperbolic decline (0 < b < 1)
  • ArpsExponentialModel - Exponential decline (b=0)
  • ArpsHarmonicModel - Harmonic decline (b=1)
  • LinearDeclineModel - Simple linear decline

Core Capabilities

  • Fit decline models to production data
  • Generate forecasts with configurable horizons
  • Evaluate economics (NPV, IRR, cashflows)
  • Batch processing for multiple wells
  • Strict type safety with timesmith.typing

Integration with Smith Ecosystem

PlotSmith

Use PlotSmith for all visualization:

from ressmith import fit_forecast
from plotsmith import plot_timeseries

forecast, _ = fit_forecast(data, model_name='arps_hyperbolic', horizon=24)
fig, ax = plot_timeseries(forecast.yhat, title='Production Forecast')

AnomSmith

Share typing from timesmith.typing for consistent data structures across libraries.

GeoSmith

Share typing and integrate spatial analysis for basin-level analysis.

Examples

See examples/ directory:

  • basic_fit_forecast.py - Fit model and generate forecast
  • basic_economics.py - Evaluate economics for a forecast

Run examples:

python examples/basic_fit_forecast.py
python examples/basic_economics.py

Migration from pydca

This library is being migrated from the pydca (decline-curve) repository. See:

Development

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Run examples
python examples/basic_fit_forecast.py

Requirements

  • Python 3.12+
  • numpy >= 1.24.0
  • pandas >= 2.0.0
  • timesmith >= 0.2.0

License

MIT License - see LICENSE file for details.

Contributing

See CONTRIBUTING.md for guidelines.

Related Projects

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ressmith-0.2.1.tar.gz (58.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ressmith-0.2.1-py3-none-any.whl (80.6 kB view details)

Uploaded Python 3

File details

Details for the file ressmith-0.2.1.tar.gz.

File metadata

  • Download URL: ressmith-0.2.1.tar.gz
  • Upload date:
  • Size: 58.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ressmith-0.2.1.tar.gz
Algorithm Hash digest
SHA256 40db5aad23f1b5d3a433d683f323af85db4074ce1889f43f07ed74633412c460
MD5 2db9bd824319c3229207e40fb059b01e
BLAKE2b-256 384539ec38cb4265582722a2d9a03010b55b89ab119975cc78388f20cd5b1f55

See more details on using hashes here.

Provenance

The following attestation bundles were made for ressmith-0.2.1.tar.gz:

Publisher: release.yml on kylejones200/ressmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ressmith-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ressmith-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 80.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ressmith-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8715ec038ea60e9887815010b1c51bd656147de266599d471199b53c70373ace
MD5 e11c70764c2cbab5be973cf7905ca940
BLAKE2b-256 555d6e752a187c168fcf2a757d71508bf3ea7f97037630e1fb4fe58574f8f748

See more details on using hashes here.

Provenance

The following attestation bundles were made for ressmith-0.2.1-py3-none-any.whl:

Publisher: release.yml on kylejones200/ressmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page