Configuration (ipyflow.config)
ipyflow’s per-session behavior is governed by a handful of enums and the
MutableDataflowSettings dataclass that holds them. Each
enum has a default (used when an unrecognized value is supplied) and a
corresponding %flow subcommand.
Settings can be changed at runtime with the %flow magic
(The %flow magic), read or written on flow().mut_settings, or set as
defaults in your IPython profile via c.ipyflow.<name> = ....
Enum ↔ %flow subcommand
Enum |
Default |
|
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Enums
- class ipyflow.config.ExecutionMode(*values)[source]
Whether executing a cell also re-runs its stale dependencies.
Set with
%flow mode.LAZYis the default and matches stockipykernel(only the executed cell runs);REACTIVEadditionally re-runs stale upstream and downstream cells in dependency order.- LAZY = 'lazy'
- REACTIVE = 'reactive'
- class ipyflow.config.ExecutionSchedule(*values)[source]
How the set of cells to (re-)run is computed.
Set with
%flow schedule.DAG_BASED(the default) uses the dynamic dataflow graph;LIVENESS_BASEDuses static liveness analysis of cell source;HYBRID_DAG_LIVENESS_BASEDcombines both and is required for incremental reactivity.- LIVENESS_BASED = 'liveness_based'
- DAG_BASED = 'dag_based'
- HYBRID_DAG_LIVENESS_BASED = 'hybrid_dag_liveness_based'
- class ipyflow.config.FlowDirection(*values)[source]
Which dependency edges may drive reactive execution.
Set with
%flow direction.IN_ORDER(the default) only lets a cell trigger cells that appear after it in the notebook;ANY_ORDERignores spatial position.- ANY_ORDER = 'any_order'
- IN_ORDER = 'in_order'
- class ipyflow.config.ReactivityMode(*values)[source]
Whether reactive updates are applied all at once or one cell at a time.
Set with
%flow reactivity.BATCH(the default) recomputes the whole affected set together;INCREMENTALapplies updates one step at a time and requires a liveness-awareExecutionSchedule.- BATCH = 'batch'
- INCREMENTAL = 'incremental'
- class ipyflow.config.Highlights(*values)[source]
Which cells the frontend visually highlights.
Set with
%flow hls/%flow nohls.EXECUTED(the default) highlights cells that ran;REACTIVEhighlights reactive updates;ALLandNONEshow everything or nothing.- ALL = 'all'
- NONE = 'none'
- EXECUTED = 'executed'
- REACTIVE = 'reactive'
Settings
The mutable per-session settings live on flow().mut_settings. Beyond the enums
above it exposes toggles such as dataflow_enabled, static_slicing_enabled,
dynamic_slicing_enabled, warn_out_of_order_usages, and
syntax_transforms_enabled.
- class ipyflow.config.MutableDataflowSettings(dataflow_enabled: bool, trace_messages_enabled: bool, highlights: ipyflow.config.Highlights, interface: ipyflow.config.Interface, static_slicing_enabled: bool, dynamic_slicing_enabled: bool, exec_mode: ipyflow.config.ExecutionMode, exec_schedule: ipyflow.config.ExecutionSchedule, flow_order: ipyflow.config.FlowDirection, reactivity_mode: ipyflow.config.ReactivityMode, push_reactive_updates: bool, push_reactive_updates_to_cousins: bool, pull_reactive_updates: bool, color_scheme: ipyflow.config.ColorScheme, warn_out_of_order_usages: bool, lint_out_of_order_usages: bool, syntax_transforms_enabled: bool, syntax_transforms_only: bool, max_external_call_depth_for_tracing: int, is_dev_mode: bool)[source]