lzwei196/kiss-knowledge-infrastructure-for-scientific-simulation/gempy

Claude Code and agent skill by lzwei196/kiss-knowledge-infrastructure-for-scientific-simulation

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install lzwei196/kiss-knowledge-infrastructure-for-scientific-simulation/gempy

SKILL.md

MANDATORY EXECUTION POLICY — READ BEFORE PROCEEDING
You MUST run the actual model binary or package described in this document.
If the model fails to import, compile, or execute, you MUST:
1. Check diagnostics/triplets.yaml for a matching error pattern
2. Try the fix suggested in the triplet's remedy section
3. If still failing, report the error to the user with full details
You MUST NOT substitute a simplified Python formula, regression equation,
or hand-coded approximation in place of the real model.
Before starting, run: python preflight_check.py (in this KI directory)
to verify that the model binary/package and required data are available.
DEBUGGING PROTOCOL — When something goes wrong, follow this order:
1. Check triplets — diagnostics/triplets.yaml may already cover this error
2. Read official docs — The model's own documentation for expected formats/units
3. Find working examples — Check outputs/ or the model's shipped test data
4. Fix the tool — With knowledge of what "correct" looks like
Do NOT write custom debug scripts. The answers are in the docs and examples.

<!-- KI-MAP:BEGIN (projected by generate_skill_map.py — edit the KI, not this table) -->

KI map — what to read, and when

when you needreadwhy
FIRST, alwayspreflight_check.pyrun it (python preflight_check.py): proves env/binary/data are usable and emits a machine-readable PREFLIGHT_REPORT= line. Do not debug a run that never had a healthy environment.
to run the pipeline stagestools/ (4 tools)the executable pipeline. Read each tool's argparse (--help) before composing a command; SKILL.md's stage table says which tool serves which stage.
before running a stagedocs/s*_*.md (7 stage docs)per-stage procedure, verification and traps — the how-to that SKILL.md's overview compresses.
on ANY error, before debuggingdiagnostics/triplets.yaml (17 entries)symptom → diagnosis → remedy for this model's known failure modes. Check here FIRST; the answer usually exists. Never renumber or rewrite entries.
to know what an output ISdag.yamlthe model's identity: every output's medium, units, validation_rank (1 = the headline variable) and observability. Scoring and obs-binding read THIS — when asked 'what does this model predict', the dag is the answer, not a guess.
when building inputs / parsing outputsdocs/format_spec.yamlexact I/O shapes + known_issues, projected from dag + triplets. Regenerate with ki_tools_common/generate_format_spec.py after changing either — never hand-edit.
to judge a run's skilldocs/validation_convention.yamlhow this model's field judges it validated: per-dag_variable metrics, directions and CITED pass-bands. A run is graded against these, not against intuition.
for claims and thresholdsdocs/gathered_papers.json (19 papers) + docs/papers_index.mdthe literature this KI is judged by; each entry's text_path is fetched full text in the central paper cache. role: benchmark marks the model's own skill paper.
for a machine-readable summaryknowledge_infrastructure.yamlthe manifest (package, pipeline, validation tier, counts) — projected by ki_tools_common/generate_ki_manifest.py; regenerate after structural changes, never hand-edit.

Projected 2026-08-17 from the KI's actual contents — 9 components present. Refresh: `python3 ki_tools_common/generate_skill_map.py --ki_dir <this KI>`. <!-- KI-MAP:END -->

<!-- KI-TOOL-INDEX:BEGIN (projected by generate_skill_map.py — the discoverability contract: every public tool, exact path; PURPOSE stays human-authored elsewhere) -->

Executable tool index (projected — complete by construction)

Every public tool in this KI, by exact path. What each is FOR lives in the human-written Tool Inventory above; --help on any of these prints its arguments.

tool (exact path)invocation
tools/build_structural_params.pyKISSPATH_PYTHON_ENV/bin/python {KI}/tools/build_structural_params.py --help
tools/convert_geological_data.pyKISSPATH_PYTHON_ENV/bin/python {KI}/tools/convert_geological_data.py --help
tools/parse_gempy_output.py"${GEMPY_PYTHON:-KISSPATH_INTERNAL_NOT_SHIPPED/auto_dissect/_work/GemPy/venv/bin/python}" {KI}/tools/parse_gempy_output.py --help (needs gempy: python_env has none; GemPy venv, or $GEMPY_PYTHON)
tools/run_gempy_model.py"${GEMPY_PYTHON:-KISSPATH_INTERNAL_NOT_SHIPPED/auto_dissect/_work/GemPy/venv/bin/python}" {KI}/tools/run_gempy_model.py --help (needs gempy: python_env has none; GemPy venv, or $GEMPY_PYTHON)

4 public tools; `_`-prefixed helpers and packaging files excluded. <!-- KI-TOOL-INDEX:END -->

GemPy Knowledge Infrastructure — SKILL.md

FieldValue
Packagehydrocraft-gempy-geological
Version1.0.0
Target modelGemPy v3 (2024.1) — 3D Implicit Geological Modeler
Domain3D structural geology, geophysics
LanguagePython 3.10–3.12
LicenseEUPL-1.2
Repositoryhttps://github.com/cgre-aachen/gempy
Validation statusPhase 3

Data Preparation

Forcing data

Data Sources: Use from ki_tools_common.load_forcing import load_daily_forcing for CMFD/MSWX/NASA POWER.

Data Validation Reference: See data_ki/DTB/SKILL.md for depth-to-bedrock data.

Depth-to-bedrock (DTB) modelling notes

Reference dataset: DTB_CHINA_100.tif — ML-derived product (machine learning applied to geological, topographic, and remote-sensing predictors). Not borehole measurements. A comparison against it is a model-to-model consistency check, not an observational validation.

Key implementation notes confirmed by debugging:

  • Use DENSE grid (resolution=[nx,ny,nz]), NOT octree (octree hangs for DTB-scale data)
  • GemPy block ID mapping: ID=1 = above ground surface (z>0), ID=2 = soil layer

(0 > z > −DTB), ID=3 = basement/bedrock (z < −DTB). Extract DTB as first occurrence of ID=3 in a surface-to-depth probe column — NOT the first change from ID=1 (that triggers at z≈0, giving wrong near-zero DTB predictions)

  • Custom grid via gp.set_custom_grid(model.grid, test_profiles) then

model.solutions.raw_arrays.custom.lith_block

Point correlation (R) against a fine raster: GemPy fits a smooth geological surface and cannot reproduce fine-scale ML raster variability (sub-km spatial correlation), so a low R against such a raster is expected and is not by itself a sign of a broken setup.

1. Overview

GemPy is an open-source Python library for constructing 3D implicit geological models. It uses potential-field interpolation (universal co-kriging) to create continuous scalar fields from which geological surfaces, fault networks, and unconformities are extracted. GemPy represents geology implicitly — each formation boundary is an iso-surface of a scalar field, enabling arbitrary topology without explicit surface meshing during interpolation.

Core Capabilities
  • Implicit surface modeling via potential-field interpolation (kriging)
  • Fault networks with configurable fault–fault and fault–formation relations
  • Unconformities (erosion, onlap) via structural group stacking
  • Octree refinement for variable-resolution grids (efficient computation)
  • Dual contouring / marching cubes for mesh extraction
  • Geophysics integration — forward gravity/magnetics from 3D geology
  • Probabilistic modeling via PyTorch backend (automatic differentiation)
  • Serialization to .gempy binary format (zlib-compressed)
Architecture (v3)

GemPy v3 is split into four packages:

PackageRole
gempyHigh-level API, data classes
gempy_engineComputation (NumPy/PyTorch)
gempy_viewerVisualization (matplotlib/PyVista)
gempy_pluginsExtensions (topology, etc.)

2. Installation

Quick Install (pip)
bash
python -m venv venv && source venv/bin/activate
pip install "gempy[base]" # core + viewer + pandas
pip install "gempy[opt]" # + plugins, pooch, scipy, scikit-image
From Source
bash
git clone https://github.com/cgre-aachen/gempy.git
cd gempy
pip install -e ".[base]"
Dependencies
PackageVersion ConstraintRole
gempy_engine>=2026.0.1dev0,<2026.1.0Interpolation backend
gempy_viewer~2025.1.42D/3D visualization
pandas>=2.2.0,<3.0.0CSV I/O
numpy(via gempy_engine)Array operations
pydantic(via gempy_engine)Data validation
poochoptionalExample data download
scipyoptionalScientific computing
scikit-imageoptionalMesh post-processing
Smoke Test
python
import gempy as gp
model = gp.create_geomodel(
project_name="test",
extent=[0, 1000, 0, 1000, 0, 1000],
resolution=[10, 10, 10],
refinement=4
)
print(model) # Should print GeoModel summary

3. Pipeline Architecture

┌─────────────────┐
│ S1: Input Data │ CSV surface points + orientations
│ Preparation │ (X, Y, Z, formation, G_x, G_y, G_z)
└────────┬────────┘
│
┌────────▼────────┐
│ S2: GeoModel │ create_geomodel() with extent, resolution
│ Initialization │ ImporterHelper for CSV column mapping
└────────┬────────┘
│
┌────────▼────────┐
│ S3: Structural │ map_stack_to_surfaces()
│ Organization │ Define series, groups, fault relations
└────────┬────────┘
│
┌────────▼────────┐
│ S4: Grid │ OCTREE / DENSE / CUSTOM / TOPOGRAPHY
│ Configuration │ set_active_grid(), set_section_grid()
└────────┬────────┘
│
┌────────▼────────┐
│ S5: Fault │ set_is_fault(), set_fault_relation()
│ Configuration │ Finite fault support (prototype)
└────────┬────────┘
│
┌────────▼────────┐
│ S6: Interpolation│ compute_model(engine_config)
│ Computation │ Backend: NumPy (default) or PyTorch
└────────┬────────┘
│
┌────────▼────────┐
│ S7: Solution │ scalar_field, block model, meshes
│ Extraction │ Marching cubes / dual contouring
└────────┬────────┘
│
┌────────▼────────┐
│ S8: Validation │ Cross-section plots, 3D visualization
│ & Visualization│ Geophysics forward modeling (gravity)
└────────┬────────┘
│
┌────────▼────────┐
│ S9: Export & │ .gempy binary, VTK, CSV, JSON
│ Serialization │ save_model() / load_model()
└─────────────────┘
Stage Dependencies
StageDepends OnParallel?
S1—Yes
S2S1No
S3S2No
S4S2Yes (with S3, S5)
S5S2Yes (with S3, S4)
S6S3, S4, S5No
S7S6No
S8S7Yes
S9S7Yes (with S8)

4. Input Formats

Surface Points CSV

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/lzwei196/kiss-knowledge-infrastructure-for-scientific-simulation/gempy/badge)](https://verified-skill.com/skills/lzwei196/kiss-knowledge-infrastructure-for-scientific-simulation/gempy)

Something wrong with this skill or its page? Tell us.