bertini.tracking.observers.multiple

Observers built to watch a fixed-multiple precision tracker

class bertini.tracking.observers.multiple.CallbackObserver((object)arg1)

Bases: CustomObserver

Observer that routes events to registered Python callables.

The event type passed to on() may be an event class, a tuple of classes, or simply the event’s name as a string (resolved against this observer’s own precision):

obs = CallbackObserver()
obs.on("TrackingStarted", lambda e: print("tracking started"))
obs.on("PrecisionChanged",
       lambda e: print(e.previous(), "->", e.next()))
tracker.add_observer(obs)
tracker.track_path(...)
tracker.remove_observer(obs)
Observe(event)
__init__((object)arg1) None
on(event_type, callback)

Register callback for events of event_type.

event_type may be an event class, a tuple of classes, or the event name as a string. Returns self for chaining.

class bertini.tracking.observers.multiple.CustomObserver((object)arg1)

Bases: AnyAbstractObserver

__init__((object)arg1) None
class bertini.tracking.observers.multiple.FailedStep

Bases: TrackingEvent

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python

class bertini.tracking.observers.multiple.FirstPrecisionRecorder((object)arg1)

Bases: CustomObserver

__init__((object)arg1) None
class bertini.tracking.observers.multiple.GoryDetailLogger((object)arg1)

Bases: CustomObserver

__init__((object)arg1) None
class bertini.tracking.observers.multiple.InfinitePathTruncation

Bases: TrackingEvent

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python

class bertini.tracking.observers.multiple.PathCollectionObserver((object)arg1)

Bases: CustomObserver

A meta-observer: collects every path of a multi-path run.

Attach one of these to a tracker (e.g. zd.get_tracker()) before a solve. Each time the tracker starts a path it spins up a fresh PathDataCollector, attaches it, and – when the path ends – harvests it into series and detaches it. Attaching/detaching happens from inside Observe and relies on the observable deferring those mutations until the current notification finishes.

After the run, series is a list of finished PathDataCollector objects, one per path, in the order the tracker ran them:

a = PathCollectionObserver()
zd.get_tracker().add_observer(a)
zd.solve()
for path in a.series:
    t, z = path.times(), path.points()
    ...
Observe(event)
__init__((object)arg1) None
class bertini.tracking.observers.multiple.PathDataCollector((object)arg1)

Bases: CustomObserver

Collects one tracked path into a time series, for plotting.

Attach to a tracker; on every successful step it records the time, the space point, and a few step diagnostics. Because an adaptive-precision tracker hands back arbitrary-precision (mpfr) numbers – which do not pack into a single numpy array – every value is cast to a plain python complex/float as it is collected (double precision is plenty for a picture). The collected data is offered as several typed numpy arrays (or, optionally, a pandas DataFrame):

b = PathDataCollector()
tracker.add_observer(b)
tracker.track_path(...)
tracker.remove_observer(b)
t   = b.times()          # complex, shape (n_steps,)
z   = b.points()         # complex, shape (n_steps, n_vars)
dgn = b.diagnostics()    # float,   shape (n_steps, 4): |t|, cond, prec, stepsize
DIAGNOSTIC_COLUMNS = ('abs_t', 'condition_number', 'precision', 'stepsize')
Observe(event)
__init__((object)arg1) None
as_dataframe()

Return the whole path as a pandas DataFrame with named columns.

Requires pandas (pip install pandas). Columns: t (complex), one z{i} (complex) per variable, then the diagnostic columns.

diagnostics()
points()
times()
class bertini.tracking.observers.multiple.PrecisionChanged

Bases: TrackingEvent

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python

next((PrecisionChanged)arg1) int
previous((PrecisionChanged)arg1) int
class bertini.tracking.observers.multiple.PrecisionDecreased

Bases: PrecisionChanged

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python

class bertini.tracking.observers.multiple.PrecisionIncreased

Bases: PrecisionChanged

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python

class bertini.tracking.observers.multiple.StepsizeDecreased

Bases: TrackingEvent

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python

class bertini.tracking.observers.multiple.StepsizeIncreased

Bases: TrackingEvent

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python

class bertini.tracking.observers.multiple.SuccessfulStep

Bases: TrackingEvent

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python

class bertini.tracking.observers.multiple.TrackingEnded

Bases: TrackingEvent

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python

class bertini.tracking.observers.multiple.TrackingEvent

Bases: AnyEvent

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python

tracker((TrackingEvent)arg1) bertini._pybertini.tracking.MultiplePrecisionTracker
class bertini.tracking.observers.multiple.TrackingStarted

Bases: TrackingEvent

Raises an exception This class cannot be instantiated from Python

__init__()

Raises an exception This class cannot be instantiated from Python