bregman.visualizer package

Subpackages

Submodules

bregman.visualizer.visualizer module

class bregman.visualizer.visualizer.BregmanVisualizer(manifold: BregmanManifold)

Bases: ABC

Abstract visualization class. The visualization class allows for different BregmanObjects to be registered for plotting or animation. Then when a visualization call is made, the visualizer class takes care of the back-end plotting procedure.

The ordering of the visualization is the following: First objects are plotted. Then object animations are run. Finally, callbacks functions are evaluated.

Parameters:
  • manifold – Bregman manifold in which geometric objects are being plotted in.

  • plot_list – Objects which are being plotted.

  • animate_list – Objects which are being animated.

  • callback_list – Visualizer callbacks for addition plotting behaviour.

add_callback(callback: VisualizerCallback) None

Add callback function. These are run after plotting and animation routines.

Parameters:

callback – Callback function.

abstract animate_geodesic(coords: Coords, geodesic: Geodesic, **kwargs) None

Back-end animation function for Geodesic objects.

Parameters:
  • coords – Coordinate for object to be animted in.

  • geodesic – Geodesic object to be animated.

  • **kwargs – Additional arguments used for animation.

animate_object(obj: BregmanObject, **kwargs) None

Add object to be animated.

Parameters:
  • obj – Object to be plotted.

  • **kwargs – Additional arguments to be passed into the animation back-end.

abstract plot_bisector(coords: Coords, bisector: Bisector, **kwargs) None

Back-end plotting function for Bisector objects.

Parameters:
  • coords – Coordinate for object to be plotted in.

  • bisector – Bisector object to be plotted.

  • **kwargs – Additional arguments used for plotting.

abstract plot_geodesic(coords: Coords, geodesic: Geodesic, **kwargs) None

Back-end plotting function for Geodesic objects.

Parameters:
  • coords – Coordinate for object to be plotted in.

  • geodesic – Geodesic object to be plotted.

  • **kwargs – Additional arguments used for plotting.

plot_object(obj: BregmanObject, **kwargs) None

Add object to be plotted.

Parameters:
  • obj – Object to be plotted.

  • **kwargs – Additional arguments to be passed into the plotting back-end.

abstract plot_point(coords: Coords, point: Point, **kwargs) None

Back-end plotting function for Point objects.

Parameters:
  • coords – Coordinate for object to be plotted in.

  • point – Point object to be plotted.

  • **kwargs – Additional arguments used for plotting.

run_callbacks(obj: BregmanObject, coords: Coords, **kwarg) None

Run all callback function on specific object.

Parameters:
  • obj – Object callback functions are being evaluated on.

  • coords – Coordinates the callback functions are being evaluated on.

  • **kwarg – Additional arguments passed to callback function.

visualize(coords: Coords) None

Visualize all registered plots and animations.

The ordering of the visualization is the following: First objects are plotted. Then object animations are run. Finally, callbacks functions are evaluated.

Parameters:

coords – Coordinate the visualization is being made in.

exception bregman.visualizer.visualizer.NoAnimationRoutine

Bases: Exception

Exception for when an object is called to be animated but no subroutine is defined for it.

exception bregman.visualizer.visualizer.NoPlottingRoutine

Bases: Exception

Exception for when an object is called to be plotted but no subroutine is defined for it.

class bregman.visualizer.visualizer.VisualizerCallback

Bases: ABC, Generic[TVisualizer]

Visualizer callback function abstract class. Used to define callback functions in a visualizer.

abstract call(obj: BregmanObject, coords: Coords, visualizer: TVisualizer, **kwargs) None

Function call for the callback function.

Parameters:
  • obj – Object callback functions are being evaluated on.

  • coords – Coordinates the callback functions are being evaluated on.

  • visualizer – Visualizer the callback is being called in.

  • **kwarg – Additional arguments passed to callback function.

Module contents