Skip to main content

pyGeoMechanics Documentation

Overview

The pyGeoMechanics library is a Python-based solution for geomechanical computations. It provides modular components for data ingestion, preprocessing, overburden stress calculations, pore pressure analysis, stratigraphy modeling, trajectory analysis, and utility functions. The architecture supports seamless integration into enterprise geomechanical workflows.

Directory Structure

Custom_library/
├── runner.py            # Workflow orchestrator
├── Ingestion.py         # Data ingestion and parsing
├── Preprocessing.py     # Data cleaning and preparation
├── Overburden.py        # Overburden stress computation
├── Pore_pressure.py     # Pore pressure analysis
├── Stratigraphy.py      # Stratigraphy layer modeling
├── Trajectory.py        # Wellbore trajectory analysis
├── Utils.py             # Utility functions
└── requirements.txt     # Project dependencies

Installation and Setup

1. Install Dependencies

pip install git+https://github.com/abhishake99/pyGeoMechanics.git

2. Configuration Parameters

The executor.py script accepts the following parameters:

Parameter Type Description
las_folder_path str Directory containing LAS files, Note: please provide the unprocessed/raw LAS files only.
trajectory_file_path str CSV file path with columns: md, azi, inc
tvd_csv_path str Output filename for TVD data
rkb float Rotary Kelly bushing elevation (m)
tvd_sample_rate float Depth sampling interval (default: 0.01 m)
geological_zones dict Zone definitions with depth and GR cutoff ranges
area_type str Geographic context: 'onshore' or 'offshore'
gap_fill_method str Density interpolation: 'exponential' or 'linear'
nct_type str Normal compaction trend: 'semilog' or 'poly'
outlier_ranges dict Valid ranges for log curves
folder_name str Folder name where you want to save outputs

Example Configuration

{
    "geological_zones": {
        "ZONE_1": {"dept": [0, 2500], "gr": [25, 120]},
        "ZONE_2": {"dept": [2501, 4500], "gr": [25, 120]}
    },
    "outlier_ranges": {
        "DTCO_merged": [40, 150],
        "DTSM_merged": [60, 360],
        "RHOB_merged": [1.2, 3.0],
        "GR_merged": [0, 250]
    }
}

3. Execution Workflow

from pyGeoMechanics.runner import run_geomechanics

run_geomechanics(las_folder_path=r"...\2. Well Logs\BRK012 Raw Logs",
        trajectory_file_path=r'...\BRK012_Survey _wellpathy.csv')

The application executes the following sequence:

  1. Data ingestion via Ingestion.py
  2. Data preprocessing via Preprocessing.py
  3. Geomechanical analysis using Overburden.py, Pore_pressure.py, Stratigraphy.py, Trajectory.py
  4. Results export to Data output directory containing plots as PNG and data in CSV format

Output Examples

  • Stratigraphy: Stratigraphy
  • Overburden Stress: Overburden Stress
  • Normal Compaction Trend: Normal Compaction Trend
  • Pore Pressure: Pore Pressure

Module Reference

Module Purpose
Ingestion.py Reads and parses input data (CSV, LAS, Excel)
Preprocessing.py Data validation, cleaning, and normalization
Overburden.py Calculates vertical stress profiles
Pore_pressure.py Computes pore pressure magnitudes
Stratigraphy.py Models stratigraphic sequences and properties
Trajectory.py Processes wellbore deviation surveys
Utils.py File I/O
runner.py Orchestrates module execution and data flow

Release files for pyGeoMechanics 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyGeoMechanics 0.0.3
File Size Uploaded
pygeomechanics-0.0.3.tar.gz 23.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyGeoMechanics 0.0.3
File Interpreter ABI Platform
pygeomechanics-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 49.0 kB

Release files / pygeomechanics-0.0.3.tar.gz

Download URL pygeomechanics-0.0.3.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3bcdf7fc2e22339cf9473da5916e7299be6bb2529f4206aef9a5229498c0a9a5
BLAKE2b-256 checksum
How to use checksums
2ebd08712cb3ffa6e46779744efbed1b89f9fa4ffc08227f02d1605e563942b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pygeomechanics-0.0.3-py3-none-any.whl

Download URL pygeomechanics-0.0.3-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd5404b40d3bbc6315003131f1ab4707162b05f61fc29bf5deb0e8d3ad757dd9
BLAKE2b-256 checksum
How to use checksums
89f7e0c618cb6365461b86ebe0c973a8371e2ebbb5568f8d142eac319e6cbc73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page