Skip to content

[FEAT] Make Jupyter auto-formatting configurable #1281

Description

@genedan

In Jupyter, triangles are formatted based on the magnitude of values within them:

def _get_format_str(data: DataFrame) -> str:
"""
Returns a numerical format string based on the magnitude of the mean absolute value of the values in the
supplied DataFrame.
Returns
-------
str
"""
if np.all(np.isnan(data)):
return ""
elif np.nanmean(abs(data)) < 10:
return "{0:,.4f}"
elif np.nanmean(abs(data)) < 1000:
return "{0:,.2f}"
else:
return "{:,.0f}"

We should move the hardcoding out of the function, and make the thresholds configurable:

  • Allow configuration of format strings for small/medium/large triangles.
  • Allow configuration of thresholds at which a triangle is determined to be small/medium/large.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Fields

Priority

Medium

Effort

Low

Scope

Both

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions