oreblocks
Software note (CC-BY-4.0): "oreblocks: License-Free Synthetic Ore-Body Block Models with a Stamped Exact
Ultimate-Pit Optimum", concept DOI 10.5281/zenodo.21512088 (source in
manuscripts/ore-body-twins/). It gives the deposit archetypes, the exact
max-closure ultimate-pit solver, and an independent LP cross-check to machine precision (~1e-15).
Synthetic 3-D ore-body block models of the MineLib nature, and their scheduling — seeded deposit
archetypes with per-block grades, bench (level) structure, slope precedence, UPIT economics with
per-block optimal destination, an exact max-closure solver, extraction states with loading
faces, MineLib .blocks/.prec/.upit/.cpit/.pcpsp read/write, the certified CPIT LP bound
by the critical multiplier algorithm, the TopoSort rounding heuristics, and spatial-coherence
metrics. Deterministic given a seed; every generated instance is clearly labelled SYNTHETIC.
Why: per-block ground truth on real mines is licensed or proprietary (MineLib grants academic download only, no redistribution). oreblocks generates instances of the same nature — 3-D benches, grades, precedence, net values — with a stamped exact optimum, so solvers, dispatch simulators and teaching apps get license-free realistic instances with known-by-construction answers.
Install
pip install oreblocks
Quickstart — a MineLib-format twin with a stamped optimum
from oreblocks import make_twin
twin = make_twin("porphyry", dims=(20, 20, 10), seed=42)
print(twin.upit.pit_value, twin.upit.n_in_pit) # the EXACT optimum, stamped
twin.write("out/") # -> twin-*.blocks / .prec / .upit / .meta.json (MineLib format)
The emitted triplet is byte-consumable by any MineLib UPIT reader. Cross-validated against an independent TypeScript min-cut engine (CAOS PitForge, which reproduces the published newman1 / zuck_small / kd optima): relative disagreement ~1e-11 on a 4,000-block twin.
Scheduling: which blocks, and WHEN
The ultimate pit says which blocks are worth mining. The constrained pit limit problem (CPIT) says when: assign every block a period so slope precedence holds in every period, per-period capacities hold, and discounted value is maximised. It is NP-hard, so what ships is a certified upper bound plus feasible schedules, with the gap between them reported rather than hidden.
import oreblocks as ob
inst = ob.read_cpit("newman1.cpit") # periods, discount rate, capacities
prec = ob.read_prec("newman1.prec", inst.n_blocks)
result, relaxations = ob.solve_cpit(inst, prec) # bound, schedule, local search
print(f"{result.npv:,.0f} bound {result.bound:,.0f} gap {result.gap_pct:.2f}%")
controls = ob.run_controls(inst, prec, result) # duality, bound, order invariance
assert controls.all_pass
The bound needs no LP solver. Chicoisne et al. 2012 (Operations Research 60(3):517-528,
doi:10.1287/opre.1120.1050, Theorem 3.1) show the CPIT LP
relaxation is solved exactly in O(mn log n) for one resource per period, as a sequence of
parametric nested pits, which are maximum closures, which this package already computes exactly.
On the published newman1.cpit this implementation returns a certified bound of 24 487 410
against the published LP bound of 24 486 549 (relative difference 3.5e-5, and the residual is in
the right direction because the single-resource relaxation is looser than the joint bound).
Full detail, including the three file-format traps and the explicit list of what is not implemented
(stockpiles, blending, minimum-production constraints, the exact C-PIT[D] local search, stochastic
scheduling): docs/scheduling.md.
Pieces
| Module | What |
|---|---|
BlockGrid |
regular grid; LEVELS increase upward (the MineLib convention) |
make_deposit |
seeded archetypes: porphyry, vein, layered, core_halo (trend + correlated noise) |
Econ / block_values |
UPIT net value at the optimal destination (floating cutoff = the max) |
build_precedence |
slope-cone template one level up (45° cubic → the classic 9-point), CSR |
solve_upit |
exact Picard max-closure → Dinic min-cut; closure + value-identity self-checks |
extraction_state / loading_faces |
top-down bench extraction + seeded k-means shovel faces (grade at face, ore fraction, tonnes) — the bridge to haulage simulators |
write_minelib / read_* |
the .blocks/.prec/.upit triplet + a meta sidecar with the stamped optimum |
Convention notes
- Levels (z) increase upward: level 0 is the deepest bench — exactly how published MineLib
instances index (verified against newman1). Depth-down viewers flip with
z_down = nz-1-level. .blocksfree columns written by oreblocks are documented in the meta sidecar:grade (mass fraction) · tonnage (t) · density (t/m³).- Nothing here downloads or redistributes published MineLib data.
Used by
- minehaulsim (haulage DES) — geology-grounded scenarios: loading faces with grade/bench.
- CAOS PitForge — license-free synthetic twins next to the published-instance lane.
License
Apache-2.0.
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 oreblocks-0.2.0.tar.gz.
File metadata
- Download URL: oreblocks-0.2.0.tar.gz
- Upload date:
- Size: 41.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8618eaec54cdd3edda0ca48d68ac02589c92d5a8ee08996e94c708ed2a61aa3
|
|
| MD5 |
b3a80a4ece5f9864953229131af2f9fd
|
|
| BLAKE2b-256 |
3967665a40363cf58bef0ca78b6cca68a830e584849e72aae53a80bccdfaf218
|
Provenance
The following attestation bundles were made for oreblocks-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on fsantibanezleal/CAOS_OreBlocks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oreblocks-0.2.0.tar.gz -
Subject digest:
f8618eaec54cdd3edda0ca48d68ac02589c92d5a8ee08996e94c708ed2a61aa3 - Sigstore transparency entry: 2372554948
- Sigstore integration time:
-
Permalink:
fsantibanezleal/CAOS_OreBlocks@a192071c1c045d0a8b42aa156f75a8243566c5d7 -
Branch / Tag:
refs/tags/v0.02.000 - Owner: https://github.com/fsantibanezleal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@a192071c1c045d0a8b42aa156f75a8243566c5d7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file oreblocks-0.2.0-py3-none-any.whl.
File metadata
- Download URL: oreblocks-0.2.0-py3-none-any.whl
- Upload date:
- Size: 38.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6bf130249c39c757b19863f6008cfa125e4758ad592d2f16ec5cd921e301b4a
|
|
| MD5 |
9c8fbffe05c58863a3cef542f8305c88
|
|
| BLAKE2b-256 |
c78a029916980aa88ba1fda5506f212e9a6b65d7ff61584cd94d35fb1ed3b06d
|
Provenance
The following attestation bundles were made for oreblocks-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on fsantibanezleal/CAOS_OreBlocks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oreblocks-0.2.0-py3-none-any.whl -
Subject digest:
e6bf130249c39c757b19863f6008cfa125e4758ad592d2f16ec5cd921e301b4a - Sigstore transparency entry: 2372554977
- Sigstore integration time:
-
Permalink:
fsantibanezleal/CAOS_OreBlocks@a192071c1c045d0a8b42aa156f75a8243566c5d7 -
Branch / Tag:
refs/tags/v0.02.000 - Owner: https://github.com/fsantibanezleal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@a192071c1c045d0a8b42aa156f75a8243566c5d7 -
Trigger Event:
release
-
Statement type: