parq-blockmodel
Overview
A Python package for efficient storage, manipulation, and analysis of mining block models using Parquet files. parq-blockmodel provides tools for reading, writing, indexing, and transforming large-scale block model datasets, leveraging the performance of Apache Arrow and Parquet for scalable geoscience data workflows.
Typical 3-step workflow
parq-blockmodel is designed around a practical 3-step process:
- Validate block model attributes against a Pandera schema.
- Review (profile) data quality and distributions with an HTML profile report.
- View the model interactively with the PyVista/Trame visualization path.
Installation
Install the base package from PyPI:
pip install parq-blockmodel
Full 3-Step Workflow
For the complete experience (validate, profile, and visualize), install with all workflow extras:
pip install "parq-blockmodel[schema,profiling,viz]"
Installation by Workflow Step
Step 1: Validate — Pandera schema support for data validation:
pip install "parq-blockmodel[schema]"
Step 2: Review — HTML profiling reports for data quality inspection:
pip install "parq-blockmodel[profiling]"
Step 3: View — Interactive 3D visualization with PyVista/Trame:
pip install "parq-blockmodel[viz]"
See the Quick Start Guide for a walkthrough of the 3-step workflow.
Schema validation
ParquetBlockModel accepts an optional schema= argument on its main
constructors. You can pass either a Pandera DataFrameSchema object or a path
to a YAML schema file, then validate the resulting model in chunks:
from pathlib import Path
from parq_blockmodel import ParquetBlockModel
pbm = ParquetBlockModel.from_parquet(
Path("path/to/blockmodel.parquet"),
schema=Path("schemas/blockmodel.schema.yaml"),
)
pbm.validate()
pbm.validate(sample_chunks=1) # quick spot-check for large models
See the User Guide for detailed documentation on calculated attributes, including custom lookups and functions.
Profiling report review
Install profiling support and create an HTML profile report:
pip install "parq-blockmodel[profiling]"
report = pbm.create_report(columns_per_batch=None)
print(report.output_path)
When a schema includes column title / description, those values are included
in report variable descriptions. See the
Profiling Reports guide
and the examples gallery for a full walkthrough.
Visualization
The block-model plotting path now delegates through parq_blockmodel.visualization, which keeps the
rendering logic isolated from ParquetBlockModel itself.
from parq_blockmodel import ParquetBlockModel
from parq_blockmodel.visualization import BlockModelTrameApp, TrameBlockModelPlotEngine
pbm = ParquetBlockModel.from_parquet("orebody.parquet")
plotter = pbm.plot(scalar="grade", z_up_lock=True, z_up_hotkey="z")
# Optional terrain context for the PyVista engine:
# - elevation_raster adds a DEM surface
# - imagery_raster textures the DEM when both rasters align
plotter = pbm.plot(
scalar="grade",
elevation_raster="dem.tif",
imagery_raster="imagery.tif",
)
trame_app_from_plot = pbm.plot(
scalar="grade",
engine=TrameBlockModelPlotEngine(),
z_up_lock=True,
z_up_hotkey="z",
)
app = BlockModelTrameApp(pbm, scalar="grade", z_up_lock=True, z_up_hotkey="z")
With z_up_lock=True, hold z for turntable-style orbit (yaw/pitch, no roll) with camera up aligned to +Z.
Geometry operations
parq-blockmodel supports three geometry flagging workflows:
- Polygon flagging for 2D XY regions.
- Surface encoding for 2.5D elevation surfaces (
z = f(x, y)). - Solid flagging for closed 3D volumes.
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 parq_blockmodel-0.12.13.tar.gz.
File metadata
- Download URL: parq_blockmodel-0.12.13.tar.gz
- Upload date:
- Size: 398.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dca880c5b0f682fa90ba5833840a0f517eaa52f12111666e34ab221f5b3ae913
|
|
| MD5 |
065a8fcbb378bb48abdcac692719de0e
|
|
| BLAKE2b-256 |
b37999b41a826b663ea2d040c945f04be78d5d6b7a7b9c1032cbe2319b82fbe5
|
File details
Details for the file parq_blockmodel-0.12.13-py3-none-any.whl.
File metadata
- Download URL: parq_blockmodel-0.12.13-py3-none-any.whl
- Upload date:
- Size: 148.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77d3235c4ec9349907b521323c757d3d33f05886802c048be4ba6e181d204221
|
|
| MD5 |
7ba4177f3ac7190231121ef1960ec53b
|
|
| BLAKE2b-256 |
cee8139ef0f778a425f92a5feeceff7be092ce73c09ef873d2a198f43e3ce073
|