Skip to main content

parq-blockmodel logo parq-blockmodel

Run Tests PyPI Coverage Python Versions License Publish Docs Open Issues Open PRs

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:

  1. Validate block model attributes against a Pandera schema.
  2. Review (profile) data quality and distributions with an HTML profile report.
  3. View the model interactively with local PyVista plotting or the Trame server viewer.

Installation

Install the base package from PyPI:

pip install parq-blockmodel

Full 3-Step Workflow

For the complete experience (validate, profile, local visualization, and GIS/server options), install with all workflow extras:

pip install "parq-blockmodel[all]"

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 — Local plotting with PyVista and Plotly:

pip install "parq-blockmodel[viz]"

**Optional: Spatial / GIS**  GeoDataFrame, GeoParquet, and polygon workflows:

```bash
pip install "parq-blockmodel[spatial]"

Optional: Server viewer — Trame web app support:

pip install "parq-blockmodel[server-viz]"

See the [Quick Start Guide](https://parq-blockmodel.readthedocs.io/en/stable/usage/quickstart.html) 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:

```python
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.

Install parq-blockmodel[viz] for local PyVista/Plotly plotting, and add parq-blockmodel[server-viz] for Trame examples.

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:

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parq_blockmodel-0.16.0.tar.gz (414.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parq_blockmodel-0.16.0-py3-none-any.whl (156.0 kB view details)

Uploaded Python 3

File details

Details for the file parq_blockmodel-0.16.0.tar.gz.

File metadata

  • Download URL: parq_blockmodel-0.16.0.tar.gz
  • Upload date:
  • Size: 414.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for parq_blockmodel-0.16.0.tar.gz
Algorithm Hash digest
SHA256 0dc0cb6c1ab22412e558262385e9868b5bcfa7972066c4dccce15e12cfd4bbcb
MD5 bdbee4ef34733be993f48b76b7a89521
BLAKE2b-256 ab04708c3d64fec5384326e9f55887dc9a48370e3a3f72ec6482475018472623

See more details on using hashes here.

File details

Details for the file parq_blockmodel-0.16.0-py3-none-any.whl.

File metadata

File hashes

Hashes for parq_blockmodel-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cdf22024391cb7bee36ad5dbe4403077eb85c0b617068311f7077c5a3a286adb
MD5 5e878514af99596a990b74e3d7189f13
BLAKE2b-256 0afb004bebfc9451caf72c6890a1dff5de91e8214428945bf8567ac7729585f0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.16.0 This release

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.14

2 files

0.12.13

2 files

0.12.12

2 files

0.12.11

2 files

0.12.10

2 files

0.12.9

2 files

0.12.8

2 files

0.12.7

2 files

0.12.6

2 files

0.12.5

2 files

0.12.4

2 files

0.12.3

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.6

2 files

0.11.5

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.9

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 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