Skip to content

clear execution count of all cells when user presses 'Clear All Output' - #8318

Merged
David Kutugata (DavidKutu) merged 2 commits into
masterfrom
davidkutu/clear_execution_count
Oct 31, 2019
Merged

David Kutugata (DavidKutu) merged 2 commits into
masterfrom
davidkutu/clear_execution_count

Conversation

@DavidKutu

Copy link
Copy Markdown

For #7853

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Appropriate comments and documentation strings in the code
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated
  • Test plan is updated as appropriate
  • package-lock.json has been regenerated by running npm install (if dependencies have changed)
  • The wiki is updated with any design decisions/details.

presses 'Clear All Output'
@codecov-io

Codecov (codecov-io) commented Oct 31, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #8318 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8318      +/-   ##
==========================================
- Coverage   59.33%   59.33%   -0.01%     
==========================================
  Files         504      505       +1     
  Lines       23096    23147      +51     
  Branches     3737     3745       +8     
==========================================
+ Hits        13704    13734      +30     
- Misses       8500     8520      +20     
- Partials      892      893       +1
Impacted Files Coverage Δ
...client/datascience/jupyter/jupyterCommandFinder.ts 72.09% <0%> (-3.67%) ⬇️
src/client/datascience/jupyter/jupyterDebugger.ts 10.47% <0%> (-0.27%) ⬇️
src/client/debugger/extension/serviceRegistry.ts 100% <0%> (ø) ⬆️
src/client/debugger/extension/types.ts 100% <0%> (ø) ⬆️
src/client/debugger/extension/adapter/activator.ts 100% <0%> (ø) ⬆️
src/client/debugger/extension/adapter/logging.ts 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa9c62c...878085c. Read the comment docs.

return immutable.updateIn(cellVM, ['cell', 'data', 'outputs'], () => []);
});
newList.forEach(cellVM => {
cellVM.cell.data.execution_count = null;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't Don just add this? Also this would need to use the immutable functions.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah or make a copy of all of the cells. Something like so:

const newList = this.pendingState.cellVMs.map(cellVM => {
return {...celVM, cell: {...cellVM.cell, data: {...cellVM.cell.data, execution_count: null, outputs: []}}};
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meaning you should set the execution count at the same time you clear the outputs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the review where don already added this:
https://github.com/microsoft/vscode-python/pull/8315/files

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't Don just add this? Also this would need to use the immutable functions.

Yes & no. I started working on this (forgot to assign to myself). When I went to assign it, David Kutugata (@DavidKutu) had it.

Here is the review where don already added this:
https://github.com/microsoft/vscode-python/pull/8315/files

Oops, used the same branch of code.
Didn't mean to work on it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you review again?

@IanMatthewHuff Ian Huff (IanMatthewHuff) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@DavidKutu
David Kutugata (DavidKutu) deleted the davidkutu/clear_execution_count branch October 31, 2019 20:42
@DonJayamanne

Copy link
Copy Markdown

oops

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

return immutable.updateIn(cellVM, ['cell', 'data', 'outputs'], () => []);
});
newList.forEach(cellVM => {
cellVM.cell.data.execution_count = null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't Don just add this? Also this would need to use the immutable functions.

Yes & no. I started working on this (forgot to assign to myself). When I went to assign it, David Kutugata (@DavidKutu) had it.

Here is the review where don already added this:
https://github.com/microsoft/vscode-python/pull/8315/files

Oops, used the same branch of code.
Didn't mean to work on it.

return immutable.updateIn(cellVM, ['cell', 'data', 'outputs'], () => []);
});
newList.forEach(cellVM => {
cellVM.cell.data.execution_count = null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidKutu
David Kutugata (DavidKutu) restored the davidkutu/clear_execution_count branch October 31, 2019 21:31

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@DavidKutu
David Kutugata (DavidKutu) merged commit 2339983 into master Oct 31, 2019
@DavidKutu
David Kutugata (DavidKutu) deleted the davidkutu/clear_execution_count branch October 31, 2019 23:02
@lock lock Bot locked as resolved and limited conversation to collaborators Nov 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants