Skip to content

Initialization/Automatic Cells #7262

Open

Description

I'm a bit surprised that this feature hasn't been requested in this form already. Forgive me if I'm mistaken and there's already an open issue requesting the same feature.

I would find the following feature useful: One or more cells of a notebook can be marked as initialization cells or automatic cells. I'll call them automatic cells in the rest of this issue because the use case I have in mind goes beyond "initialization".

Whenever a cell in a notebook is run, all pending automatic cells before the cell to be run are also run. A pending cell is a cell has not been run after it has been modified. When the kernel restarts, all cells are considered pending.

The use case I have in mind is as follows: I can mostly group the cells in my notebooks into 3 categories:

  • Global initialization: These are imports and method calls to configure the libraries I'm using.
  • Definitions: These are assignments to global variables and method definitions.
  • The rest: The cells where I call methods to produce graphs and other output or where I write output to the file system.

I would mark the cells in the first two categories as automatic cells. This would solve the problem of editing definitions without running each modified cell. When editing function definitions and adding imports, I often jump between cells and make modifications in multiple places. Rememberig to run each modified cells at the end is hard to impossible for me.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions