From 4749dfb59387545b07bee4dba88e07ef9a399596 Mon Sep 17 00:00:00 2001 From: Ben Armstrong Date: Mon, 5 Aug 2024 20:41:57 -0300 Subject: [PATCH] taxon list: Format counts in uniform width column. --- dronefly/core/formatters/generic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dronefly/core/formatters/generic.py b/dronefly/core/formatters/generic.py index f73fddd..0b6d434 100644 --- a/dronefly/core/formatters/generic.py +++ b/dronefly/core/formatters/generic.py @@ -323,7 +323,9 @@ def filter_taxon_list( if taxon_count_digits > max_taxon_count_digits: max_taxon_count_digits = taxon_count_digits else: - max_taxon_count_digits = len(str(_taxon.observations_count)) + taxon_count_digits = len(str(_taxon.observations_count)) + if taxon_count_digits > max_taxon_count_digits: + max_taxon_count_digits = taxon_count_digits counted_taxa.append(_taxon) rank = _taxon.rank tot[rank] = tot.get(_taxon.rank, 0) + 1