Skip to content

Move theground_truth_model conditional out of compute_poly_metric #187

@jeipollack

Description

@jeipollack

Description:

Currently, compute_poly_metric (and potentially other metric functions in metrics.py) contains conditional logic to handle the presence or absence of ground_truth_model. Even if ground_truth_model is "present" in the dataset, the ground truth model class is instantiated anyways, and repeatedly in each evaluate_<name_of_metric> call. This mixes configuration handling with metric computation, causes redundancy, and makes the code harder to maintain and test.

Proposed Options:

Move the conditional check out of compute_poly_metric (and other metrics) into one of the following:

  1. MetricsParamsHandler.evaluate_metrics_polychromatic_lowres
  2. A pre-validation step during MetricsParamsHandler.__init__, or a dedicated helper method like prepare_ground_truth_model

Preferred Approach:

Option 2 – handle the ground truth model setup in the initialization/pre-validation phase. This ensures that all metrics functions can safely assume a valid ground_truth_model and simplifies downstream logic.

Notes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions