estimator.Cost.str

Cost.str(keyword_width=None, newline=None, round_bound=2048, compact=False, unicode=True)[source]
Parameters:
  • keyword_width – keys are printed with this width
  • newline – insert a newline
  • round_bound – values beyond this bound are represented as powers of two
  • compact – do not add extra whitespace to align entries
  • unicode – use unicode to shorten representation

EXAMPLE:

sage: from estimator import Cost
sage: s = Cost({"delta_0":5, "bar":2})
sage: print(s)
bar: 2, delta_0: 5

sage: s = Cost([(u"delta_0", 5), ("bar",2)])
sage: print(s)
delta_0: 5, bar: 2