rldurham.InfoTracker
- class rldurham.InfoTracker[source]
Bases:
objectTrack info by recursively descending into dict and creating lists of info values.
Public Methods:
__init__()track(info[, ignore_empty])plot([show, ax, key, ignore_empty, clear, ...])Plot statistics recorded by Recorder, for example:
Private Methods:
_check(new_info, tracked_info)_create(new_info, tracked_info)_update(new_info, tracked_info)
- __annotations__ = {}
- __dict__ = mappingproxy({'__module__': 'rldurham', '__doc__': '\n Track info by recursively descending into dict and creating lists of info values.\n ', '__init__': <function InfoTracker.__init__>, 'track': <function InfoTracker.track>, '_check': <function InfoTracker._check>, '_create': <function InfoTracker._create>, '_update': <function InfoTracker._update>, 'plot': <function InfoTracker.plot>, '__dict__': <attribute '__dict__' of 'InfoTracker' objects>, '__weakref__': <attribute '__weakref__' of 'InfoTracker' objects>, '__annotations__': {}})
- __module__ = 'rldurham'
- __weakref__
list of weak references to the object
- plot(show=True, ax=None, key='recorder', ignore_empty=True, clear=True, length=False, r_sum=False, r_mean=False, r_std=False, length_=False, r_sum_=False, r_mean_=False, r_std_=False)[source]
Plot statistics recorded by Recorder, for example:
>>> info_tracker.plot(r_mean_=True, r_std_=True, r_sum=dict(linestyle=':', marker='x'))
- Parameters:
show – call plt.show at the end
ax – axis to plot to
key – key used to record stats
ignore_empty – don’t plot if info is empty
clear – clear IPython output before showing plot
length – plot “length” stats (see Recorder): bool or kwargs for plt.plot
r_sum – plot “r_sum” stats (see Recorder): bool or kwargs for plt.plot
r_mean – plot “r_mean” stats (see Recorder): bool or kwargs for plt.plot
r_std – plot “r_std” stats (see Recorder): bool or kwargs for plt.plot
length – plot “length_” stats (see Recorder): bool or kwargs for plt.plot
r_sum – plot “r_sum_” stats (see Recorder): bool or kwargs for plt.plot
r_mean – plot “r_mean_” stats (see Recorder): bool or kwargs for plt.plot
r_std – plot “r_std_” stats (see Recorder): bool or kwargs for plt.plot
- Returns:
None if ax was provided else (fig, ax)