Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 31, 2019

Conversation

DavidKutu
Copy link

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'
@DavidKutu DavidKutu self-assigned this Oct 31, 2019
@codecov-io
Copy link

codecov-io commented Oct 31, 2019

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.

@@ -401,6 +401,9 @@ export class MainStateController implements IMessageHandler {
const newList = this.pendingState.cellVMs.map(cellVM => {
return immutable.updateIn(cellVM, ['cell', 'data', 'outputs'], () => []);
});
newList.forEach(cellVM => {
cellVM.cell.data.execution_count = null;
Copy link
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

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

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
Member

Choose a reason for hiding this comment

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

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, @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.

Choose a reason for hiding this comment

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

Sorry @DavidKutu

Copy link
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?

Copy link
Member

@IanMatthewHuff IanMatthewHuff left a comment

Choose a reason for hiding this comment

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

🕐

Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

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

🕐

@DavidKutu DavidKutu closed this Oct 31, 2019
@DavidKutu DavidKutu deleted the davidkutu/clear_execution_count branch October 31, 2019 20:42
@DonJayamanne
Copy link

oops

Copy link

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

Oops

@@ -401,6 +401,9 @@ export class MainStateController implements IMessageHandler {
const newList = this.pendingState.cellVMs.map(cellVM => {
return immutable.updateIn(cellVM, ['cell', 'data', 'outputs'], () => []);
});
newList.forEach(cellVM => {
cellVM.cell.data.execution_count = null;

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, @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.

@@ -401,6 +401,9 @@ export class MainStateController implements IMessageHandler {
const newList = this.pendingState.cellVMs.map(cellVM => {
return immutable.updateIn(cellVM, ['cell', 'data', 'outputs'], () => []);
});
newList.forEach(cellVM => {
cellVM.cell.data.execution_count = null;

Choose a reason for hiding this comment

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

Sorry @DavidKutu

@DavidKutu DavidKutu restored the davidkutu/clear_execution_count branch October 31, 2019 21:31
@DavidKutu DavidKutu reopened this Oct 31, 2019
Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

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

:shipit:

@DavidKutu DavidKutu merged commit 2339983 into master Oct 31, 2019
@DavidKutu 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