GitHub source

evo.blockmodels.typed.report.ReportColumnSpec

Specification for a column in a report.

Parameters:

Name Type Description Default
column_name str

The name of the column in the block model.

required
aggregation Aggregation

How to aggregate the column values. Use Aggregation enum: - Aggregation.MASS_AVERAGE - Mass-weighted average (for grades) - Aggregation.SUM - Sum of values (for metal content)

SUM
label str | None

Display label for the column in the report.

None
output_unit_id str | None

Unit ID for the output values. Use Units class constants: - Units.GRAMS_PER_TONNE - g/t (grades) - Units.PERCENT - % (grades) - Units.PPM - ppm (grades) - Units.KILOGRAMS - kg (metal content) - Units.TONNES - t (metal content) - Units.TROY_OUNCES - oz_tr (metal content)

Example::

>>> from evo.blockmodels import Units
>>> from evo.blockmodels.typed import Aggregation, ReportColumnSpec
>>>
>>> # For grade columns, use MASS_AVERAGE
>>> grade_col = ReportColumnSpec(
...     column_name="Au",
...     aggregation=Aggregation.MASS_AVERAGE,
...     label="Au Grade",
...     output_unit_id=Units.GRAMS_PER_TONNE,
... )
>>> # For metal content columns, use SUM
>>> metal_col = ReportColumnSpec(
...     column_name="Au_metal",
...     aggregation=Aggregation.SUM,
...     label="Au Metal",
...     output_unit_id=Units.KILOGRAMS,
... )
None