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 forecastbasic_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:
- MIGRATION_PLAN.md - Migration strategy
- MIGRATION_STATUS.md - Current status
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55b30336a1b3d44ab592625991321777fa1cbaeba5c40270205b47d64e8951c3
|
|
| MD5 |
8e4d771976cd892c7972725cfc3f3ce7
|
|
| BLAKE2b-256 |
e6cfd9725e2406c353a323214248c9cd6699b587d6e4e6952a369d78efd1043c
|
Provenance
The following attestation bundles were made for ressmith-0.2.0.tar.gz:
Publisher:
release.yml on kylejones200/ressmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ressmith-0.2.0.tar.gz -
Subject digest:
55b30336a1b3d44ab592625991321777fa1cbaeba5c40270205b47d64e8951c3 - Sigstore transparency entry: 811934276
- Sigstore integration time:
-
Permalink:
kylejones200/ressmith@9302cb28de5cd7d63602fd84b249dcd7a189bc01 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/kylejones200
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9302cb28de5cd7d63602fd84b249dcd7a189bc01 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b41c5375d687b8e375eb5575a11950abf185cda12b8a47a8ca3ea69c4da0ae85
|
|
| MD5 |
4dfc54609c23b948bfb79e34eda6b17d
|
|
| BLAKE2b-256 |
1336eddcf86134f151c7731855be0133edcdb5c5a38c9b2817639cfad6dbba19
|
Provenance
The following attestation bundles were made for ressmith-0.2.0-py3-none-any.whl:
Publisher:
release.yml on kylejones200/ressmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ressmith-0.2.0-py3-none-any.whl -
Subject digest:
b41c5375d687b8e375eb5575a11950abf185cda12b8a47a8ca3ea69c4da0ae85 - Sigstore transparency entry: 811934294
- Sigstore integration time:
-
Permalink:
kylejones200/ressmith@9302cb28de5cd7d63602fd84b249dcd7a189bc01 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/kylejones200
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9302cb28de5cd7d63602fd84b249dcd7a189bc01 -
Trigger Event:
push
-
Statement type: