RockMassPy
Open-source rock mass engineering library for mining: rock mass classifications (RQD, RMR, Q, GSI, MRMR, Q-slope, SMR), Hoek-Brown strength, site-customizable classification tables, charts, ground support recommendation, per-country regulatory profiles, rock slope analysis (kinematics, stereonets, block and limit equilibrium), uncertainty in classifications and data-driven support prediction. C++20 core with a Python API.
Documentation: https://miqueas.dev/rockmasspy (guide, methods, worked examples and API reference, in English and Spanish). Changes per version are in CHANGELOG.md.
Status: version 0.2.0 (phases 1 to 5: calculation core and per-labor tables, support and the Peru profile, open pit, predictive module, synthetic mine and test bench; phase 7: uncertainty in classifications). The library recommends, the engineer decides.
Installation
pip install rockmasspy
Prebuilt wheels are published for Python 3.10 to 3.14 on Linux (x86_64), Windows and macOS (Apple Silicon), so no compiler or CMake is required. The base install has no Python dependencies: the calculations live in the compiled core.
Optional extras add what is not pure calculation:
| Extra | Adds | For |
|---|---|---|
io |
pyyaml, openpyxl |
Tables in YAML and Excel; sections, stope faces, slopes and the history template in Excel |
viz |
matplotlib |
Q chart, stability graphs, stereonets, field charts, profiles and maps |
report |
python-docx |
Word report (the HTML report needs nothing extra) |
ml |
numpy, scipy |
Predictive module |
pip install "rockmasspy[io,viz,report,ml]"
On other platforms (Linux ARM, Intel Macs) pip builds the C++ core from the source distribution, which needs a C++20
compiler.
Minimal example
import rockmasspy as rm
q = rm.q_value(rm.QInput(65, 9, 1.5, 2, 1, 1)) # rqd, Jn, Jr, Ja, Jw, SRF
print(q.q, q.info.method_id) # 5.4167 Q-NGI-2025
gsi = rm.gsi_from_jcond89_rqd(18, 65).gsi # 59.5
p = rm.hb_params(gsi, 25, 0) # mi = 25, D = 0, HB-2018
scm = rm.hb_global_strength(90.0, p)
s3 = rm.hb_sigma3max(scm, 0.027, 400, rm.HbApplication.Tunnel) # MN/m3, depth in m
mc = rm.hb_mohr_coulomb(90.0, p, s3)
print(mc.phi_deg, mc.cohesion_mpa) # 52.75 2.633
A full synthetic walk-through is in examples/01-tramo-sintetico/.
Per-labor support tables
Each labor type (gallery, stope...) gets its own table: a catalog of support types plus RMR/Q/GSI classes or GSI chart cells.
Tables validate (warn, never block), classify, and round-trip through JSON, YAML and Excel. YAML and Excel need the optional extra: pip install "rockmasspy[io]".
import rockmasspy as rm
cat = rm.SupportCatalog([rm.SupportType("I", 1), rm.SupportType("II", 2, bolt=rm.Bolt("split-set", 1.8, 1.5))])
classes = [(80, "I", "I"), (60, "II", "I"), (40, "III", "II"), (20, "IV", "II"), (0, "V", "II")]
table = rm.RangeTable("RMR", "RMR89", [rm.RangeClass(lo, lo + 20, label, sup) for lo, label, sup in classes])
labor = rm.LaborTable("gallery", cat, table, span_m=(3, 4))
print(labor.validate()) # []
c = labor.classify(53)
print(c.label, c.support.code) # III II
print(labor.classify(40).label) # IV
A value exactly on a class boundary (RMR 40) takes the worse class. The library recommends, the engineer decides.
See examples/02-tabla-por-labor/.
RatingTable (your own ratings per parameter, RMR89 by default) is available in Python and is saved with the labor table
(LaborTable.rating) in JSON, YAML, Excel and CSV (save_csv_dir / load_csv_dir).
CSV is a folder with one file per sheet (UTF-8 with BOM). save_csv_dir(t, path) writes the number format of the
computer (on Windows the one Excel uses, elsewhere the locale), so colleagues in Spain or the US open it in their own
Excel; pass separator= ("," or ";") and/or decimal= ("." or ",") to force one. load_csv_dir reads both, matches file names case-insensitively (TABLA.CSV is Tabla) and also takes the
date as d/m/yyyy (day first).
Charts
Needs the optional extra pip install "rockmasspy[viz]" (matplotlib 3.8 or newer). Without it, import rockmasspy still
works and any rockmasspy.viz call raises an ImportError that names the extra. Figures are plain matplotlib Figure
objects (no global state, no windows).
import rockmasspy.viz as viz
style = viz.Style(lang="en", size="cartilla", brand="My company") # lang "es" (default) or "en"; size "cartilla", "A4" or "A3"
fig = viz.plot_cartilla(labor, style=style) # `labor` comes from the block above
path = viz.save_figure(fig, "figs/cartilla.png") # creates the folder; png, svg or pdf
print(path.name) # cartilla.png
p = rm.hb_params(45, 10, 0) # HbParams keeps no GSI, mi or D...
env = viz.plot_hb_envelopes(50.0, p, sigma3max_mpa=1.35, gsi=45, mi=10, d=0) # ...so pass them for the footer
The same module draws the quantified GSI chart, Hoek-Brown envelopes, Q-RMR scatter and class histograms; every figure
states its source in the footer. The library recommends, the engineer decides. See examples/03-cartillas/.
Tramos, batch, report and CLI
Needs the extras pip install "rockmasspy[io,viz,report]" (the HTML report only needs the base package; Word needs
[report], figures need [viz]). load_tramos reads a Tramos sheet (Excel or CSV) and takes a column_map from
your column names to the template's. Classification never stops on a bad row: a tramo with no table for its labor or
span, or without the method value, stays unclassified (label=None) with a warning, and the summary counts it apart.
Neither the library nor the CLI prints tramo rows.
from pathlib import Path
import rockmasspy as rm
import rockmasspy.report as rp
Path("tramos.csv").write_text("id_tramo,Labor,luz_m,RMR\nT01,gallery,3.5,53\n", encoding="utf-8") # a one-row sheet
tramos = rm.load_tramos("tramos.csv", column_map={"RMR": "rmr_valor", "Labor": "tipo_labor"}) # CSV: the sheet is the file name
results = rm.classify_tramos(tramos, [labor]) # `labor` comes from the tables section
summary = rm.summarize(results)
rm.save_results(results, "results.csv") # or .xlsx (needs [io])
report = rp.build_memoria(results, [labor], title="Calculation report", lang="en")
rp.write_html(report, "report.html") # rp.write_docx(report, "report.docx") needs [report]
print(summary.total, summary.classified) # 1 1
Every report states what it is: "The library recommends, the engineer decides. This document does not replace the
signed geomechanical study." on the cover and in each page footer, plus the edition and verification mark of each
method and the RockMassPy version. rp.build_anexo39b gives the Annex 39 B layout of DS 024.
The same pipeline from the command line (exit code 0 ok, 1 input or usage error, 2 done but needs attention):
rockmass check galeria.json
rockmass cartilla galeria.json -o cartilla.png --lang en
rockmass classify tramos.xlsx --tables galeria.json -o results.csv
rockmass report tramos.xlsx --tables galeria.json -o report.docx --template anexo39b --labor gallery
See examples/04-informe/.
Uncertainty and class boundaries
classification_uncertainty samples the inputs of RMR89, Q, GSI or Hoek-Brown (Monte Carlo or LHS, fixed seed) and
reports mean, sd, p05, p50, p95, minimum and maximum of each output, plus the probability of each class and of each
support of the labor table. It reports; it never changes an attention rule or an exit code. The distributions are
yours: the library only propagates what you give it. A sample the core rejects is an error that names the variable.
import rockmasspy as rm
from rockmasspy import probabilistic as pb
base = rm.Rmr89Input()
base.functions = rm.RmrFunctions.Continuous # Kundu et al. (2020) curves instead of the table ratings
base.ucs_mpa, base.rqd_pct, base.spacing_m = 90.0, 70.0, 0.3
base.joint_condition_rating, base.water = 20.0, rm.Water.Dry
table = rm.LaborTable("gallery", rm.SupportCatalog([rm.SupportType("I", 1), rm.SupportType("II", 2)]),
rm.RangeTable("RMR", "RMR89", [rm.RangeClass(0, 68, "fair", "II"), rm.RangeClass(68, 100, "good", "I")]))
u = rm.classification_uncertainty("RMR89", base, {"ucs_mpa": pb.normal(90, 15, 50, 130), "rqd_pct": pb.uniform(55, 85)},
table=table, n=2000, seed=1)
print(round(u.outputs["rmr"].mean, 1), u.class_probabilities) # 67.4 {'fair': 0.5995, 'good': 0.4005}
RmrFunctions.Continuous uses continuous functions fitted to the Bieniawski (1989) charts (Kundu et al., 2020; method
RMR89-continuous), so a small change in UCS, RQD or spacing moves the rating smoothly. Classification against a
range table warns near the boundary between classes {a} and {b} when the value is within 3 points of the edge
(RMR, GSI) or within a factor of 1.25 (Q); these two margins are provisional. In batch, a Distribuciones sheet per
id_tramo adds clase_probable, prob_clase_probable, prob_clase, probabilidades and n_validas to the results
(rockmass classify ... --distributions FILE, also in report). See examples/14-incertidumbre-clasificacion/.
Q support chart (reference)
Digitized from the NGI Q-system support chart (2025, Fig. 4-1; 2015 edition, Fig. 7), with the ESR table, the
equivalent dimension De = span / ESR and three classical formulas marked Secondary. It is a reference next to your own
tables, never a replacement. ESR is a safety decision: esr_category is required, and categories with a range (A, B) also need esr.
from rockmasspy.q_support import recommend_q_support
r = recommend_q_support(4.5, 15.0, esr_category="C") # public Hoek chamber: Q 4.5, span 15 m
print(r.roof.category) # 3
print(f"{r.roof.de_m:.3f}") # 9.375
print(r.roof.no_empirical_data) # False
w = recommend_q_support(0.4, 4.5, esr_category="C", edition="Q-NGI-2015", wall_height_m=4.5)
print(w.wall_q) # 1.0
Hoek publishes category 4 for this chamber, read on an older (1993) chart; the digitized 2025 and 2015 charts give 3.
The chart bolt length (q_carta_longitud_* columns) is given for ESR = 1; with another ESR, compare it with the Barton et al. (1980) formula and your own judgement.
Points in the dashed zones of the chart (no empirical data) follow their lines and carry no_empirical_data and a warning.
In batch, rm.add_q_chart_reference(results, {"*": "C"}) adds the roof reading using only the tramo's own Q, and the
report gets section 5.1; viz.plot_q_chart draws the chart with the tramos (never labelled). From the command line:
rockmass qsupport --q 4.5 --span 15 --esr-category C --chart point.png # exit 2 on a warning or category 7 or higher
rockmass classify tramos.xlsx --tables galeria.json --esr "*=C" -o results.csv
See examples/05-sostenimiento-q/.
Stope stability (Mathews) and MRMR
Modified Mathews stability number of Potvin (1988): N' = Q' x A x B x C, with the hydraulic radius of each stope face
(hydraulic_radius, hydraulic_radius_rect) and the stable / transition / caved zones of Potvin's graph, digitized
by RockMassPy. There is no logit curve: Mawdesley publishes no coefficients. Factor C follows Potvin's own equation
(8 - 6 cos a); the 8 - 7 cos of Mathews et al. (1980) belongs to the original method. The MRMR is Laubscher (1990) and
its zones are read on the 1994 diagram. Everything is Primary; read points outside the frame are taken on the
unfavourable side, with a warning.
import rockmasspy as rm
# N' = Q' * A * B * C of a synthetic roof face (Q' 12, HR 2.5 m), read on Potvin's stability graph
r = rm.mathews_stability(12.0, 2.5, ucs_mpa=120, sigma1_mpa=30, dip_difference_deg=60,
failure_mode="gravity", surface_inclination_deg=0)
print(f"{r.factor_a:.3f} {r.factor_b:.1f} {r.factor_c:.1f}") # 0.325 0.8 2.0
print(f"{r.n_prime:.2f}") # 6.24
print(r.reading.zone_label) # stable
# MRMR (Laubscher 1990) of a synthetic case, placed on the 1994 caving diagram at HR = 30 m
i = rm.Mrmr90Input()
i.irs_mpa, i.rqd_pct, i.spacings_m, i.joint_condition = 100, 75, [0.5, 1.0, 3.0], 10.8
m = rm.mrmr90(i)
print(m.mrmr_class) # 3B
print(rm.read_stability_graph("Laubscher1994-stability", 30.0, m.mrmr).zone_label) # caving
Faces come from a Superficies sheet (xlsx) or a CSV (rm.SURFACE_COLUMNS): rm.load_stope_surfaces,
rm.assess_stope_surfaces, rm.save_stope_results, viz.plot_stability_graph and report.build_stope_report. A
face with impossible geometry stops the run with its row. From the command line:
rockmass mathews Superficies.csv --chart mathews.png -o results.csv # exit 2 if a face is in transition, caved or warns
rockmass mrmr --irs 100 --rqd 75 --spacing 0.5 1.0 3.0 --jc 10.8 --hr 30 --chart laubscher.png
See examples/06-tajeos-mathews-mrmr/.
Normative verification (Peru, DS 024-2016-EM)
rockmass verify and verify(...) compare your inputs (per-labor tables, tramos, stope faces and a design sheet set)
with the requirements of a normative profile: a JSON file in python/rockmasspy/profiles/. The first one is
PE-DS024-2016: the Peruvian mining safety regulation (DS 024-2016-EM, with DS 023-2017-EM and DS 034-2023-EM) and the
Osinergmin (2017) geomechanical criteria guide. Every requirement carries its instrument, article, page, URL and
force: law (the regulation) or guide (a recommendation, which never reads "does not comply"). Text that was
not in force on --as-of is reported as not verifiable and says since when the loaded text applies.
Six statuses: complies, does not comply, attention, note, not checked (you gave no input for it) and not verifiable by the library (procedural, or no rule for it). Read this part twice:
- "Not verifiable by the library" is not a non-compliance. It means the library cannot judge it (a signed study, posting in the labor, the quarterly inspection); the engineer checks it.
- The library never says "approved". A "complies" only means that the declared numbers meet the numeric limit it could check; the signed study and the engineer's judgment remain.
- Exit code 0 if nothing fails, 1 for an input error, 2 if something does not comply or needs attention. Notes, items not checked and items not verifiable do not change the code.
import rockmasspy as rm
from rockmasspy.design_inputs import DesignInputs, RefugeStation
from rockmasspy.verify import verify
# one synthetic refuge station: RMR 55 with no declared support, 400 m from the face, 30 m2 for 20 people
st = RefugeStation("E1", "roca", rmr=55, distancia_frente_m=400, area_m2=30, aforo=20)
v = verify(rm.get_profile("PE-DS024-2016"), as_of="2026-11-02", design=DesignInputs(refuge_stations=(st,)))
print("PE-DS024-2016" in rm.available_profiles()) # True
print(v.counts()) # {'complies': 2, 'does_not_comply': 1, 'attention': 0, 'note': 0, 'not_checked': 12, 'not_verifiable': 9}
print(v.exit_code) # 2
The design sheets are Estaciones_refugio, Refugios_peatonales, Resumen_QC, Factores_seguridad and Autosoporte
(an xlsx workbook, or one CSV per sheet named after it; all optional). Row identifiers never reach the console or the
report. From the command line:
rockmass verify --profile PE-DS024-2016 --as-of 2026-11-02 --tables galeria.json --tramos Tramos.csv \
--surfaces Superficies.csv --design Estaciones_refugio.csv Resumen_QC.csv --report verificacion.html
See examples/07-verificacion-normativa-peru/.
Slope kinematics, SMR and Q-slope
For one open-pit slope face and its discontinuity sets, rockmass slope and assess_slopes(...) return:
- the Fisher statistics of each family (mean orientation, kappa, alpha95) and the pole density;
- the Markland kinematic tests: planar sliding, wedge sliding (primary and secondary zones), flexural toppling and direct toppling (oblique toppling is counted apart), each with its count and percentage;
- the SMR (Romana, discrete; Tomas, continuous) per family, per wedge and per plane without a family, with the case that governs and its class;
- the Q-slope of Bar and Barton and the angle beta, compared with the face dip.
Read this part twice:
- The percentages are feasibility, not probability. They are the share of poles (planar, flexural) or of intersections (wedge, direct toppling) that fall in the critical zone. They are not a probability of failure.
- The lateral limit (30 degrees by default,
--lateral-limit) keeps planar sliding and both topplings to the discontinuities that strike close to the face. Wedge sliding has no lateral limit. The planar count without limits is reported too; the exit code uses the one with limits. - A face steeper than beta (
face_steeper_than_beta) means the face is steeper than the angle Q-slope allows without reinforcement or support: it asks for attention. A face equal to beta is also flagged. - The wedge figure counts primary plus secondary intersections. The continuous SMR (
smr_caso_continuo) has its own governing case, apart from the discrete one. familianames reach the console in warnings: do not put labor or mine codes in them.id_taludandid_tramogo only to the results file and the report tables, never to the console or the figures.
import rockmasspy as rm
# a synthetic planar case (Tomas et al. 2006, p. 93): face 22/180, joint 21/209, basic RMR 60, normal blasting
a = rm.smr_angles(rm.SmrMode.Planar, 209, 21, rm.PlaneOrientation(180, 22))
print(f"{a.a_deg:.0f} {a.b_deg:.0f} {a.c_deg:.0f}") # 29 21 -1
d = rm.smr(60, rm.SmrMode.Planar, rm.SmrFunctions.Discrete, rm.SlopeExcavation.NormalBlastingOrMechanical, a)
c = rm.smr(60, rm.SmrMode.Planar, rm.SmrFunctions.Continuous, rm.SlopeExcavation.NormalBlastingOrMechanical, a)
print(f"{d.smr:.0f} {d.smr_class} {c.smr:.1f} {c.smr_class}") # 52 3 55.7 3
# Q-slope 0.6 (Bar and Barton 2018, Table 12): the steepest angle without reinforcement
print(f"{rm.q_slope_beta(0.6):.2f}") # 60.56
The faces come from a Taludes sheet and the planes from a Familias sheet (xlsx, or CSV): rm.load_slope_faces,
rm.load_families, rm.assess_slopes, rm.slope_counts, rm.save_slope_results (26 columns) and
report.build_slope_report. report.slope_modes and report.slope_figure are the helpers the command line uses for
the stereonets. From the command line (exit 2 if anything asks for attention):
rockmass slope --faces Taludes.csv --families Familias.csv --report taludes.html --charts fig -o resultados.csv
See examples/08-taludes-cinematica-smr-qslope/.
Rock blocks, probability of failure and bench–berm design
On top of the kinematics, assess_blocks(...) and rockmass slope --blocks run limit-equilibrium blocks per row of a
Bloques sheet, each tied to a slope face by id_talud:
- planar sliding (Hoek and Bray), with a tension crack, water, horizontal seismic load, a bolt or an external force, and an optional back-analysis (the c–phi pairs that give FS = 1);
- wedge sliding by vector resolution (two planes, one plane or lift-off), with water pressure per joint, seismic load and an external force;
- toppling of regular blocks (Goodman and Bray 1976), with an optional support force at the toe;
- a berm (Ritchie modified, 0.2 H + 4.5 m): inter-ramp angle, width against the required one and, with a distribution, the berm reliability.
A block row with a Distribuciones row for its variables also gets a probability of failure (Monte Carlo or Latin
hypercube, truncated normal, exponential or uniform variables, a fixed seed), with the FS mean, deviation and
reliability index. A sampled variable that has a column in Bloques must also be filled in the row: the
deterministic FS, the only one that decides attention, runs on that value.
Read this part twice:
- The PoF depends on the distributions you choose. The library propagates what you give it; it does not know how much your rock mass varies. The same seed, sample size and sheets give the same PoF on any machine.
- FS equal to 1 counts as failure (with a 1e-9 margin), a lifted-off sample counts as failure, and the PoF is
conditional on the block forming (
nandn_validare reported). - The library never says "acceptable". Only an FS below 1 and the warnings change the exit code. The PoF, the berm reliability and the comparison with Ritchie are reported, not judged (only an acceptance criterion you choose judges them, see below), and the analysis is 2D, per meter of slope.
- Privacy:
id_bloqueandid_taludappear only in the report tables and in the results file, never in the console, the figures or an error message. Do not put labor or mine codes infamilianames; they reach warnings.
import rockmasspy as rm
from rockmasspy.probabilistic import Distribution, run_probabilistic
# Sau Mau Ping (RocPlane verification problem 1, in kN): H 60 m, face 50, plane 35, c 100 kPa, phi 35, kh 0.08
i = rm.PlanarInput()
i.height_m, i.face_dip_deg, i.plane_dip_deg = 60, 50, 35
i.unit_weight, i.water_unit_weight, i.cohesion, i.friction_deg, i.kh = 27, 10, 100, 35, 0.08
i.water_fill = 1.0 # saturated, no tension crack
print(f"{rm.planar_fs(i).factor_of_safety:.3f}") # 0.818
crack = rm.critical_tension_crack(60, 50, 35) # dry-slope critical crack, filled to 90 %
print(f"{crack.depth_m:.4f} {crack.distance_m:.4f}") # 14.0092 15.3358
i.tension_crack_distance_m, i.water_fill = crack.distance_m, 0.9
print(f"{rm.planar_fs(i).factor_of_safety:.3f}") # 1.065
variables = {"friction_deg": Distribution("normal", 15, 70, 35, 5),
"cohesion": Distribution("normal", 0, 250, 100, 20),
"tension_crack_distance_m": Distribution("normal", 0, 35.34, 15.3, 4),
"water_fill": Distribution("exponential", 0, 1, 0.5),
"kh": Distribution("exponential", 0, 0.16, 0.08)}
r = run_probabilistic("planar", i, variables, n=5000, sampling="lhs", seed=9)
print(f"{r.pof * 100:.1f} {r.n_valid}/{r.n}") # 7.4 5000/5000
print(f"{rm.ritchie_berm_width(12).width_m:.1f}") # 6.9
The blocks come from a Bloques sheet (rm.load_blocks, one row per analysis, column modelo = planar, cuña,
volteo or berma) and the random variables from a Distribuciones sheet (rm.load_distributions: id_bloque,
variable, distribucion = normal, exponencial or uniforme, media, desviacion, minimo, maximo), both xlsx
or CSV. Each block takes the face and the mean (Fisher) orientation of the families of its slope, so Taludes keeps its
columns. rm.block_counts gives the counts and rm.save_block_results writes the 25-column results file;
report.build_slope_report(..., blocks=...) adds the block tables, and report.block_figure draws the FS histogram and
the PoF curve. From the command line (exit 0 if all is well, 1 on an input error, 2 if something asks for attention):
rockmass slope --faces Taludes.csv --families Familias.csv --blocks Bloques.csv --distributions Distribuciones.csv \
--iterations 5000 --sampling lhs --seed 9 --blocks-output bloques_resultados.csv --report taludes.html --charts fig
Options: --blocks (needs --faces and --families), --sheet-blocks, --distributions, --sheet-distributions,
--iterations (default 5000), --sampling lhs|monte-carlo (default lhs), --seed (default 1) and
--blocks-output RES.csv|.xlsx. Every option except --blocks itself needs --blocks.
See examples/09-bloques-probabilistico-berma/.
Limit equilibrium and Newmark
assess_le(...) and rockmass le compute the factor of safety of a 2D section by vertical slices: a pit slope, a
pad or a waste dump, with layers, a piezometric line and a pseudo-static seismic coefficient. Per row of an
Analisis_LE sheet:
- the methods: Ordinary (Fellenius), Bishop simplified, Janbu simplified and corrected, Spencer and Morgenstern-Price/GLE (half-sine or constant interslice function);
- the slip surface: a circular search (grid of centres with radii and local refinement), a block search along a weak layer, or a given polyline;
- the strength at each slice base: Mohr-Coulomb or non-linear Hoek-Brown (Balmer envelope, from GSI and mi or from mb, s and a);
- water by
ruor by a piezometric line (ponded water on the ground included), a tension crack with water andkh; - the yield coefficient ky (the kh that brings FS to 1) and the rigid-block Newmark displacement for an acceleration record.
Read this part twice:
- With seismic load, use Spencer or GLE. Bishop does not balance horizontal forces, so a high kh separates it from the rigorous methods (Slide2 ACADS 1(d), kh 0.15: Bishop 1.016, Spencer 0.991).
- The library never says "acceptable". Only an FS at or below 1 (1e-9 margin) and the warnings change the exit code; FS, ky and the Newmark displacement are reported, not judged; see Acceptance criteria and Sarma.
- Privacy:
id_seccion,id_analisis,material,registroand the line names appear only in the report tables (the two ids also in the results file), never in the console, the figures or a message.
import rockmasspy as rm
# Fredlund and Krahn (1977), Slide2 verification problem 21, in psf, pcf and ft: c 600, phi 20, gamma 120, dry
s = rm.LeSection()
s.surface = [rm.Point2(x, y) for x, y in [(0, 60), (60, 60), (140, 20), (180, 20)]]
m = rm.LeMaterial()
m.unit_weight, m.cohesion, m.friction_deg = 120, 600, 20
layer = rm.LeLayer()
layer.bottom, layer.material = [], 0 # a single layer: no bottom line
s.layers, s.materials = [layer], [m]
f = rm.SlipSurface()
f.circle = rm.Circle(120, 90, 80) # xc, yc, R
bishop = rm.le_factor_of_safety(s, f, rm.LeMethod.Bishop)
spencer = rm.le_factor_of_safety(s, f, rm.LeMethod.Spencer)
print(f"{bishop.factor_of_safety:.3f}") # 2.076
print(f"{spencer.factor_of_safety:.3f}") # 2.072
print(spencer.info.method_id) # Spencer
The sheets are Geometria (one row per vertex: id_seccion, linea, x_m, y_m; the line superficie is
required and piezometrica optional), Estratos (orden 1 on top, material, linea_base), Materiales_LE
(mohr_coulomb or hoek_brown), Analisis_LE (metodos separated by ;, the first one searches; superficie =
circular, bloque or dada; kh, registro) and Sismos (registro, t_s, a_g in g, constant step), as one
xlsx or one CSV per sheet. rm.le_counts gives the counts, rm.save_le_results writes one row per method (with
kh and fs_estatico, the static FS of each method on the static critical surface),
report.build_slope_report(..., le=...) adds the limit-equilibrium tables and report.le_figure /
report.newmark_figure draw the section and the Newmark record. From the command line (exit 0 if all is well, 1 on an
input error, 2 if something asks for attention):
rockmass le --geometry Geometria.csv --layers Estratos.csv --materials Materiales_LE.csv --analyses Analisis_LE.csv \
--records Sismos.csv --output equilibrio_resultados.csv --report taludes.html --charts fig
Options: --workbook LIBRO.xlsx (instead of the CSV files), --records, -o/--output RES.csv|.xlsx,
--report OUT.docx|.html, --charts DIR, --title, --author, --lang es|en and --no-figures. With more than
one analysis, rockmass le prints analysis <k> of <n>... on stderr.
Run times: with Hoek-Brown, a 20×20×11 circular search takes about 10 to 15 s; with kh, ky by rounds can repeat it up to 5 times.
See examples/10-equilibrio-limite-newmark/.
Acceptance criteria and Sarma
assess_criteria(...) and rockmass slope|le --criteria compare each block (3B) and each limit-equilibrium analysis
(3C) with an acceptance criterion chosen by you, and say per check "meets", "fails" or "not verifiable", always
with the criterion, its source, its force (law or guide) and its mark. The criteria are versioned data profiles:
READ-STACEY-2009: Read and Stacey (2009), table 9.9, minimum static FS and maximum PoF by scale (bench, inter-ramp, overall) and consequence; mark V2 (read in Moffitt 2023, which reproduces it), without the dynamic column;NDEP-2021: Nevada heap leach pads, static FS 1.30, pseudo-static 1.05 and, below 1.05, a deformation analysis;DMIRS-WA-2019: Western Australia, FS by consequence;RYAN-PRYOR-2000: catch bench reliability of 50 to 90 %;- your own table (sheet
Criterios:escala,consecuencia,fs_estatico_min,fs_seudoestatico_min,pof_max_pct,confiabilidad_berma_min_pct,fuente), read byrm.load_criteria_tableas a guide with markuser.
Each row of Bloques and Analisis_LE takes escala (banco, interrampa, global, pad, botadero) and
consecuencia; Analisis_LE also takes periodo_retorno_anios. The profile PE-DS024-2016 checks art. 264 of
the DS 024 (a pseudo-static analysis of the overall pit slope with a 100-year return period; it sets no FS).
Sarma with non-vertical slices (superficie = sarma, the base in linea_superficie and one interface angle per
interior vertex in sarma_angulos, or opt to search them) splits the mass into rigid wedges with inclined
interfaces and gives the FS and the critical acceleration Kc. It is the method for waste dumps sliding on an inclined
weak base. It reproduces Slide's Sarma verification problem 4 (1.1970 against 1.198) and, with one wedge, Hoek's planar
block. Hoek-Brown, ponded water and tension cracks are not supported.
Read this part twice:
- The library never says "approved". A "fails" asks for attention (exit code 2); a "not verifiable" is a note with its reason (no scale, no criterion for that scale, no probabilistic analysis). It never counts as "meets".
- Ranges: where a criterion is a range (PoF 25–50 % for a bench), the default policy is the conservative end (the
upper end for a minimum FS, the lower end for a maximum PoF);
range_policy=or--range-policy upper|lowerchange it, and the value used is reported. A value equal to the limit meets it. - Privacy: the ids appear only in the report tables and the results files, never in the console or a message.
import csv
import tempfile
from pathlib import Path
import rockmasspy as rm
from rockmasspy.criteria import criteria_assignments
# Slide Sarma verification, problem 4 (Hoek 1987): a dry waste pile on a sheared floor, in kN and m
ground = [(-50, -2.97), (0, 0), (111.4, 76.5), (229.545, 13.6815), (250, 14.9)]
floor = [(-50, -2.97), (0, 0), (250, 14.9)]
base = [(0, 0), (108, 6.4), (130, 73.06)] # two wedges, one interior vertex
s = rm.LeSection()
s.surface = [rm.Point2(x, y) for x, y in ground]
top, bottom = rm.LeLayer(), rm.LeLayer()
top.bottom, top.material = [rm.Point2(x, y) for x, y in floor], 0
bottom.bottom, bottom.material = [], 1
pile, sheared = rm.LeMaterial(), rm.LeMaterial()
pile.unit_weight, pile.cohesion, pile.friction_deg = 15.7, 100, 42
sheared.unit_weight, sheared.cohesion, sheared.friction_deg = 15.7, 10, 6
s.layers, s.materials = [top, bottom], [pile, sheared]
i = rm.SarmaInput()
i.base, i.interface_angles_deg = [rm.Point2(x, y) for x, y in base], [116.5] # from +x, counter-clockwise
r = rm.sarma_fs(s, i)
print(f"{r.factor_of_safety:.3f} {r.critical_acceleration:.4f}") # 1.197 0.0540
# The same section from sheets, judged (for illustration) as a heap leach pad against NDEP (2021)
d = Path(tempfile.mkdtemp())
def sheet(name, cols, rows):
with open(d / f"{name}.csv", "w", newline="", encoding="utf-8") as fh:
w = csv.DictWriter(fh, cols, restval="")
w.writeheader()
w.writerows(rows)
return d / f"{name}.csv"
src = {"Geometria": sheet("Geometria", rm.GEOMETRY_COLUMNS, [
dict(id_seccion="S", linea=n, x_m=x, y_m=y)
for n, pts in (("superficie", ground), ("piso", floor), ("falla", base)) for x, y in pts]),
"Estratos": sheet("Estratos", rm.LAYER_COLUMNS, [dict(id_seccion="S", orden=1, material="pila", linea_base="piso"),
dict(id_seccion="S", orden=2, material="piso")]),
"Materiales_LE": sheet("Materiales_LE", rm.MATERIAL_COLUMNS, [
dict(material="pila", modelo="mohr_coulomb", peso_unitario_kn_m3=15.7, cohesion_kpa=100, friccion_grados=42),
dict(material="piso", modelo="mohr_coulomb", peso_unitario_kn_m3=15.7, cohesion_kpa=10, friccion_grados=6)]),
"Analisis_LE": sheet("Analisis_LE", rm.ANALYSIS_COLUMNS, [
dict(id_analisis="A", id_seccion="S", superficie="sarma", linea_superficie="falla", sarma_angulos="116.5",
base_modelo_m=-10, escala="pad", consecuencia="media")])}
le = rm.assess_le(src)
checks = rm.assess_criteria(rm.get_profile("NDEP-2021"), le=le, assignments=criteria_assignments(le=le))
print(f"{le[0].sarma.factor_of_safety:.3f}") # 1.197
print(rm.criteria_counts(checks)) # {'checks': 3, 'meets': 0, 'fails': 1, 'not_verifiable': 2}
print([(c.item_id, c.status) for c in checks][0]) # ('NDEP-6-estatico', 'fails')
print(checks[1].reason) # no pseudo-static analysis
rm.save_criteria_results writes one row per check (sheet Criterios_resultados), and
report.build_slope_report(..., criteria=..., criteria_profile=..., profile_checks=...) builds the full slope report:
executive summary, scope and criteria, kinematics, blocks, limit equilibrium and Sarma, criteria checks, regulation
(art. 264), warnings and methods. From the command line:
rockmass le --geometry Geometria.csv --layers Estratos.csv --materials Materiales_LE.csv --analyses Analisis_LE.csv \
--records Sismos.csv --criteria READ-STACEY-2009 --profile PE-DS024-2016 --criteria-output criterios.csv
rockmass slope --faces Taludes.csv --families Familias.csv --blocks Bloques.csv --criteria Criterios.csv
Options: --criteria ID|CRITERIOS.csv|.xlsx, --criteria-output RES.csv|.xlsx, --range-policy conservative|upper|lower (both need --criteria) and, in rockmass le, --profile PE-DS024-2016. The summary prints
meets: a, fails: b, not verifiable: c and the fails grouped by rule, without ids.
See examples/11-criterios-sarma/.
Mine history: ingest audit and site correlations
Needs the extra pip install "rockmasspy[ml]" (numpy and scipy) for the correlations; reading and auditing the
history need only the base package (Excel needs [io]). rm.load_history reads the history template
(plantillas/Plantilla_historico_geomecanico.xlsx: sheets Tramos, Tipos_sostenimiento and Desempeno), and
rm.audit_history recomputes Q and the basic RMR89, flags non-independent records and cross-sheet inconsistencies,
and counts how far each predictive level is from its minimum (a design decision, not a published value).
import rockmasspy as rm
from rockmasspy.predictive import fit_site_correlation, save_site_correlations
h = rm.load_history("historico.xlsx")
audit = rm.audit_history(h)
fit = fit_site_correlation(h, "rmr_from_q", group_by="litologia")
print(fit.mine.status, fit.mine.a, fit.mine.b) # "site", "unstable" or "not_calibrated"
save_site_correlations(fit, "results/") # CSV with every fit, JSON with the "site" ones only
Level 1 fits rmr_from_q, gsi_from_rmr and gsi_from_q_prime per domain and for the whole mine: OLS with a
prediction interval, Deming only when you give the error-variance ratio, a bootstrap that resamples whole
excavations, and a conjugate Bayesian fit centred on the published global correlation, so few data stay close to it.
to_custom_correlation() turns a fit into a CustomCorrelation for your per-labor tables. From the command line:
rockmass history historico.xlsx --correlations --output results/ --report historico.docx
The CLI and the report print counts and codes (domains as D1, D2…), never the excavation, zone, coordinates or
lithology, and never the input file name. Result files do carry id_tramo and the domain: keep them in the mine's
protected folder, like the history. See examples/12-historico-prediccion/.
Practice audit (level 2) and failure model with recommendation (level 3)
from rockmasspy.predictive import audit_practice, fit_performance, recommend, save_model
practice = audit_practice(h) # ordinal logit of the installed type: describes, never recommends
model = fit_performance(h) # "site", "partial" or "not_calibrated"
recs = recommend(model, new_tramos, threshold=0.10, exposure_days=365, practice=practice)
save_model(model, "model.json") # coefficients, ranges and counts; never rows or ids
- Level 2 fits a cumulative logit of the installed support type on ln Q, ln De (span/ESR), service life and
excavation type. It says whether the practice is coherent with rock quality and span, whether it is more
predictable than the NGI Q chart, and which tramos have an installed type outside their 90 % conformal set
(≈ 10 % by construction: it is not a detector of deviations). A consistency indicator, 1 − tanh(w/4) with w the
mean width of the inner logit bands, flags a
practice poorly consistentpractice above 0.66. - Level 3 models the failure rate with a constant hazard and a gamma frailty per excavation (exposure as offset), with sign constraints (worse rock or a larger span never lowers the risk; more support never raises it) and a zone-clustered robust covariance. P(failure within H days) for a new excavation is 1 − (1 + θλH)^(−1/θ).
- Validation is grouped by excavation, leave-one-zone-out and temporal, against a constant-rate dummy and the
NGI-category baseline, with a bootstrap over excavations. The model is
siteonly if the excavation and zone partitions beat both references (95 % CI of the Poisson-deviance gain above zero, no failed folds) and the temporal one is not worse. - Form: additive in quality and support rank, or with the interaction (quality − max)·(rank − max) bounded ≥ 0 (risk stays monotone in both). The interaction enters only with 10 events per parameter counting it and a lower out-of-fold Poisson deviance (folds by excavation, another seed than the validation); if it ends at its bound, the additive form comes back.
- Recommendation: the lightest eligible type whose upper bound, 1 − exp(−λ_up·H·Z_q), stays under the
threshold. λ_up adds the frailty quantile with upper θ and a new zone: σ_z² = C·Var(η at the mean) with the
zone-clustered covariance, taken at its one-sided χ² upper bound σ̂_z·sqrt((C − 1)/χ²₁₋ᵤ(C − 1)), u = 0.5 + level/2
(
PerformanceModel.zone_sd_upper; ×1.80 with 8 zones and ×2.37 with 5 at level 0.9). With fewer than 10 zonesfit_performancewarns. The threshold and the horizon are set by the engineer: there are no defaults. - Nothing is chosen when the model is not
site, the tramo extrapolates, the support effect is not identified, or a sign constraint on rock quality or span is active, and also when (gates, design decisions): (a) the tramo is in the worst third of quality and the out-of-fold observed/expected there exceeds 1.2 or has fewer than 10 failures; (b) a type has fewer than 10 training tramos in the tramo's Q class (Barton et al. 1974; RMR classes of Bieniawski 1989 withquality="rmr") — such a type is not eligible; (d) the tramo's excavation type had fewer than 10 failures in training. (c) When no type meets the threshold it says so (no support type meets the threshold), and so it does when the types that meet it are not eligible. The options are always shown, with the reason.
rockmass history historico.xlsx --practice --performance --model-output model.json --output results/ \
--threshold 0.10 --exposure-days 365 --report historico.docx
rockmass recommend new_tramos.xlsx --model model.json --threshold 0.10 --exposure-days 365 \
--practice-from historico.xlsx --output recommendations.csv
recommend prints each tramo by position; recommendations.csv carries id_tramo and two empty columns,
decision_ingeniero and motivo, where the engineer records what was decided. The minimum data per level were
checked by simulation (docs/investigacion/SIMULACION_MINIMOS.md in the repository). The library recommends, the
engineer decides.
Synthetic mine and test bench
synthetic_mine builds a synthetic mine calibrated with the literature to test the predictive module end to end
against a known truth. It is a test bench: it never trains a model that is shipped, gives no priors or default
coefficients and never replaces a mine's own history.
from rockmasspy.predictive import SCENARIOS, synthetic_mine
h, truth = synthetic_mine("base", seed=0) # History (Tramos, Tipos_sostenimiento, Desempeno) and MineTruth
h_bad, truth_bad = synthetic_mine("base", seed=0, defects=True) # same mine plus injected data defects
truth.rmr_lnq_slope # the RMR–ln Q line of the mine (it emerges; it is not fixed)
truth.p_fail("T0001", "III", 365) # true P(failure within 365 days) with type III, new excavation
- Mechanism: the true rock mass comes from geology (quality per lithology and zone, an AR(1) process along each
excavation plus nugget, Poisson fault zones); joint parameters come from that quality and Q, RMR89 and GSI are
computed with the library, so the RMR–ln Q relation and its scatter emerge. Each excavation is mapped by a
geologist with bias and noise; the mine installs support from its own GSI table with deviations, a table change
and unsupported hours; failure is a constant hazard with gamma frailty driven by the deficit against the Q chart
read with Q·exp(−δ) (δ = 0.5 in
base, a site somewhat worse than NGI).failure_mechanism="saturating"is an alternative without chart or deficit, so the module is not tuned to one recipe. - Truth:
MineTruth.tramoskeeps the true values, geologist, installed and table types, frailty and, for each tramo, the true rate of every support type (with the unsupported hours that type would have had);p_fail(id, type, H)is closed form, marginal over the frailty of a new excavation in the same zone (conditional=Truefor the tramo's own excavation).truth.defectslists the injected defects. - Scenarios (
SCENARIOS):base(≈ 800 tramos, 5 zones),ngi_site(the site equals the NGI chart),worse_site,better_site,shifted_correlation,conservative_practice,incoherent_practice,mine_practice,noisy_mapping,small_mine(≈ 80 tramos),large_mine(≈ 4800 tramos, 8 zones),saturating_largeandsaturating_worse(the alternative mechanism). AMineScenariocan be built or changed withdataclasses.replace.
Bench results (docs/investigacion/BANCO_MINA_SINTETICA.md in the repository; 50 seeds per scenario, 20 in the
large ones; recommendation applied to a second mine of the same scenario, with zones and excavations the fit did
not see; threshold 0.10, H = 365 days):
| Scenario | Chooses | Too light, pooled | Too light per mine, p90 / max | Overcost vs true optimum (median) |
|---|---|---|---|---|
large_mine |
30.8 % | 0.7 % | 0.5 % / 4.6 % | +261 % |
saturating_large |
41.8 % | 0.5 % | 1.3 % / 2.6 % | +146 % |
shifted_correlation |
1.8 % | 1.1 % | 1.9 % / 3.2 % | +220 % |
incoherent_practice |
1.9 % | 0.2 % | 0.1 % / 0.3 % | +431 % |
base |
0.3 % | 0.0 % | 0.0 % / 0.0 % | +201 % |
worse_site, ngi_site, better_site, conservative_practice, small_mine |
0 | — | — | — |
Before the 5B corrections, large_mine chose in 60.7 % with 5.0 % too light and worse_site reached 23.4 %. Now
the per-mine p90 stays at or under 3.7 % in every cell with ln Q. Safety was bought with support and fewer
choices: with few zones σ_z is poorly known and its upper bound covers it with more support, not with more
information. Where the model chooses it is much safer than the Q chart alone in the same tramos.
Module changes from the bench (Phase 5B):
- Level 2: the consistency indicator above (cut 0.66); the ordinal logit converges with large n (mean gradient criterion).
- Audit:
missing_values, one finding per column with empty cells (counts only, noid_tramo); the Q rule is |Q recorded − Q recomputed| > max(0.005, 1 % of Q) or a ratio over 2 (Q_MAX_RATIO), and Q recorded ≤ 0 is always a finding. - Level 1:
gsi_from_rmrwarns that GSI and RMR share joint condition and RQD (correlated mapping errors). - Level 3: the interaction form, the χ² upper bound of σ_z, the gates (a)–(d) and the warning with fewer than 10
zones (above). The model JSON goes to schema 4 (
zone_sd,poor_rock,class_counts,labor_type_failures); an older schema is rejected with a hint to refit withrockmass history --performance --model-output.
See examples/13-mina-sintetica/: one mine through the audit and levels 1–3, measured against its truth.
Methods
Every result carries info.method_id and a verification mark: Primary (verified in the original source, or a
faithful reproduction of its equations by a cited author), PrimaryLaterAuthors (verified in a later publication by
the same authors) or Secondary (checked against a secondary source only). UserDefined means calibrated by the user on site data.
| method_id | Method | Verification |
|---|---|---|
| RQD-Deere | RQD from core | Secondary |
| RQD-PH1976 | RQD from discontinuity frequency (Priest & Hudson) | Primary |
| RQD-P1982 | RQD from Jv (Palmstrom 1982) | Primary |
| RQD-P2005 | RQD from Jv (Palmstrom 2005) | Secondary |
| RMR76 | Bieniawski 1976 | Secondary |
| RMR89 | Bieniawski 1989 | Secondary |
| RMR14 | Celada et al. 2014 | Secondary |
| Q-NGI-2015 / Q-NGI-2025 | Q system, NGI editions (2025 is the default) | Primary |
| Q-NGI-2025-chart / Q-NGI-2015-chart | Q support chart regions, digitized by RockMassPy (max. measured error 0.017 / 0.008 decade, including junctions) | Primary |
| Q-Barton1980 | Maximum unsupported span and bolt length formulas (Hoek, after Barton et al. 1980) | Secondary |
| Q-GrimstadBarton1993 | Roof support pressure (Hoek, after Grimstad & Barton 1993); the unit is still to be confirmed | Secondary |
| Mathews-Potvin1988 | Modified stability number N' (factors A, B, C), hydraulic radius and the stability graph, digitized by RockMassPy (max. measured error 0.014 grid cell; factor A fit 0.019, sliding C 0.044, B curves 0.007) | Primary |
| MRMR-Laubscher1990 / Laubscher1994-stability | MRMR (Laubscher 1990) and its caving diagram (1994, max. measured error 0.009 grid cell) | Primary |
| SMR-Romana1985 / SMR-Tomas2007 | SMR of Romana (discrete) and Tomas (continuous, revision 2017) for planar and toppling failure | PrimaryLaterAuthors |
| SMR-Romana1985-wedge | Discrete SMR for wedges (Anbalagan 1992 adaptation, as described by Tomas) | Secondary |
| Q-slope-BarBarton2017 | Q-slope and the angle beta (Bar and Barton 2017, 2018) | PrimaryLaterAuthors |
| Kinematic-PlanarSliding / -WedgeSliding / -FlexuralToppling-Goodman1980 / -DirectToppling-HudsonHarrison1997 | Markland kinematic tests (criteria of the Dips documentation) | Secondary |
| Fisher1953-set-statistics | Fisher statistics of a discontinuity set (after Tauxe et al.) | Secondary |
| GSI-2013 | Quantified GSI (Hoek, Carter & Diederichs) | Primary |
| HB-2002 / HB-2018 | Hoek-Brown criterion parameters (hb_params) and equivalent Mohr-Coulomb (hb_mohr_coulomb); 2018 is the default |
Primary |
| HB-2002 | Rock mass modulus Em (em_hoek2002) |
Secondary |
| HD-2006 | Rock mass modulus (Hoek & Diederichs) | Primary |
Correlations (enum name, e.g. RmrFromQ_Bieniawski1976) |
Global correlations, never chained | Primary or Secondary, see rm.correlate(...).info |
Out of phase 1A: TBM Fe, Q 1974, GSI equation 3, mi/MR tables.
Python notes
Some C++ names are reserved words in Python, so they get a trailing underscore:
Infilling.None_(no infilling), as inJointCondition89(..., rm.Infilling.None_, ...).CorrelationResult.from_andCustomCorrelation.from_(thefrom_argument of its constructor).
Results print readably (QResult(q=4.5, ...)) and the package ships type stubs (py.typed).
How to cite
If RockMassPy helps your work, please cite it. GitHub shows a "Cite this repository" button built from CITATION.cff:
Quintanilla Ventura, M. (2026). RockMassPy: rock mass classifications, Hoek-Brown strength and mining geomechanics (version 0.2.0) [Computer software]. https://github.com/Miqueas7/RockMassPy
Each result also records the method and edition it follows (result.info); cite that original source as well.
License: MIT.
RockMassPy
Librería open source de ingeniería de macizo rocoso para minería: clasificaciones (RQD, RMR, Q, GSI, MRMR, Q-slope, SMR), resistencia de Hoek-Brown, tablas personalizables por labor, gráficos, recomendación de sostenimiento, perfiles normativos por país, análisis de taludes en roca (cinemática, estereografía, bloques y equilibrio límite), incertidumbre en las clasificaciones y predicción de sostenimiento con datos históricos. Núcleo en C++20 con API en Python.
Documentación: https://miqueas.dev/rockmasspy (guía, métodos, casos resueltos y referencia de la API, en español e inglés). Los cambios de cada versión están en CHANGELOG.md (en inglés).
Estado: versión 0.2.0 (fases 1 a 5: núcleo y tablas por labor, sostenimiento y perfil de Perú, tajo abierto, módulo predictivo, mina sintética y banco de pruebas; fase 7: incertidumbre en las clasificaciones). La librería recomienda, el ingeniero decide.
Instalación
pip install rockmasspy
Hay ruedas ya compiladas para Python 3.10 a 3.14 en Linux (x86_64), Windows y macOS (Apple Silicon), así que no hace falta compilador ni CMake. La instalación base no trae dependencias de Python: el cálculo vive en el núcleo compilado.
Los extras opcionales agregan lo que no es cálculo puro:
| Extra | Agrega | Para |
|---|---|---|
io |
pyyaml, openpyxl |
Tablas en YAML y Excel; tramos, caras de tajeo, taludes y la plantilla del histórico en Excel |
viz |
matplotlib |
Carta Q, gráficos de estabilidad, estereogramas, cartillas, perfiles y mapas |
report |
python-docx |
Informe Word (el informe HTML no necesita nada extra) |
ml |
numpy, scipy |
Módulo predictivo |
pip install "rockmasspy[io,viz,report,ml]"
En otras plataformas (Linux ARM, Mac con Intel) pip compila el núcleo C++ desde la distribución de código fuente, y
para eso hace falta un compilador de C++20.
Ejemplo mínimo
import rockmasspy as rm
q = rm.q_value(rm.QInput(65, 9, 1.5, 2, 1, 1)) # rqd, Jn, Jr, Ja, Jw, SRF
print(q.q, q.info.method_id) # 5.4167 Q-NGI-2025
gsi = rm.gsi_from_jcond89_rqd(18, 65).gsi # 59.5
p = rm.hb_params(gsi, 25, 0) # mi = 25, D = 0, HB-2018
scm = rm.hb_global_strength(90.0, p)
s3 = rm.hb_sigma3max(scm, 0.027, 400, rm.HbApplication.Tunnel) # MN/m3, profundidad en m
mc = rm.hb_mohr_coulomb(90.0, p, s3)
print(mc.phi_deg, mc.cohesion_mpa) # 52.75 2.633
El recorrido completo con datos sintéticos está en examples/01-tramo-sintetico/.
Tablas de sostenimiento por labor
Cada tipo de labor (galería, tajeo...) tiene su propia tabla: un catálogo de sostenimientos más clases RMR/Q/GSI o celdas de la cartilla GSI.
Las tablas validan (avisan, nunca bloquean), clasifican y van y vienen por JSON, YAML y Excel. YAML y Excel necesitan el extra opcional: pip install "rockmasspy[io]".
import rockmasspy as rm
cat = rm.SupportCatalog([rm.SupportType("I", 1), rm.SupportType("II", 2, bolt=rm.Bolt("split-set", 1.8, 1.5))])
clases = [(80, "I", "I"), (60, "II", "I"), (40, "III", "II"), (20, "IV", "II"), (0, "V", "II")]
table = rm.RangeTable("RMR", "RMR89", [rm.RangeClass(lo, lo + 20, rotulo, tipo) for lo, rotulo, tipo in clases])
labor = rm.LaborTable("galería", cat, table, span_m=(3, 4))
print(labor.validate()) # []
c = labor.classify(53)
print(c.label, c.support.code) # III II
print(labor.classify(40).label) # IV
Un valor justo en el límite de dos clases (RMR 40) toma la clase peor. La librería recomienda, el ingeniero decide.
Ver examples/02-tabla-por-labor/.
RatingTable (puntajes propios por parámetro, RMR89 por defecto) ya está disponible en Python y se guarda con la tabla por labor
(LaborTable.rating) en JSON, YAML, Excel y CSV (save_csv_dir / load_csv_dir).
El CSV es una carpeta con un archivo por hoja (UTF-8 con BOM). save_csv_dir(t, ruta) escribe en el formato numérico del
computador (en Windows el que usa Excel, en otros sistemas la configuración regional), así un colega en España o EE. UU.
lo abre bien en su Excel; pasa separator= ("," o ";") y/o decimal= ("." o ",") para forzar uno. load_csv_dir lee los dos, reconoce los nombres de archivo sin importar mayúsculas (TABLA.CSV
es Tabla) y acepta también la fecha como d/m/aaaa (día primero).
Gráficos
Necesitan el extra opcional pip install "rockmasspy[viz]" (matplotlib 3.8 o superior). Sin él, import rockmasspy
sigue funcionando y cualquier llamada a rockmasspy.viz lanza un ImportError que nombra el extra. Las figuras son
Figure de matplotlib sin estado global (no se abren ventanas).
import rockmasspy.viz as viz
estilo = viz.Style(lang="es", size="cartilla", brand="Mi empresa") # lang "es" (por defecto) o "en"; size "cartilla", "A4" o "A3"
fig = viz.plot_cartilla(labor, style=estilo) # `labor` viene del bloque anterior
ruta = viz.save_figure(fig, "figs/cartilla.png") # crea la carpeta; png, svg o pdf
print(ruta.name) # cartilla.png
p = rm.hb_params(45, 10, 0) # HbParams no guarda GSI, mi ni D...
env = viz.plot_hb_envelopes(50.0, p, sigma3max_mpa=1.35, gsi=45, mi=10, d=0) # ...así que pásalos para el pie
El mismo módulo dibuja la carta GSI cuantificada, las envolventes Hoek-Brown, la dispersión Q–RMR y los histogramas por
clase; cada figura dice su fuente en el pie. La librería recomienda, el ingeniero decide. Ver examples/03-cartillas/.
Tramos, lote, informe y CLI
Necesita los extras pip install "rockmasspy[io,viz,report]" (el informe HTML solo pide el paquete base; el Word pide
[report] y las figuras [viz]). load_tramos lee una hoja Tramos (Excel o CSV) y acepta un column_map de tus
nombres de columna a los de la plantilla. La clasificación nunca se detiene por una fila: un tramo sin tabla para su
labor o su luz, o sin el valor del método, queda sin clasificar (label=None) con un aviso, y el resumen lo cuenta
aparte. Ni la librería ni la CLI imprimen filas de tramos.
from pathlib import Path
import rockmasspy as rm
import rockmasspy.report as rp
Path("tramos.csv").write_text("id_tramo,Labor,luz_m,RMR\nT01,galería,3.5,53\n", encoding="utf-8") # una hoja de una fila
tramos = rm.load_tramos("tramos.csv", column_map={"RMR": "rmr_valor", "Labor": "tipo_labor"}) # CSV: la hoja es el nombre del archivo
resultados = rm.classify_tramos(tramos, [labor]) # `labor` viene de la sección de tablas
resumen = rm.summarize(resultados)
rm.save_results(resultados, "resultados.csv") # o .xlsx (pide [io])
informe = rp.build_memoria(resultados, [labor], title="Memoria de cálculo", lang="es")
rp.write_html(informe, "informe.html") # rp.write_docx(informe, "informe.docx") pide [report]
print(resumen.total, resumen.classified) # 1 1
Todo informe dice lo que es: «La librería recomienda, el ingeniero decide. Este documento no reemplaza el estudio
geomecánico firmado.» en la portada y en el pie de cada página, más la edición y la marca de verificación de cada
método y la versión de RockMassPy. rp.build_anexo39b da la estructura del Anexo 39 B del DS 024.
El mismo flujo desde la línea de comandos (código de salida 0 bien, 1 error de entrada o de uso, 2 terminó pero hay algo que revisar):
rockmass check galeria.json
rockmass cartilla galeria.json -o cartilla.png
rockmass classify tramos.xlsx --tables galeria.json -o resultados.csv
rockmass report tramos.xlsx --tables galeria.json -o informe.docx --template anexo39b --labor galería
Ver examples/04-informe/.
Incertidumbre y bordes de clase
classification_uncertainty muestrea las entradas de RMR89, Q, GSI o Hoek-Brown (Monte Carlo o LHS, con semilla) y
entrega media, desviación, p05, p50, p95, mínimo y máximo de cada salida, más la probabilidad de cada clase y de cada
sostenimiento de la tabla de la labor. Informa y nada más: no cambia ninguna regla de atención ni el código de salida.
Las distribuciones las eliges tú; la librería solo propaga lo que le das. Una muestra que el núcleo rechaza es un
error que nombra la variable.
import rockmasspy as rm
from rockmasspy import probabilistic as pb
base = rm.Rmr89Input()
base.functions = rm.RmrFunctions.Continuous # curvas de Kundu et al. (2020) en lugar de los puntajes de la tabla
base.ucs_mpa, base.rqd_pct, base.spacing_m = 90.0, 70.0, 0.3
base.joint_condition_rating, base.water = 20.0, rm.Water.Dry
table = rm.LaborTable("gallery", rm.SupportCatalog([rm.SupportType("I", 1), rm.SupportType("II", 2)]),
rm.RangeTable("RMR", "RMR89", [rm.RangeClass(0, 68, "fair", "II"), rm.RangeClass(68, 100, "good", "I")]))
u = rm.classification_uncertainty("RMR89", base, {"ucs_mpa": pb.normal(90, 15, 50, 130), "rqd_pct": pb.uniform(55, 85)},
table=table, n=2000, seed=1)
print(round(u.outputs["rmr"].mean, 1), u.class_probabilities) # 67.4 {'fair': 0.5995, 'good': 0.4005}
RmrFunctions.Continuous usa funciones continuas ajustadas a las gráficas de Bieniawski (1989) (Kundu et al., 2020;
método RMR89-continuous), así que un cambio pequeño de UCS, RQD o espaciamiento mueve el puntaje sin saltos. La
clasificación con una tabla por rangos avisa near the boundary between classes {a} and {b} cuando el valor está a
3 puntos o menos del borde (RMR, GSI) o dentro de un factor 1.25 (Q); estos dos márgenes son provisionales. En el lote,
una hoja Distribuciones por id_tramo agrega clase_probable, prob_clase_probable, prob_clase,
probabilidades y n_validas a los resultados (rockmass classify ... --distributions ARCHIVO, también en report).
Ver examples/14-incertidumbre-clasificacion/.
Carta de sostenimiento Q (referencia)
Digitalizada de la carta de sostenimiento del sistema Q de NGI (2025, Fig. 4-1; edición 2015, Fig. 7), con la tabla de ESR,
la dimensión equivalente De = luz / ESR y tres fórmulas clásicas marcadas Secondary. Es una referencia junto a tus tablas
propias, nunca un reemplazo. El ESR es una decisión de seguridad: esr_category es obligatorio y las categorías con rango (A, B) piden también esr.
from rockmasspy.q_support import recommend_q_support
r = recommend_q_support(4.5, 15.0, esr_category="C") # cámara pública de Hoek: Q 4.5, luz 15 m
print(r.roof.category) # 3
print(f"{r.roof.de_m:.3f}") # 9.375
print(r.roof.no_empirical_data) # False
w = recommend_q_support(0.4, 4.5, esr_category="C", edition="Q-NGI-2015", wall_height_m=4.5)
print(w.wall_q) # 1.0
Hoek publica la categoría 4 para esta cámara, leída en una carta anterior (1993); las cartas digitalizadas 2025 y 2015 dan 3.
La longitud de perno de la carta (columnas q_carta_longitud_*) está dada para ESR = 1; con otro ESR, compárala con la fórmula de Barton et al. (1980) y con tu criterio.
Los puntos en las zonas a trazos de la carta (sin datos empíricos) siguen sus líneas y llevan no_empirical_data y un aviso.
En el lote, rm.add_q_chart_reference(resultados, {"*": "C"}) agrega la lectura del techo con el Q propio del tramo, y el
informe suma la sección 5.1; viz.plot_q_chart dibuja la carta con los tramos (sin rótulos). Desde la línea de comandos:
rockmass qsupport --q 4.5 --span 15 --esr-category C --chart punto.png # código 2 con un aviso o categoría 7 o mayor
rockmass classify tramos.xlsx --tables galeria.json --esr "*=C" -o resultados.csv
Ver examples/05-sostenimiento-q/.
Estabilidad de tajeos (Mathews) y MRMR
Número de estabilidad modificado de Mathews según Potvin (1988): N' = Q' x A x B x C, con el radio hidráulico de cada
cara del tajeo (hydraulic_radius, hydraulic_radius_rect) y las zonas estable, transición y hundimiento del
gráfico de Potvin, digitalizado por RockMassPy. No hay curva logit: Mawdesley no publica los coeficientes. El factor C
sigue la ecuación del propio Potvin (8 - 6 cos a); el 8 - 7 cos de Mathews et al. (1980) es del método original. El
MRMR es el de Laubscher (1990) y sus zonas se leen en el diagrama de 1994. Todo es Primary; un punto fuera del
marco se lee del lado desfavorable, con aviso.
import rockmasspy as rm
# N' = Q' * A * B * C de un techo sintético (Q' 12, HR 2.5 m), leído en el gráfico de Potvin
r = rm.mathews_stability(12.0, 2.5, ucs_mpa=120, sigma1_mpa=30, dip_difference_deg=60,
failure_mode="gravity", surface_inclination_deg=0)
print(f"{r.factor_a:.3f} {r.factor_b:.1f} {r.factor_c:.1f}") # 0.325 0.8 2.0
print(f"{r.n_prime:.2f}") # 6.24
print(r.reading.zone_label) # stable
# MRMR (Laubscher 1990) de un caso sintético, ubicado en el diagrama de 1994 con HR = 30 m
i = rm.Mrmr90Input()
i.irs_mpa, i.rqd_pct, i.spacings_m, i.joint_condition = 100, 75, [0.5, 1.0, 3.0], 10.8
m = rm.mrmr90(i)
print(m.mrmr_class) # 3B
print(rm.read_stability_graph("Laubscher1994-stability", 30.0, m.mrmr).zone_label) # caving
Las caras salen de una hoja Superficies (xlsx) o de un CSV (rm.SURFACE_COLUMNS): rm.load_stope_surfaces,
rm.assess_stope_surfaces, rm.save_stope_results, viz.plot_stability_graph y report.build_stope_report. Una cara
con geometría imposible detiene la corrida y nombra su fila. Por la línea de comandos:
rockmass mathews Superficies.csv --chart mathews.png -o resultados.csv # sale con 2 si hay una cara en transición, hundida o con aviso
rockmass mrmr --irs 100 --rqd 75 --spacing 0.5 1.0 3.0 --jc 10.8 --hr 30 --chart laubscher.png
Ve examples/06-tajeos-mathews-mrmr/.
Verificación normativa (Perú, DS 024-2016-EM)
rockmass verify y verify(...) comparan tus datos (tablas por labor, tramos, caras de tajeo y un juego de hojas de
diseño) con los requisitos de un perfil normativo: un archivo JSON en python/rockmasspy/profiles/. El primero es
PE-DS024-2016: el reglamento de seguridad minera del Perú (DS 024-2016-EM, con el DS 023-2017-EM y el DS
034-2023-EM) y la guía de criterios geomecánicos de Osinergmin (2017). Cada requisito lleva su instrumento, artículo,
página, URL y fuerza: ley (el reglamento) o guía (una recomendación, que nunca sale «no cumple»). Un texto
que no regía en la fecha de --as-of sale como no verificable y dice desde cuándo rige el texto cargado.
Seis estados: cumple, no cumple, atención, nota, no revisado (no diste datos para él) y no verificable por la librería (es de procedimiento, o no hay regla). Lee esto dos veces:
- «No verificable por la librería» no es un incumplimiento. Significa que la librería no puede juzgarlo (un estudio firmado, la publicación en la labor, la inspección trimestral); lo revisa el ingeniero.
- La librería nunca dice «aprobado». Un «cumple» solo significa que los números declarados cumplen el límite numérico que pudo revisar; el estudio firmado y el criterio del ingeniero siguen en pie.
- Código de salida 0 si nada falla, 1 si hay un error de entrada, 2 si algo no cumple o pide atención. Las notas, los ítems no revisados y los no verificables no cambian el código.
import rockmasspy as rm
from rockmasspy.design_inputs import DesignInputs, RefugeStation
from rockmasspy.verify import verify
# una estación de refugio inventada: RMR 55 sin sostenimiento declarado, a 400 m del frente, 30 m2 para 20 personas
st = RefugeStation("E1", "roca", rmr=55, distancia_frente_m=400, area_m2=30, aforo=20)
v = verify(rm.get_profile("PE-DS024-2016"), as_of="2026-11-02", design=DesignInputs(refuge_stations=(st,)))
print("PE-DS024-2016" in rm.available_profiles()) # True
print(v.counts()) # {'complies': 2, 'does_not_comply': 1, 'attention': 0, 'note': 0, 'not_checked': 12, 'not_verifiable': 9}
print(v.exit_code) # 2
Las hojas de diseño son Estaciones_refugio, Refugios_peatonales, Resumen_QC, Factores_seguridad y Autosoporte
(un libro xlsx, o un CSV por hoja con ese nombre; todas son opcionales). Los identificadores de fila nunca llegan a la
consola ni al informe. Por la línea de comandos:
rockmass verify --profile PE-DS024-2016 --as-of 2026-11-02 --tables galeria.json --tramos Tramos.csv \
--surfaces Superficies.csv --design Estaciones_refugio.csv Resumen_QC.csv --report verificacion.html
Ve examples/07-verificacion-normativa-peru/.
Cinemática de taludes, SMR y Q-slope
Para la cara de un talud de tajo abierto y sus familias de discontinuidades, rockmass slope y assess_slopes(...)
devuelven:
- la estadística de Fisher de cada familia (orientación media, kappa, alfa95) y la densidad de polos;
- las pruebas cinemáticas de Markland: deslizamiento planar, por cuña (zonas primaria y secundaria), volteo flexural y volteo directo (el volteo oblicuo se cuenta aparte), cada una con su conteo y su porcentaje;
- el SMR (Romana, discreto; Tomás, continuo) por familia, por cuña y por plano sin familia, con el caso que gobierna y su clase;
- el Q-slope de Bar y Barton y el ángulo beta, comparado con el buzamiento de la cara.
Lee esto dos veces:
- Los porcentajes son factibilidad, no probabilidad. Son la parte de los polos (planar, flexural) o de las intersecciones (cuña, volteo directo) que cae en la zona crítica. No son una probabilidad de falla.
- El límite lateral (30 grados por defecto,
--lateral-limit) deja el deslizamiento planar y los dos volteos para las discontinuidades que rumbean cerca de la cara. La cuña no lleva límite lateral. También se informa el planar sin límites; el código de salida usa el que tiene límites. - Una cara más empinada que beta (
face_steeper_than_beta) quiere decir que la cara es más empinada que el ángulo que Q-slope permite sin refuerzo ni soporte: pide atención. Una cara igual a beta también se señala. - La figura de cuña cuenta las intersecciones primarias más las secundarias. El SMR continuo (
smr_caso_continuo) tiene su propio caso que gobierna, aparte del discreto. - Los nombres de
familiallegan a la consola dentro de los avisos: no pongas en ellos códigos de labor ni de mina.id_taludeid_tramovan solo al archivo de resultados y a las tablas del informe, nunca a la consola ni a las figuras.
import rockmasspy as rm
# un caso planar inventado (Tomás et al. 2006, p. 93): cara 22/180, junta 21/209, RMR básico 60, voladura normal
a = rm.smr_angles(rm.SmrMode.Planar, 209, 21, rm.PlaneOrientation(180, 22))
print(f"{a.a_deg:.0f} {a.b_deg:.0f} {a.c_deg:.0f}") # 29 21 -1
d = rm.smr(60, rm.SmrMode.Planar, rm.SmrFunctions.Discrete, rm.SlopeExcavation.NormalBlastingOrMechanical, a)
c = rm.smr(60, rm.SmrMode.Planar, rm.SmrFunctions.Continuous, rm.SlopeExcavation.NormalBlastingOrMechanical, a)
print(f"{d.smr:.0f} {d.smr_class} {c.smr:.1f} {c.smr_class}") # 52 3 55.7 3
# Q-slope 0.6 (Bar y Barton 2018, Tabla 12): el ángulo más empinado sin refuerzo
print(f"{rm.q_slope_beta(0.6):.2f}") # 60.56
Las caras salen de una hoja Taludes y los planos de una hoja Familias (xlsx, o CSV): rm.load_slope_faces,
rm.load_families, rm.assess_slopes, rm.slope_counts, rm.save_slope_results (26 columnas) y
report.build_slope_report. report.slope_modes y report.slope_figure son los ayudantes que usa la línea de
comandos para los estereogramas. Por la línea de comandos (código 2 si algo pide atención):
rockmass slope --faces Taludes.csv --families Familias.csv --report taludes.html --charts fig -o resultados.csv
Ve examples/08-taludes-cinematica-smr-qslope/.
Bloques en roca, probabilidad de falla y diseño banco–berma
Sobre la cinemática, assess_blocks(...) y rockmass slope --blocks corren bloques de equilibrio límite por cada
fila de una hoja Bloques, cada una ligada a una cara de talud por id_talud:
- planar (Hoek y Bray), con grieta de tracción, agua, sismo horizontal, perno o fuerza externa, y retroanálisis opcional (los pares c–φ que dan FS = 1);
- cuña por resolución vectorial (dos planos, un plano o despegue), con presión de agua por junta, sismo y fuerza externa;
- volteo de bloques regulares (Goodman y Bray 1976), con fuerza de soporte opcional en el pie;
- berma (Ritchie modificado, 0.2 H + 4.5 m): ángulo interrampa, ancho frente al requerido y, con una distribución, la confiabilidad de la berma.
Un bloque con filas en Distribuciones para sus variables recibe además una probabilidad de falla (Monte Carlo o
hipercubo latino, variables normales truncadas, exponenciales o uniformes, semilla fija), con el FS medio, la
desviación y el índice de confiabilidad.
Lee esto dos veces:
- La PoF depende de las distribuciones que tú eliges. La librería propaga lo que le das; no sabe cuánto varía tu macizo. Con la misma semilla, el mismo número de muestras y las mismas hojas, la PoF sale igual en cualquier máquina.
- El FS igual a 1 cuenta como falla (con holgura de 1e-9), una muestra con despegue cuenta como falla y la PoF es
condicional a que el bloque se forme (se informan
nyn_valid). - La librería nunca dice «aceptable». Solo un FS menor que 1 y los avisos cambian el código de salida. La PoF, la confiabilidad de la berma y la comparación con Ritchie se informan y no se juzgan (solo los juzga un criterio de aceptación que tú eliges, más abajo), y el análisis es 2D, por metro de talud.
- Privacidad:
id_bloqueeid_taludsalen solo en las tablas del informe y en el archivo de resultados, nunca en la consola, las figuras ni un mensaje de error. No pongas códigos de labor ni de mina en los nombres defamilia: llegan a los avisos.
import rockmasspy as rm
from rockmasspy.probabilistic import Distribution, run_probabilistic
# Sau Mau Ping (problema 1 de verificación de RocPlane, en kN): H 60 m, cara 50, plano 35, c 100 kPa, φ 35, kh 0.08
i = rm.PlanarInput()
i.height_m, i.face_dip_deg, i.plane_dip_deg = 60, 50, 35
i.unit_weight, i.water_unit_weight, i.cohesion, i.friction_deg, i.kh = 27, 10, 100, 35, 0.08
i.water_fill = 1.0 # saturado, sin grieta de tracción
print(f"{rm.planar_fs(i).factor_of_safety:.3f}") # 0.818
crack = rm.critical_tension_crack(60, 50, 35) # grieta crítica del talud seco, llena al 90 %
print(f"{crack.depth_m:.4f} {crack.distance_m:.4f}") # 14.0092 15.3358
i.tension_crack_distance_m, i.water_fill = crack.distance_m, 0.9
print(f"{rm.planar_fs(i).factor_of_safety:.3f}") # 1.065
variables = {"friction_deg": Distribution("normal", 15, 70, 35, 5),
"cohesion": Distribution("normal", 0, 250, 100, 20),
"tension_crack_distance_m": Distribution("normal", 0, 35.34, 15.3, 4),
"water_fill": Distribution("exponential", 0, 1, 0.5),
"kh": Distribution("exponential", 0, 0.16, 0.08)}
r = run_probabilistic("planar", i, variables, n=5000, sampling="lhs", seed=9)
print(f"{r.pof * 100:.1f} {r.n_valid}/{r.n}") # 7.4 5000/5000
print(f"{rm.ritchie_berm_width(12).width_m:.1f}") # 6.9
Los bloques salen de una hoja Bloques (rm.load_blocks, una fila por análisis, columna modelo = planar, cuña,
volteo o berma) y las variables aleatorias de una hoja Distribuciones (rm.load_distributions: id_bloque,
variable, distribucion = normal, exponencial o uniforme, media, desviacion, minimo, maximo), ambas en
xlsx o CSV. Cada bloque toma la cara y la orientación media (Fisher) de las familias de su talud, así que Taludes no
gana columnas. rm.block_counts da los conteos y rm.save_block_results escribe el archivo de resultados de 25
columnas; report.build_slope_report(..., blocks=...) agrega las tablas de bloques y report.block_figure dibuja el
histograma del FS y la curva de PoF. Desde la línea de comandos (0 si todo está bien, 1 si hay un error de entrada, 2 si
algo pide atención):
rockmass slope --faces Taludes.csv --families Familias.csv --blocks Bloques.csv --distributions Distribuciones.csv \
--iterations 5000 --sampling lhs --seed 9 --blocks-output bloques_resultados.csv --report taludes.html --charts fig
Opciones: --blocks (pide --faces y --families), --sheet-blocks, --distributions, --sheet-distributions,
--iterations (por defecto 5000), --sampling lhs|monte-carlo (por defecto lhs), --seed (por defecto 1) y
--blocks-output RES.csv|.xlsx. Todas, salvo la propia --blocks, necesitan --blocks.
Mira examples/09-bloques-probabilistico-berma/.
Equilibrio límite y Newmark
assess_le(...) y rockmass le calculan el factor de seguridad de una sección 2D por tajadas verticales: un
talud de tajo, un pad o un botadero, con estratos, línea piezométrica y coeficiente sísmico pseudoestático. Por cada
fila de una hoja Analisis_LE:
- los métodos: Ordinario (Fellenius), Bishop simplificado, Janbu simplificado y corregido, Spencer y Morgenstern-Price/GLE (función entre tajadas de medio seno o constante);
- la superficie de falla: búsqueda circular (malla de centros con radios y afinado local), búsqueda de bloque sobre una capa débil o una polilínea dada;
- la resistencia en la base de cada tajada: Mohr-Coulomb o Hoek-Brown no lineal (envolvente de Balmer, con GSI y mi o con mb, s y a);
- agua por
ruo por línea piezométrica (con el agua encharcada sobre el terreno), grieta de tracción con agua ykh; - el coeficiente de fluencia ky (el kh que lleva el FS a 1) y el desplazamiento de Newmark de bloque rígido para un registro de aceleraciones.
Lee esto dos veces:
- Con sismo, usa Spencer o GLE. Bishop no equilibra fuerzas horizontales, así que un kh alto lo separa de los métodos rigurosos (ACADS 1(d) en Slide2, kh 0.15: Bishop 1.016, Spencer 0.991).
- La librería nunca dice «aceptable». Solo un FS igual o menor que 1 (con holgura de 1e-9) y los avisos cambian el código de salida; el FS, ky y el desplazamiento de Newmark se informan y no se juzgan; mira Criterios de aceptación y Sarma.
- Privacidad:
id_seccion,id_analisis,material,registroy los nombres de línea salen solo en las tablas del informe (los dos ids también en el archivo de resultados), nunca en la consola, las figuras ni un mensaje.
import rockmasspy as rm
# Fredlund y Krahn (1977), problema 21 de verificación de Slide2, en psf, pcf y ft: c 600, φ 20, γ 120, seco
s = rm.LeSection()
s.surface = [rm.Point2(x, y) for x, y in [(0, 60), (60, 60), (140, 20), (180, 20)]]
m = rm.LeMaterial()
m.unit_weight, m.cohesion, m.friction_deg = 120, 600, 20
estrato = rm.LeLayer()
estrato.bottom, estrato.material = [], 0 # un solo estrato: sin línea de base
s.layers, s.materials = [estrato], [m]
f = rm.SlipSurface()
f.circle = rm.Circle(120, 90, 80) # xc, yc, R
bishop = rm.le_factor_of_safety(s, f, rm.LeMethod.Bishop)
spencer = rm.le_factor_of_safety(s, f, rm.LeMethod.Spencer)
print(f"{bishop.factor_of_safety:.3f}") # 2.076
print(f"{spencer.factor_of_safety:.3f}") # 2.072
print(spencer.info.method_id) # Spencer
Las hojas son Geometria (una fila por vértice: id_seccion, linea, x_m, y_m; la línea superficie es
obligatoria y piezometrica opcional), Estratos (orden 1 arriba, material, linea_base), Materiales_LE
(mohr_coulomb o hoek_brown), Analisis_LE (metodos separados por ;, el primero busca; superficie =
circular, bloque o dada; kh, registro) y Sismos (registro, t_s, a_g en g, paso constante), en un
xlsx o en un CSV por hoja. rm.le_counts da los conteos, rm.save_le_results escribe una fila por método (con
kh y fs_estatico, el FS estático de cada método sobre la crítica estática),
report.build_slope_report(..., le=...) agrega las tablas de equilibrio límite y report.le_figure /
report.newmark_figure dibujan la sección y el registro de Newmark. Desde la línea de comandos (0 si todo está bien, 1
si hay un error de entrada, 2 si algo pide atención):
rockmass le --geometry Geometria.csv --layers Estratos.csv --materials Materiales_LE.csv --analyses Analisis_LE.csv \
--records Sismos.csv --output equilibrio_resultados.csv --report taludes.html --charts fig
Opciones: --workbook LIBRO.xlsx (en lugar de los CSV), --records, -o/--output RES.csv|.xlsx,
--report OUT.docx|.html, --charts DIR, --title, --author, --lang es|en y --no-figures. Con más de un
análisis, rockmass le imprime analysis <k> of <n>... en stderr.
Tiempos: con Hoek-Brown, una búsqueda circular de 20×20×11 tarda unos 10 a 15 s; con kh, ky por vueltas puede repetirla hasta 5 veces.
Mira examples/10-equilibrio-limite-newmark/.
Criterios de aceptación y Sarma
assess_criteria(...) y rockmass slope|le --criteria comparan cada bloque (3B) y cada análisis de equilibrio límite
(3C) con un criterio de aceptación que tú eliges, y dicen por chequeo «cumple», «no cumple» o «no verificable»,
siempre con el criterio, su fuente, su fuerza (ley o guía) y su marca. Los criterios son perfiles de datos versionados:
READ-STACEY-2009: Read y Stacey (2009), tabla 9.9, FS estático mínimo y PoF máxima por escala (banco, interrampa, global) y consecuencia; marca V2 (leída en Moffitt 2023, que la reproduce), sin la columna dinámica;NDEP-2021: pads de lixiviación de Nevada, FS estático 1.30, seudoestático 1.05 y, bajo 1.05, un análisis de deformación;DMIRS-WA-2019: Australia Occidental, FS por consecuencia;RYAN-PRYOR-2000: confiabilidad de berma de 50 a 90 %;- tu tabla propia (hoja
Criterios:escala,consecuencia,fs_estatico_min,fs_seudoestatico_min,pof_max_pct,confiabilidad_berma_min_pct,fuente), querm.load_criteria_tablelee como guía con la marcauser.
Cada fila de Bloques y de Analisis_LE lleva escala (banco, interrampa, global, pad, botadero) y
consecuencia; Analisis_LE lleva además periodo_retorno_anios. El perfil PE-DS024-2016 verifica el art. 264
del DS 024 (análisis seudoestático de la pendiente general del tajo con período de retorno de 100 años; no fija FS).
Sarma con tajadas no verticales (superficie = sarma, la base en linea_superficie y un ángulo de interfaz por
vértice interior en sarma_angulos, u opt para buscarlos) divide la masa en cuñas rígidas con interfaces inclinadas
y entrega el FS y la aceleración crítica Kc. Es el método para botaderos que deslizan sobre una base débil inclinada.
Reproduce el problema 4 del manual de verificación de Sarma de Slide (1.1970 frente a 1.198) y, con una sola cuña, el
bloque planar de Hoek. No acepta Hoek-Brown, agua encharcada ni grieta de tracción.
Lee esto dos veces:
- La librería nunca dice «aprobado». Un «no cumple» pide atención (código 2); un «no verificable» es una nota con su razón (sin escala, sin criterio para esa escala, sin análisis probabilístico). Nunca cuenta como «cumple».
- Rangos: cuando un criterio es un rango (PoF de 25 a 50 % en un banco), la política por defecto es el extremo
conservador (el alto para un FS mínimo, el bajo para una PoF máxima);
range_policy=o--range-policy upper|lowerla cambian, y el valor usado se informa. Un valor igual al límite lo cumple. - Privacidad: los ids salen solo en las tablas del informe y en los archivos de resultados, nunca en la consola ni en un mensaje.
import csv
import tempfile
from pathlib import Path
import rockmasspy as rm
from rockmasspy.criteria import criteria_assignments
# Verificación de Sarma de Slide, problema 4 (Hoek 1987): pila de desmonte seca sobre piso cizallado, kN y m
ground = [(-50, -2.97), (0, 0), (111.4, 76.5), (229.545, 13.6815), (250, 14.9)]
floor = [(-50, -2.97), (0, 0), (250, 14.9)]
base = [(0, 0), (108, 6.4), (130, 73.06)] # dos cuñas, un vértice interior
s = rm.LeSection()
s.surface = [rm.Point2(x, y) for x, y in ground]
top, bottom = rm.LeLayer(), rm.LeLayer()
top.bottom, top.material = [rm.Point2(x, y) for x, y in floor], 0
bottom.bottom, bottom.material = [], 1
pile, sheared = rm.LeMaterial(), rm.LeMaterial()
pile.unit_weight, pile.cohesion, pile.friction_deg = 15.7, 100, 42
sheared.unit_weight, sheared.cohesion, sheared.friction_deg = 15.7, 10, 6
s.layers, s.materials = [top, bottom], [pile, sheared]
i = rm.SarmaInput()
i.base, i.interface_angles_deg = [rm.Point2(x, y) for x, y in base], [116.5] # desde +x, antihorario
r = rm.sarma_fs(s, i)
print(f"{r.factor_of_safety:.3f} {r.critical_acceleration:.4f}") # 1.197 0.0540
# La misma sección desde hojas, juzgada (solo para ilustrar) como un pad frente a NDEP (2021)
d = Path(tempfile.mkdtemp())
def sheet(name, cols, rows):
with open(d / f"{name}.csv", "w", newline="", encoding="utf-8") as fh:
w = csv.DictWriter(fh, cols, restval="")
w.writeheader()
w.writerows(rows)
return d / f"{name}.csv"
src = {"Geometria": sheet("Geometria", rm.GEOMETRY_COLUMNS, [
dict(id_seccion="S", linea=n, x_m=x, y_m=y)
for n, pts in (("superficie", ground), ("piso", floor), ("falla", base)) for x, y in pts]),
"Estratos": sheet("Estratos", rm.LAYER_COLUMNS, [dict(id_seccion="S", orden=1, material="pila", linea_base="piso"),
dict(id_seccion="S", orden=2, material="piso")]),
"Materiales_LE": sheet("Materiales_LE", rm.MATERIAL_COLUMNS, [
dict(material="pila", modelo="mohr_coulomb", peso_unitario_kn_m3=15.7, cohesion_kpa=100, friccion_grados=42),
dict(material="piso", modelo="mohr_coulomb", peso_unitario_kn_m3=15.7, cohesion_kpa=10, friccion_grados=6)]),
"Analisis_LE": sheet("Analisis_LE", rm.ANALYSIS_COLUMNS, [
dict(id_analisis="A", id_seccion="S", superficie="sarma", linea_superficie="falla", sarma_angulos="116.5",
base_modelo_m=-10, escala="pad", consecuencia="media")])}
le = rm.assess_le(src)
checks = rm.assess_criteria(rm.get_profile("NDEP-2021"), le=le, assignments=criteria_assignments(le=le))
print(f"{le[0].sarma.factor_of_safety:.3f}") # 1.197
print(rm.criteria_counts(checks)) # {'checks': 3, 'meets': 0, 'fails': 1, 'not_verifiable': 2}
print([(c.item_id, c.status) for c in checks][0]) # ('NDEP-6-estatico', 'fails')
print(checks[1].reason) # no pseudo-static analysis
rm.save_criteria_results escribe un chequeo por fila (hoja Criterios_resultados) y
report.build_slope_report(..., criteria=..., criteria_profile=..., profile_checks=...) arma el informe de taludes
completo: resumen ejecutivo, alcance y criterios, cinemática, bloques, equilibrio límite y Sarma, verificación de
criterios, normativa (art. 264), avisos y métodos. Desde la consola:
rockmass le --geometry Geometria.csv --layers Estratos.csv --materials Materiales_LE.csv --analyses Analisis_LE.csv \
--records Sismos.csv --criteria READ-STACEY-2009 --profile PE-DS024-2016 --criteria-output criterios.csv
rockmass slope --faces Taludes.csv --families Familias.csv --blocks Bloques.csv --criteria Criterios.csv
Opciones: --criteria ID|CRITERIOS.csv|.xlsx, --criteria-output RES.csv|.xlsx, --range-policy conservative|upper|lower (las dos piden --criteria) y, en rockmass le, --profile PE-DS024-2016. El resumen
imprime meets: a, fails: b, not verifiable: c y los «no cumple» agrupados por regla, sin ids.
Mira examples/11-criterios-sarma/.
Histórico de la mina: auditoría de ingesta y correlaciones propias
Las correlaciones necesitan el extra pip install "rockmasspy[ml]" (numpy y scipy). Leer y auditar el histórico solo
pide el paquete base (el Excel pide [io]). rm.load_history lee la plantilla del histórico
(plantillas/Plantilla_historico_geomecanico.xlsx: hojas Tramos, Tipos_sostenimiento y Desempeno), y
rm.audit_history recalcula el Q y el RMR89 básico, marca los registros no independientes y las incoherencias
entre hojas, y cuenta cuánto le falta a cada nivel predictivo para su mínimo (decisión de diseño, no un valor
publicado).
import rockmasspy as rm
from rockmasspy.predictive import fit_site_correlation, save_site_correlations
h = rm.load_history("historico.xlsx")
audit = rm.audit_history(h)
fit = fit_site_correlation(h, "rmr_from_q", group_by="litologia")
print(fit.mine.status, fit.mine.a, fit.mine.b) # "site", "unstable" o "not_calibrated"
save_site_correlations(fit, "resultados/") # CSV con todos los ajustes, JSON solo con los «site»
El nivel 1 ajusta rmr_from_q, gsi_from_rmr y gsi_from_q_prime por dominio y para toda la mina:
- OLS con intervalo de predicción;
- Deming, solo si das el cociente de varianzas de error;
- bootstrap que remuestrea labores enteras;
- un bayesiano conjugado centrado en la correlación global publicada: con pocos datos se queda cerca de ella.
to_custom_correlation() convierte un ajuste en una CustomCorrelation para tus tablas por labor. Desde la
terminal:
rockmass history historico.xlsx --correlations --output resultados/ --report historico.docx
La CLI y el informe muestran conteos y códigos (los dominios salen como D1, D2…). Nunca muestran la labor, la zona,
las coordenadas ni la litología, ni tampoco el nombre del archivo de entrada. Los archivos de resultados sí traen el
id_tramo y el dominio: guárdalos en la carpeta protegida de la mina, junto con el histórico. Mira
examples/12-historico-prediccion/.
Auditoría de la práctica (nivel 2) y modelo de falla con recomendación (nivel 3)
from rockmasspy.predictive import audit_practice, fit_performance, recommend, save_model
practica = audit_practice(h) # logit ordinal del tipo instalado: describe, nunca recomienda
modelo = fit_performance(h) # "site", "partial" o "not_calibrated"
recs = recommend(modelo, tramos_nuevos, threshold=0.10, exposure_days=365, practice=practica)
save_model(modelo, "modelo.json") # coeficientes, rangos y conteos; nunca filas ni ids
- Nivel 2:
- Ajusta un logit acumulado del tipo de sostenimiento instalado sobre ln Q, ln De (luz/ESR), vida útil y tipo de labor.
- Dice si la práctica es coherente con la calidad del macizo y con la luz, y si es más predecible que la carta Q NGI.
- Marca los tramos cuyo tipo instalado queda fuera de su conjunto conforme al 90 % (≈ 10 % por construcción: no es un detector de desvíos).
- Mide la consistencia de la práctica con 1 − tanh(w/4), con w el ancho medio de las bandas internas del logit;
sobre 0.66 dice
practice poorly consistent.
- Nivel 3:
- Modela la tasa de falla con un riesgo constante y una fragilidad gamma por labor; la exposición entra como offset.
- Tiene restricciones de signo: peor macizo o más luz nunca bajan el riesgo, y más sostenimiento nunca lo sube.
- Usa una covarianza robusta agrupada por zona.
- La P(falla en H días) de una labor nueva es 1 − (1 + θλH)^(−1/θ).
- Validación:
- Particiones: por labor, dejando una zona fuera, y temporal.
- Referencias: un ficticio de tasa constante y la línea base de la categoría NGI, con bootstrap por labor.
- El modelo queda
sitesolo si las particiones por labor y por zona superan a las dos referencias (IC 95 % de la mejora de la devianza de Poisson sobre cero y sin pliegues fallidos), y la temporal no sale peor.
- Forma: aditiva en la calidad y el rango del sostenimiento, o con la interacción (calidad − máx)·(rango − máx) con cota ≥ 0 (el riesgo sigue monótono en las dos). La interacción entra solo con 10 eventos por parámetro contándola y si baja la devianza de Poisson fuera de pliegue (pliegues por labor, de otra semilla que la validación); si queda en su cota en el ajuste final, vuelve la aditiva.
- Recomendación:
- Elige el tipo más liviano elegible cuyo límite superior, 1 − exp(−λ_sup·H·Z_q), queda bajo el umbral.
- λ_sup suma el cuantil de la fragilidad con θ superior y una zona nueva: σ_z² = C·Var(η en la media) con la
covarianza agrupada por zona, tomada en su cota superior unilateral χ², σ̂_z·sqrt((C − 1)/χ²₁₋ᵤ(C − 1)) con
u = 0.5 + level/2 (
PerformanceModel.zone_sd_upper; ×1.80 con 8 zonas y ×2.37 con 5, con level 0.9). Con menos de 10 zonas,fit_performanceavisa. - El umbral y el horizonte los fija el ingeniero: no hay valores por defecto.
- No se elige nada si el modelo no es
site, si el tramo extrapola, si el efecto del sostenimiento no está identificado o si queda activa una restricción de signo en la calidad o en la luz. Tampoco con las compuertas (decisiones de diseño): (a) el tramo está en el tercio peor de la calidad y ahí el observado/esperado fuera de pliegue pasa de 1.2 o tiene menos de 10 fallas; (b) un tipo con menos de 10 tramos de entrenamiento en la clase de Q del tramo (Barton et al. 1974; clases de RMR de Bieniawski 1989 conquality="rmr") no es elegible; (d) el tipo de labor del tramo tuvo menos de 10 fallas en el entrenamiento. (c) Si ningún tipo queda bajo el umbral lo dice (no support type meets the threshold), y también si los que cumplen no son elegibles. Las opciones se muestran igual, con el motivo.
rockmass history historico.xlsx --practice --performance --model-output modelo.json --output resultados/ \
--threshold 0.10 --exposure-days 365 --report historico.docx
rockmass recommend tramos_nuevos.xlsx --model modelo.json --threshold 0.10 --exposure-days 365 \
--practice-from historico.xlsx --output recomendaciones.csv
recommend imprime cada tramo por su posición. El recomendaciones.csv trae el id_tramo y dos columnas vacías,
decision_ingeniero y motivo, donde el ingeniero anota lo que decidió. Los mínimos de datos por nivel se
comprobaron por simulación (docs/investigacion/SIMULACION_MINIMOS.md en el repositorio). La librería recomienda; el
ingeniero decide.
Mina sintética y banco de pruebas
synthetic_mine arma una mina sintética calibrada con la literatura para probar el módulo predictivo de punta a
punta contra una verdad conocida. Es un banco de pruebas: nunca entrena un modelo que se entregue, no da priors ni
coeficientes por defecto y nunca reemplaza el histórico de una mina.
from rockmasspy.predictive import SCENARIOS, synthetic_mine
h, verdad = synthetic_mine("base", seed=0) # History (Tramos, Tipos_sostenimiento, Desempeno) y MineTruth
h_mal, verdad_mal = synthetic_mine("base", seed=0, defects=True) # la misma mina con defectos de datos inyectados
verdad.rmr_lnq_slope # la recta RMR–ln Q de la mina (emerge; no se fija)
verdad.p_fail("T0001", "III", 365) # P verdadera de falla en 365 días con el tipo III, labor nueva
- Mecanismo: el macizo verdadero sale de la geología (calidad por litología y zona, un AR(1) a lo largo de cada
labor más pepita, zonas de falla de Poisson); los parámetros de juntas salen de esa calidad y Q, RMR89 y GSI se
calculan con la librería, así que la relación RMR–ln Q y su dispersión emergen. Cada labor la mapea un geólogo
con sesgo y ruido; la mina sostiene con su propia tabla por GSI, con desvíos, un cambio de tabla y horas sin
sostener; la falla es una tasa constante con fragilidad gamma que sube con el déficit frente a la carta Q leída
con Q·exp(−δ) (δ = 0.5 en
base, un sitio algo peor que NGI).failure_mechanism="saturating"es un mecanismo alternativo, sin carta ni déficit, para no ajustar el módulo a una sola receta. - Verdad:
MineTruth.tramosguarda los valores verdaderos, el geólogo, el tipo de la tabla y el instalado, la fragilidad y, por tramo, la tasa verdadera de cada tipo (con las horas sin sostener que habría tenido ese tipo);p_fail(id, tipo, H)es cerrada, marginal sobre la fragilidad de una labor nueva en la misma zona (conditional=Truepara la labor del tramo).verdad.defectslista los defectos inyectados. - Escenarios (
SCENARIOS):base(≈ 800 tramos, 5 zonas),ngi_site(el sitio es igual a la carta NGI),worse_site,better_site,shifted_correlation,conservative_practice,incoherent_practice,mine_practice,noisy_mapping,small_mine(≈ 80 tramos),large_mine(≈ 4800 tramos, 8 zonas),saturating_largeysaturating_worse(el mecanismo alternativo). UnMineScenariose arma o se cambia condataclasses.replace.
Resultados del banco (docs/investigacion/BANCO_MINA_SINTETICA.md en el repositorio; 50 semillas por escenario,
20 en los grandes; la recomendación se aplica a una segunda mina del mismo escenario, con zonas y labores que el
ajuste no vio; umbral 0.10, H = 365 días):
| Escenario | Elige | Demasiado liviano, agrupado | Por mina, p90 / máx | Sobrecosto frente al óptimo de verdad (mediana) |
|---|---|---|---|---|
large_mine |
30.8 % | 0.7 % | 0.5 % / 4.6 % | +261 % |
saturating_large |
41.8 % | 0.5 % | 1.3 % / 2.6 % | +146 % |
shifted_correlation |
1.8 % | 1.1 % | 1.9 % / 3.2 % | +220 % |
incoherent_practice |
1.9 % | 0.2 % | 0.1 % / 0.3 % | +431 % |
base |
0.3 % | 0.0 % | 0.0 % / 0.0 % | +201 % |
worse_site, ngi_site, better_site, conservative_practice, small_mine |
0 | — | — | — |
Antes de las correcciones de la 5B, large_mine elegía en el 60.7 % con 5.0 % demasiado liviano y worse_site
llegaba a 23.4 %. Ahora el p90 por mina queda en 3.7 % o menos en todas las celdas con ln Q. La seguridad se compró
con sostenimiento y con menos elecciones: con pocas zonas σ_z se conoce mal y su cota lo cubre con más
sostenimiento, no con más información. Donde el modelo elige, es mucho más seguro que la carta Q sola en los mismos
tramos.
Cambios del módulo que pidió el banco (Fase 5B):
- Nivel 2: el indicador de consistencia de arriba (corte 0.66); el logit ordinal converge con n grande (criterio del gradiente medio).
- Auditoría:
missing_values, un hallazgo por columna con celdas vacías (solo conteos, sinid_tramo); la regla de Q es |Q registrado − Q recalculado| > máx(0.005, 1 % de Q) o una razón mayor que 2 (Q_MAX_RATIO), y un Q registrado ≤ 0 siempre es hallazgo. - Nivel 1:
gsi_from_rmravisa que GSI y RMR comparten la condición de juntas y el RQD (errores de mapeo correlacionados). - Nivel 3: la forma con interacción, la cota χ² de σ_z, las compuertas (a)–(d) y el aviso con menos de 10 zonas
(arriba). El JSON del modelo pasa al esquema 4 (
zone_sd,poor_rock,class_counts,labor_type_failures); uno de esquema anterior se rechaza y pide reajustar conrockmass history --performance --model-output.
Ver examples/13-mina-sintetica/: una mina por la auditoría y los niveles 1 a 3, medida contra su verdad.
Métodos
Cada resultado lleva info.method_id y una marca de verificación: Primary (verificada en la fuente original, o en
una reproducción fiel de sus ecuaciones por un autor citado), PrimaryLaterAuthors (verificada en una publicación
posterior de los mismos autores) o Secondary (solo fuente secundaria). UserDefined significa calibrada por el usuario con datos del sitio.
| method_id | Método | Verificación |
|---|---|---|
| RQD-Deere | RQD por testigo | Secondary |
| RQD-PH1976 | RQD por frecuencia de discontinuidades (Priest y Hudson) | Primary |
| RQD-P1982 | RQD desde Jv (Palmström 1982) | Primary |
| RQD-P2005 | RQD desde Jv (Palmström 2005) | Secondary |
| RMR76 | Bieniawski 1976 | Secondary |
| RMR89 | Bieniawski 1989 | Secondary |
| RMR14 | Celada et al. 2014 | Secondary |
| Q-NGI-2015 / Q-NGI-2025 | Sistema Q, ediciones NGI (2025 por defecto) | Primary |
| Q-NGI-2025-chart / Q-NGI-2015-chart | Regiones de la carta de sostenimiento Q, digitalizadas por RockMassPy (error máximo medido 0.017 / 0.008 década, con los empalmes) | Primary |
| Q-Barton1980 | Fórmulas de luz máxima sin sostén y longitud de perno (Hoek, según Barton et al. 1980) | Secondary |
| Q-GrimstadBarton1993 | Presión de sostenimiento del techo (Hoek, según Grimstad y Barton 1993); la unidad aún está por confirmar | Secondary |
| Mathews-Potvin1988 | Número de estabilidad modificado N' (factores A, B, C), radio hidráulico y gráfico de estabilidad, digitalizado por RockMassPy (error máximo medido 0.014 celda; ajuste del factor A 0.019, C por deslizamiento 0.044, curvas de B 0.007) | Primary |
| MRMR-Laubscher1990 / Laubscher1994-stability | MRMR (Laubscher 1990) y su diagrama de hundimiento (1994, error máximo medido 0.009 celda) | Primary |
| SMR-Romana1985 / SMR-Tomas2007 | SMR de Romana (discreto) y de Tomás (continuo, revisión 2017) para rotura planar y vuelco | PrimaryLaterAuthors |
| SMR-Romana1985-wedge | SMR discreto en cuña (adaptación de Anbalagan 1992, según la describe Tomás) | Secondary |
| Q-slope-BarBarton2017 | Q-slope y el ángulo beta (Bar y Barton 2017, 2018) | PrimaryLaterAuthors |
| Kinematic-PlanarSliding / -WedgeSliding / -FlexuralToppling-Goodman1980 / -DirectToppling-HudsonHarrison1997 | Pruebas cinemáticas de Markland (criterios de la documentación de Dips) | Secondary |
| Fisher1953-set-statistics | Estadística de Fisher de una familia de discontinuidades (según Tauxe et al.) | Secondary |
| GSI-2013 | GSI cuantificado (Hoek, Carter y Diederichs) | Primary |
| HB-2002 / HB-2018 | Parámetros del criterio de Hoek-Brown (hb_params) y Mohr-Coulomb equivalente (hb_mohr_coulomb); 2018 por defecto |
Primary |
| HB-2002 | Módulo del macizo Em (em_hoek2002) |
Secondary |
| HD-2006 | Módulo del macizo (Hoek y Diederichs) | Primary |
Correlaciones (nombre del enum, p. ej. RmrFromQ_Bieniawski1976) |
Correlaciones globales, sin encadenar | Primary o Secondary, ver rm.correlate(...).info |
Fuera de la fase 1A: Fe de tuneladora, Q 1974, ecuación 3 del GSI, tablas de mi/MR.
Notas de Python
Algunos nombres de C++ son palabras reservadas de Python, así que llevan un guion bajo al final:
Infilling.None_(sin relleno), como enJointCondition89(..., rm.Infilling.None_, ...).CorrelationResult.from_yCustomCorrelation.from_(el argumentofrom_de su constructor).
Los resultados se imprimen de forma legible (QResult(q=4.5, ...)) y el paquete trae stubs de tipos (py.typed).
Cómo citar
Si RockMassPy te sirve en tu trabajo, cítalo. GitHub muestra el botón «Cite this repository», armado desde CITATION.cff:
Quintanilla Ventura, M. (2026). RockMassPy: rock mass classifications, Hoek-Brown strength and mining geomechanics (versión 0.2.0) [Software]. https://github.com/Miqueas7/RockMassPy
Cada resultado registra además el método y la edición que sigue (result.info); cita también esa fuente original.
Licencia: MIT.
Metadata
Release files for rockmasspy 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rockmasspy-0.2.0.tar.gz | 870.4 kB | With provenance | Details for rockmasspy-0.2.0.tar.gz |
Built distributions (wheels)
Total release size: 11.3 MB
Release files / rockmasspy-0.2.0.tar.gz
| Download URL | rockmasspy-0.2.0.tar.gz |
|---|---|
| Size | 870.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2692165bdced60b7b70681337a73cc469125ca446e55dc8fed5784155f461255
|
|
BLAKE2b-256 checksum How to use checksums |
0f57c2817277f53c6a399ce629168105980568c24d3fa3d1a737b9db2ee64b46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp314-cp314-win_amd64.whl
| Download URL | rockmasspy-0.2.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 740.0 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d29a26add0b09760469c0d53f0f2ec1c825937da8752ebae6e0466420f26cdc0
|
|
BLAKE2b-256 checksum How to use checksums |
9eb8a416b0e556bd49f3e9b5a04b44202b166111937aab7a2e908856f2ef10d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | rockmasspy-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 697.8 kB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
19517c6ed1ad84cebc6eed61b50cb4b2b14d7ee5d4da7dd85dc2e0b835ccc64d
|
|
BLAKE2b-256 checksum How to use checksums |
58106de82a9a105820771d1ddddcf501e0013bee3b329feab42cdfba8f826e8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | rockmasspy-0.2.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 652.9 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c5b14f498228b364b8b103f4d8400f290278c20a21e5f05514bfd52587558321
|
|
BLAKE2b-256 checksum How to use checksums |
5883dd15b0f5ac1781086f461dc0b339442cc5615b97db6c174f65c79d1f1263
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp313-cp313-win_amd64.whl
| Download URL | rockmasspy-0.2.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 727.3 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4d91161cb85c7caa0c23528f9fa3c21cfa117042c6790a4e9e1aa7071b38847d
|
|
BLAKE2b-256 checksum How to use checksums |
d06a617ea84c0f6f57a2aa1ea4e2667d99a06126eeaf7a2d9bbfef908f5d1821
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | rockmasspy-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 697.8 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
21190f698952b5d9aff1355f4220c45004eb6a7ff5d42c47b94720f0e7cbceee
|
|
BLAKE2b-256 checksum How to use checksums |
86a687f189d41f3155f543311d098dd0205de29e7ab1e320c152580001febe6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | rockmasspy-0.2.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 652.9 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5b7292bd6a20e710775270812fe540d8479d14cf1d851ce5b2826dd4e1a006cd
|
|
BLAKE2b-256 checksum How to use checksums |
aabeff6828825033adda98bdd1435b6e83811d6e18d3cdc88d53480b894be6ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp312-cp312-win_amd64.whl
| Download URL | rockmasspy-0.2.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 727.3 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d3fbaf9bc41c0920b398ff9504beaeb00a82061c7f8df2e58c23dd0109083fd6
|
|
BLAKE2b-256 checksum How to use checksums |
43b7b2ab1fe8eb2f4f19e18fc996d8a804d4b3782a95f1dabe84913adcf97496
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | rockmasspy-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 697.8 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
5919732ba6a19138c789a881b77bb80ab049404cf57b349a8ff15f7166517107
|
|
BLAKE2b-256 checksum How to use checksums |
07261727799929745babed94149bd086bdc87cc2eb8d4dc58c1da186e55f6cb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | rockmasspy-0.2.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 652.9 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e8ef1efe856f2159c7e950f0abc13c915340d3526e7ca58540d9c2e150e3da08
|
|
BLAKE2b-256 checksum How to use checksums |
feccf95f8b3811874420ef6c478507c65deb3c8dfa900b86bf90f11a79117bb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp311-cp311-win_amd64.whl
| Download URL | rockmasspy-0.2.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 727.7 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
051fa207de7cea8542c7465884ea288567376065f2e9f5d60ae31ff1163f1a1a
|
|
BLAKE2b-256 checksum How to use checksums |
746ba61a0a39c6e08b6b16ebba749a11d5fe54a2d258065b2e9eb92b4f1b1ae8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | rockmasspy-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 702.5 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
715bcd06aed44f48fe2e5d48a098ac3cb23fa6684121a3fc374c54c56d4791f8
|
|
BLAKE2b-256 checksum How to use checksums |
3634b1045f9803f5b45f1b1e9018f1f68e519600d7991b3bd1674b87f6fbd855
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | rockmasspy-0.2.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 655.3 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1a90ee484e1832a9081d315ca7d9e2ffa7ea56a0e280c8122f7b1e3c4e51a8b6
|
|
BLAKE2b-256 checksum How to use checksums |
d9fa3936fdb70b8db8c9f02ed09a368b819e04b75c81e16f6b2dfb0bb53f1ae9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp310-cp310-win_amd64.whl
| Download URL | rockmasspy-0.2.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 727.4 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8b2a039f11c0ffdc9758ffd293d8a72f0f8c92e8e3ff9955008612a0a48473c9
|
|
BLAKE2b-256 checksum How to use checksums |
22f71218f8c3a53a651136417f1a4513621f5449e562a0c30cf3cf57e6e8c283
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | rockmasspy-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 702.1 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2a0b5221655cfc9ed4ccaf9c910b2084306d7a271273e314e9d884ec6eb00cbd
|
|
BLAKE2b-256 checksum How to use checksums |
fce45bf2c487db145aa4c16cc15ae3e9375af76a1f501b43de76dea3a97e98d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / rockmasspy-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | rockmasspy-0.2.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 654.5 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
37cb487eb937f8c01836e8968dbf059241547c6b5f94105b0c5aa8df74c51225
|
|
BLAKE2b-256 checksum How to use checksums |
ef8c6fb2a870ad809996ff1e0bf46cbdefbebf62995a945c4af9a1dc76e2a8cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logSecurity for rockmasspy 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 16 files in this release have been uploaded with provenance metadata.
Attestation for rockmasspy-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.