Skip to content

Commit

Permalink
Handle helper cornercase when metric from a family is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkarakostas committed Dec 6, 2023
1 parent 1462c53 commit 91dadd8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions consensus_decentralization/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,13 @@ def get_metrics_config():
# ensure that parameter values that correspond to the same family of metrics are consistent
params = None
for metric in metric_family:
if params is None:
params = metrics[metric]
else:
assert metrics[metric] == params, "Metrics that belong in the same family (e.g. entropy and entropy " \
"percentage) must use the same parameter values. " \
"Please update your config.yaml file accordingly."
if metric in metrics:
if params is None:
params = metrics[metric]
else:
assert metrics[metric] == params, "Metrics that belong in the same family (e.g. entropy and entropy " \
"percentage) must use the same parameter values. " \
"Please update your config.yaml file accordingly."
return metrics


Expand Down

0 comments on commit 91dadd8

Please sign in to comment.