microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.26k stars 278 forks source link

Freeze and protect cell / skip execution #1308

Open sapphire008 opened 4 years ago

sapphire008 commented 4 years ago

Feature: Notebook Editor, Interactive Window, Python Editor cells

Description

The unofficial Jupyter notebook extension have a "Freeze" extension. I am wondering if the team can add this feature to the notebook extension. It has 3 modes:

Use cases:

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

joyceerhl commented 4 years ago

Thanks for the feature request! We'll discuss this at our upcoming triage 😊

mmcguffi commented 2 years ago

Im assuming this didnt pass triage? :) I really appreciated this ability when I used Jupyter in my browser -- VScode support would be very helpful

DonJayamanne commented 2 years ago

Screen Shot 2022-08-22 at 14 03 32

sapphire008 commented 1 year ago

@DonJayamanne The screenshot above seems to be consistent with how Freeze implemented the cell freezing capabilities, based on this script:

 function patch_CodeCell_execute () {
      console.log('[Freeze] patching CodeCell.prototype.execute');
      var old_execute = CodeCell.prototype.execute;

      CodeCell.prototype.execute = function () {
          if (this.metadata.run_control === undefined ||
              !this.metadata.run_control.frozen
          ) {
              old_execute.apply(this, arguments);
          }
      };
  }

Although I can read the script itself, I have never developed in JavaScript in the past. So I have zero confidence in my ability to create a PR for this feature. But I am willing to work with anyone that knows JavaScript + VSCode Jupyter Extension.

eromoe commented 11 months ago

Would be good to add : skip some cell when run all but runable when run single cell

simonrouse9461 commented 3 months ago

Any update on this? Honoring official Jupyter metadata will be really helpful. Especially the deletable and editable.