From e01063508e47dd14dbd46fdde4ff927f721c8c4d Mon Sep 17 00:00:00 2001 From: Roman Andriushchenko Date: Wed, 13 Mar 2024 17:53:03 +0100 Subject: [PATCH] display order of large families --- paynt/family/family.py | 9 +++++++++ paynt/synthesizer/synthesizer.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/paynt/family/family.py b/paynt/family/family.py index c38b57c04..d0de98f2c 100644 --- a/paynt/family/family.py +++ b/paynt/family/family.py @@ -52,6 +52,15 @@ def hole_set_options(self, hole, options): def size(self): return math.prod([self.family.holeNumOptions(hole) for hole in range(self.num_holes)]) + INT_PRINT_MAX_ORDER = 5 + + @property + def size_or_order(self): + order = int(math.fsum([math.log10(self.family.holeNumOptions(hole)) for hole in range(self.num_holes)])) + if order <= Family.INT_PRINT_MAX_ORDER: + return self.size + return f"1e{order}" + def hole_options_to_string(self, hole, options): name = self.hole_name(hole) labels = [self.hole_to_option_labels[hole][option] for option in options] diff --git a/paynt/synthesizer/synthesizer.py b/paynt/synthesizer/synthesizer.py index 41401cae4..f6de78660 100644 --- a/paynt/synthesizer/synthesizer.py +++ b/paynt/synthesizer/synthesizer.py @@ -130,7 +130,7 @@ def synthesize(self, family=None, optimum_threshold=None, keep_optimum=False, re self.quotient.specification.optimality.update_optimum(optimum_threshold) logger.debug(f"optimality threshold set to {optimum_threshold}") - logger.info("synthesis initiated, design space: {}".format(family.size)) + logger.info("synthesis initiated, design space: {}".format(family.size_or_order)) self.quotient.discarded = 0 self.stat.start(family) assignment = self.synthesize_one(family)