PlasmaCalcs.hookups.eppic.eppic_plotters.eppic_plotters_save.EppicPlotterManagerSave
- class PlasmaCalcs.hookups.eppic.eppic_plotters.eppic_plotters_save.EppicPlotterManagerSave
Bases:
PlotterManagereppic plotting routines by Save.Consider using EppicCalculator.make_plots(who=’save’) to make all the plots.- __init__()
Methods
__init__()get_plotter(name[, who])get_plotters([who, kind, name, all_whos, ...])plot(name[, who, save, show, close])plot_moment1_specie0(**kw_plot_settings)save_plots([kind, who, name, all_whos, ...])Attributes
KNOWN_PATTERNSKNOWN_PLOTTERSKNOWN_SETTERSKNOWN_VARSUNIQUE_PLOTTERScls_behavior_attrsknown_patternknown_plotterknown_setterknown_var- get_plotter(name, who=UNSET)
- gets the Plotter associated with this name and who.Roughly equivalent: self.KNOWN_PLOTTERS[(name, who)]
- name: str or Plotter
- name of the plotter to use, or a Plotter instance.
- who: UNSET, None, or str
- person associated with the plotter.UNSET –> use the plotter with this name; crash if found multiple same-named plotters.
see also: self.get_plotters(), which is good if you don’t know ‘who’, or want multiple plotters.
- get_plotters(who=UNSET, kind=UNSET, *, name=None, all_whos=UNSET, all_kinds=UNSET, skip_who=[], skip_kinds=[], min_cost=None, max_cost=None, sortby=None, returns='plotters')
- return list of all plotters associated with these inputs.If called with no inputs, just returns a copy of self.UNIQUE_PLOTTERS.
- who: UNSET, None, str, or list.
- person associated with the plotter.UNSET –> include plotters regardless of ‘who’.None –> require len(plotter.who) == 0.str –> require this name to be in plotter.who.list –> require at least one of these to be in plotter.who(or, if None in list, allow len(plotter.who)==0, too)
- kind: UNSET, str, or list.
- kind associated with the plotter.UNSET –> include plotters regardless of ‘kind’.str –> require this kind to be in plotter.kinds.list –> require at least one of these to be in plotter.kinds.
- name: None or str
- plotter name. E.g. ‘deltafrac_n’.None –> include all plotters regardless of ‘name’.
- all_whos: UNSET or list.
- include only plotters with ALL of these people in plotter.who.
- all_kinds: UNSET or str.
- include only plotters with ALL of these kinds in plotter.kinds.
- skip_who: list
- exclude plotters with any of these people in plotter.who.
- skip_kinds: list
- exclude plotters with any of these kinds in plotter.kinds.
- min_cost: None or number
- exclude plotters with cost < min_cost.None –> no minimum.
- max_cost: None or number
- exclude plotters with cost > max_cost.None –> no maximum.
- sortby: None or ‘cost’
- tells how to sort the result (if returns==’plotters’).None –> keep in order they appear in self.UNIQUE_PLOTTERS.‘cost’ –> sort by plotter.cost values.
- returns: ‘plotters’, ‘names’, ‘who’, ‘kind’, or ‘kinds’
- ‘plotters’ –> returns list of plotters‘names’ –> returns set of all names associated with at least 1 plotter in result.‘who’ –> returns set of all people associated with at least 1 plotter in result.‘kind’ or ‘kinds’ –> returns set of all kinds associated with at least 1 plotter in result.
- plot(name, who=UNSET, *, save=False, show=False, close=False, **kw_plotter)
- makes a single plot using the relevant plotter.
- name: str or Plotter
- name of the plotter to use, or a Plotter instance.(if Plotter, use directly and ignore ‘who’ input.)
- who: UNSET, None, or str
- person associated with the plotter.UNSET –> use the plotter with this name; crash if found multiple same-named plotters.
- save: bool, str, or dict.
- whether to save figure after calling plotter.str –> filename=save.format(name=name, savename=savename), instead of default filename=name.dict –> pass to saver as kwargs. Use kwarg ‘dst’ to also provide filename.if plotter.ani, saver is movie_obj.ani(), else saver is plt.savefig().
- show: bool
- whether to plt.show() after making plot (and, after save).if show when ani==True, return movie_obj.ani() (so it will display in jupyter)
- close: bool
- whether to plt.show() after making plot (and, after save).if show when ani==True, return movie_obj.ani() (so it will display in jupyter)
additional kwargs go to plotter.plot(…)see also: self.get_plotters(), self.save_plots().
- plot_moment1_specie0(**kw_plot_settings)
- plot the first moment of the simulation for specie0
- save_plots(kind=UNSET, who=UNSET, *, name=None, all_whos=UNSET, all_kinds=UNSET, skip_who=[], skip_kinds=[], min_cost=None, max_cost=None, dst='{savename}', save_log=True, log_extras=[], kw_save={}, bbox_inches=UNSET, dpi=UNSET, show=False, close=True, print_freq=0, **kw_plotter)
- saves all plots from plotters associated with these inputs.returns dict of {plotter: plotter result} for all plotters called.Consider checking self.get_plotters() first to learn which plotters will be included.For choosing which plotters to include:
- kind: UNSET, str, or list.
- kind associated with the plotter.UNSET –> include plotters regardless of ‘kind’.str –> require this kind to be in plotter.kinds.list –> require at least one of these to be in plotter.kinds.
- who: UNSET, None, str, or list.
- person associated with the plotter.UNSET –> include plotters regardless of ‘who’.None –> require len(plotter.who) == 0.str –> require this name to be in plotter.who.list –> require at least one of these to be in plotter.who(or, if None in list, allow len(plotter.who)==0, too)
- name: None or str
- plotter name. E.g. ‘deltafrac_n’.None –> include all plotters regardless of ‘name’.
- all_whos: UNSET or list.
- include only plotters with ALL of these people in plotter.who.
- all_kinds: UNSET or str.
- include only plotters with ALL of these kinds in plotter.kinds.
- skip_who: list
- exclude plotters with any of these people in plotter.who.
- skip_kinds: list
- exclude plotters with any of these kinds in plotter.kinds.
- min_cost: None or number
- exclude plotters with cost < min_cost.None –> no minimum.
- max_cost: None or number
- exclude plotters with cost > max_cost.None –> no maximum.
For plotting:- dst: str
- where to save plots to. Hit by dst.format(name=plotter.name, savename=plotter.savename).if not abspath, save to os.path.join(self.unique_notes_dirname, dst) if possible,else save to dst within current directory.
- save_log: bool or str
- whether to save a log of plot progress to _save_plots_log.txt file.str –> save to this file name. If not abspath, put it in dir implied by dst (see above).The log tells current datetime, version info about PlasmaCalcs, and plot timing updates.
- log_extras: list of str
- extra lines to put in the log “header”, if doing save_log.
- kw_save: dict
- kwargs to pass to plotter.save(…)
- bbox_inches: UNSET or any value
- if provided, added to kw_save.
- dpi: UNSET or any value
- if provided, added to kw_save.
- show: bool
- whether to plt.show() after making plot (and, after save).if show when ani==True, return movie_obj.ani() (so it will display in jupyter)
- close: bool
- whether to plt.show() after making plot (and, after save).if show when ani==True, return movie_obj.ani() (so it will display in jupyter)
additional kwargs go to plotter.plot(…)Misc:- print_freq: number
- minimum seconds between printing progress updates.-1 –> never print; 0 –> always print.
see also: self.get_plotters(), self.plot().