-
Notifications
You must be signed in to change notification settings - Fork 9
Description
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:
MetricsParamsHandler.evaluate_metrics_polychromatic_lowres- A pre-validation step during
MetricsParamsHandler.__init__, or a dedicated helper method likeprepare_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:
- This change would not alter functionality; it’s a refactor to separate configuration validation from metric computation.
- Existing tests (or new unit tests like
test_missing_ground_truth_model_raisesin Explore metrics_interface behavior under different evaluation flag configurations #186) can confirm that missingground_truth_modelraises an appropriate error.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status