Skip to content

Commit

Permalink
display order of large families
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Andriushchenko committed Mar 13, 2024
1 parent 581ac47 commit e010635
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions paynt/family/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion paynt/synthesizer/synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e010635

Please sign in to comment.