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.

For polygon-based block flagging workflows (including persisted named polygons in GeoParquet), see the Polygon Flagging guide.

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

pbm = ParquetBlockModel.from_parquet("orebody.parquet")
plotter = pbm.plot(scalar="grade")

app = BlockModelTrameApp(pbm, scalar="grade")

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.10.0.tar.gz (203.5 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.10.0-py3-none-any.whl (126.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parq_blockmodel-0.10.0.tar.gz
  • Upload date:
  • Size: 203.5 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.10.0.tar.gz
Algorithm Hash digest
SHA256 31bf58630689814d23bd8daab26042426bf83bcfd8e53cfd4a3e33921c4d14c1
MD5 9219e0606e90e33de6acdd5f37873181
BLAKE2b-256 1cf8e427d0ef17d57e2c63e6b38985c717b20056e54dd5943f0778a28aed9609

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for parq_blockmodel-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba5e5c32079b4af4c6d27da8dd563e67339d5d9beafa16b93058a591ee906af0
MD5 54d2ac07d539249fac5d5a9ec512f4e9
BLAKE2b-256 8f6be176a7bb8d614a28977d7104846d847632861ff62a8e5ddd6a7d479e10ed

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