Skip to main content

A Python package for efficient storage, manipulation, and analysis of mining block models using Parquet files.

Project description

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.

Installation

Install the base package from PyPI:

pip install parq-blockmodel

Install the optional schema validation support when you want to validate block model attributes with Pandera schemas or load schema definitions from YAML:

pip install "parq-blockmodel[schema]"

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.

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")

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:

Project details


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.11.4.tar.gz (217.7 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.11.4-py3-none-any.whl (136.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parq_blockmodel-0.11.4.tar.gz
  • Upload date:
  • Size: 217.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for parq_blockmodel-0.11.4.tar.gz
Algorithm Hash digest
SHA256 6246e993e21e247ef4e65355dea7b1c1033a34c7b153b8145b293f948a9fc2c3
MD5 992a789441bed564289be0ae41273e18
BLAKE2b-256 272871461937f86330f09ca649c95d7eccd18b221566592728ab34d04ace0ba0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for parq_blockmodel-0.11.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a4f4f486b9bb5e377cb214a44410768f82453ad26d70a797286ef5b429a0f92a
MD5 5340085163b790a86b1c4c71b584a606
BLAKE2b-256 15b5eb2cf7eac8e21e15ba3ba37c59cd155cfeff6c5781ca129430e0acc48001

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page