hist icon indicating copy to clipboard operation
hist copied to clipboard

[FEATURE] Repr options

Open andrzejnovak opened this issue 4 years ago • 2 comments

It would be convenient to have a config for repr akin to np.set_printoptions

I've just found myself with a dict of hist objects (filled in coffea) and printing that with ~10-100 hists in it is pretty unreadable.

Hist(
   StrCategory(['DYDY'], growth=True),
   StrCategory(['ak8trigger', 'ak8baseline', 'ak8cuts_0', 'ak8cuts_1', 'ak8cuts_2', 'ak8'], growth=True),
   Regular(100, 400, 1200, name='pt', label='Jet $p_{T}$ [GeV]'),
   IntCategory([0, 1, 2, 3, 4, 5, 6]),
   storage=Weight()) # Sum: WeightedSum(value=3632, variance=3632) (WeightedSum(value=3644, variance=3644) with flow),

into sth like

Hist(sc:name, sc:name, r:pt, ic:name)

On a side note, looks like Regular/Variable axes show name in repr, while categoricals don't

andrzejnovak avatar Apr 30 '21 09:04 andrzejnovak

maybe alsos related to #198

lukasheinrich avatar Apr 30 '21 12:04 lukasheinrich

Repr issue mentioned in #200 as well.

henryiii avatar Apr 30 '21 21:04 henryiii