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.0.tar.gz (58.1 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.0-py3-none-any.whl (80.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ressmith-0.2.0.tar.gz
  • Upload date:
  • Size: 58.1 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.0.tar.gz
Algorithm Hash digest
SHA256 55b30336a1b3d44ab592625991321777fa1cbaeba5c40270205b47d64e8951c3
MD5 8e4d771976cd892c7972725cfc3f3ce7
BLAKE2b-256 e6cfd9725e2406c353a323214248c9cd6699b587d6e4e6952a369d78efd1043c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ressmith-0.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: ressmith-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b41c5375d687b8e375eb5575a11950abf185cda12b8a47a8ca3ea69c4da0ae85
MD5 4dfc54609c23b948bfb79e34eda6b17d
BLAKE2b-256 1336eddcf86134f151c7731855be0133edcdb5c5a38c9b2817639cfad6dbba19

See more details on using hashes here.

Provenance

The following attestation bundles were made for ressmith-0.2.0-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