Model accessors (ipyflow.models)
These functions, also re-exported from the top-level ipyflow package, are the
entry points to ipyflow’s data model. Most return a class whose classmethods
query the whole graph; a few return a specific instance relative to the active
cell.
Two accessors are overloaded. cells() with no argument returns the
Cell class, while cells(cell_id) returns a
single Cell; likewise symbols() returns the
Symbol class, while symbols(sym) passes an
instance through unchanged.
- ipyflow.models.cells(cell_id: None = None) Type['Cell'][source]
- ipyflow.models.cells(cell_id: IdType) Cell
Access the
Cellmodel.Called with no argument, returns the
Cellclass, whose classmethods (at_counter,from_id,current_cell, …) query all cells. Called with acell_id– either an execution counter (int) or a frontend cell id – returns that specificCellinstance.
- ipyflow.models.cell_above() Cell | None[source]
Return the cell immediately above the active cell, or
None.
- ipyflow.models.cell_below() Cell | None[source]
Return the cell immediately below the active cell, or
None.
- ipyflow.models.cell_at_offset(offset: int) Cell | None[source]
Return the cell
offsetpositions from the active cell (may be negative).
- ipyflow.models.last_run_cell() Cell | None[source]
Return the most recently executed cell, or
Noneif none have run.
- ipyflow.models.symbols(sym: None = None) Type['Symbol'][source]
- ipyflow.models.symbols(sym: Symbol) Symbol
Access the
Symbolmodel.Called with no argument, returns the
Symbolclass; called with aSymbolinstance, returns it unchanged. The pass-through form is a convenience for generic code that accepts either the class or an instance.
See also
Data model for the classes these accessors expose.