Skip to main content

Report

GitHub source

Report

evo.blockmodels.typed.report.Report

A typed wrapper for block model report specifications.

Reports provide resource estimation summaries for block models. They calculate tonnages, grades, and metal content grouped by categories (e.g., geological domains).

Example usage:

# Create a report from a block model
report = await block_model.create_report(ReportSpecificationData(
name="Resource Report",
columns=[ReportColumnSpec(column_name="Au", output_unit_id="g/t")],
categories=[ReportCategorySpec(column_name="domain")],
mass_unit_id="t",
density_value=2.7,
density_unit_id="t/m3",
))

# Pretty-print shows BlockSync link
report

# Get the latest result
result = await report.get_latest_result()
df = result.to_dataframe()

id

id: UUID

The unique identifier of the report specification.

name

name: str

The name of the report.

description

description: str | None

The description of the report.

block_model_uuid

block_model_uuid: UUID

The UUID of the block model this report is for.

revision

revision: int

The revision number of the report specification.

__init__

__init__(
context: IContext,
block_model_uuid: UUID,
specification: ReportSpecificationWithLastRunInfo | ReportSpecificationWithJobUrl,
block_model_name: str | None = None,
) -> None

Initialize a Report instance.

Parameters:

NameTypeDescriptionDefault
contextIContextThe context containing environment, connector, and cache.required
block_model_uuidUUIDThe UUID of the block model this report is for.required
specificationReportSpecificationWithLastRunInfo | ReportSpecificationWithJobUrlThe report specification from the API.required
block_model_namestr | NoneThe name of the block model (for display purposes).None

create

create(
context: IContext,
block_model_uuid: UUID,
data: ReportSpecificationData,
column_id_map: dict[str, UUID],
fb: IFeedback = NoFeedback,
block_model_name: str | None = None,
) -> Report

Create a new report specification.

Parameters:

NameTypeDescriptionDefault
contextIContextThe context containing environment, connector, and cache.required
block_model_uuidUUIDThe UUID of the block model to create the report for.required
dataReportSpecificationDataThe report specification data.required
column_id_mapdict[str, UUID]Mapping of column names to their UUIDs in the block model.required
fbIFeedbackOptional feedback interface for progress reporting.NoFeedback
block_model_namestr | NoneThe name of the block model (for display purposes).None

Returns:

TypeDescription
ReportA Report instance representing the created report.

run

run(version_uuid: UUID | None = None, fb: IFeedback = NoFeedback) -> ReportResult

Run the report to generate a new result.

Parameters:

NameTypeDescriptionDefault
version_uuidUUID | NoneOptional specific version UUID to run the report on. If None, runs on the latest version.None
fbIFeedbackOptional feedback interface for progress reporting.NoFeedback

Returns:

TypeDescription
ReportResultThe generated report result.

refresh

refresh(fb: IFeedback = NoFeedback, timeout_seconds: float = 120.0, poll_interval_seconds: float = 2.0) -> ReportResult

Get the most recent result for this report, waiting if necessary.

If no results exist yet (e.g., report is still running), this method will poll until a result is available or the timeout is reached.

Parameters:

NameTypeDescriptionDefault
fbIFeedbackOptional feedback interface for progress reporting.NoFeedback
timeout_secondsfloatMaximum time to wait for results (default 120 seconds).120.0
poll_interval_secondsfloatTime between polling attempts (default 2 seconds).2.0

Returns:

TypeDescription
ReportResultThe latest report result.

Raises:

TypeDescription
TimeoutErrorIf no results are available within the timeout period.

list_results

list_results(limit: int = 50, fb: IFeedback = NoFeedback) -> list[ReportResult]

List all results for this report.

Parameters:

NameTypeDescriptionDefault
limitintMaximum number of results to return.50
fbIFeedbackOptional feedback interface for progress reporting.NoFeedback

Returns:

TypeDescription
list[ReportResult]List of report results, ordered newest first.

What is the reason for your feedback?