GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix Gather and update py analysis (#7539) · tmayor/pythonVSCode@51cdc7e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • build/ci
    • postInstall.js
  • package-lock.json
  • package.datascience-ui.dependencies.json
  • package.json
  • pythonFiles/datascience
    • getJupyterVariableDataFrameInfo.py
    • getJupyterVariableDataFrameRows.py
    • getJupyterVariableList.py
    • getJupyterVariableValue.py
    • getServerInfo.py
  • src/client/datascience
    • gather
      • gather.ts
    • interactive-common
      • interactiveBase.ts
    • jupyter
      • jupyterNotebook.ts
    • types.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎build/ci/postInstall.js‎

Copy file name to clipboardExpand all lines: build/ci/postInstall.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var constants_1 = require("../constants");
1414
* The solution is to modify the type definition file after `npm install`.
1515
*/
1616
function fixJupyterLabDTSFiles() {
17-
var relativePath = path.join('node_modules', '@jupyterlab', 'services', 'node_modules', '@jupyterlab', 'coreutils', 'lib', 'settingregistry.d.ts');
17+
var relativePath = path.join('node_modules', '@jupyterlab', 'coreutils', 'lib', 'settingregistry.d.ts');
1818
var filePath = path.join(constants_1.ExtensionRootDir, relativePath);
1919
if (!fs.existsSync(filePath)) {
2020
throw new Error("Type Definition file from JupyterLab not found '" + filePath + "' (pvsc post install script)");
Collapse file

‎package-lock.json‎

Copy file name to clipboardExpand all lines: package-lock.json
+413-405Lines changed: 413 additions & 405 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎package.datascience-ui.dependencies.json‎

Copy file name to clipboardExpand all lines: package.datascience-ui.dependencies.json
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"replace-ext",
4444
"resize-observer-polyfill",
4545
"scheduler",
46-
"tslib",
4746
"warning",
4847
"character-entities-legacy",
4948
"character-reference-invalid",
@@ -86,7 +85,6 @@
8685
"escape-carriage",
8786
"extend",
8887
"fast-plist",
89-
"fbjs",
9088
"inherits",
9189
"is-alphabetical",
9290
"is-alphanumerical",
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2599,7 +2599,8 @@
25992599
},
26002600
"dependencies": {
26012601
"@jupyterlab/services": "^3.2.1",
2602-
"@msrvida/python-program-analysis": "0.0.5",
2602+
"@msrvida/python-program-analysis": "^0.2.6",
2603+
"@blueprintjs/select": "3.10.0",
26032604
"ansi-regex": "^4.1.0",
26042605
"arch": "^2.1.0",
26052606
"azure-storage": "^2.10.3",
Collapse file

‎pythonFiles/datascience/getJupyterVariableDataFrameInfo.py‎

Copy file name to clipboardExpand all lines: pythonFiles/datascience/getJupyterVariableDataFrameInfo.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# %DATASCIENCE_INTERNAL_KEY%
21
# Query Jupyter server for the info about a dataframe
32
import json as _VSCODE_json
43
import pandas as _VSCODE_pd
Collapse file

‎pythonFiles/datascience/getJupyterVariableDataFrameRows.py‎

Copy file name to clipboardExpand all lines: pythonFiles/datascience/getJupyterVariableDataFrameRows.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#%DATASCIENCE_INTERNAL_KEY%#
21
# Query Jupyter server for the rows of a data frame
32
import json as _VSCODE_json
43
import pandas as _VSCODE_pd
Collapse file

‎pythonFiles/datascience/getJupyterVariableList.py‎

Copy file name to clipboardExpand all lines: pythonFiles/datascience/getJupyterVariableList.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#%DATASCIENCE_INTERNAL_KEY%#
21
# Query Jupyter server for defined variables list
32
# Tested on 2.7 and 3.6
43
from sys import getsizeof as _VSCODE_getsizeof
Collapse file

‎pythonFiles/datascience/getJupyterVariableValue.py‎

Copy file name to clipboardExpand all lines: pythonFiles/datascience/getJupyterVariableValue.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#%DATASCIENCE_INTERNAL_KEY%#
21
import sys as VC_sys
32
import locale as VC_locale
43

Collapse file

‎pythonFiles/datascience/getServerInfo.py‎

Copy file name to clipboardExpand all lines: pythonFiles/datascience/getServerInfo.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#%DATASCIENCE_INTERNAL_KEY%#
21
# Copyright (c) Microsoft Corporation. All rights reserved.
32
# Licensed under the MIT License.
43

Collapse file

‎src/client/datascience/gather/gather.ts‎

Copy file name to clipboardExpand all lines: src/client/datascience/gather/gather.ts
+12-14Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DataflowAnalyzer } from '@msrvida/python-program-analysis';
2-
import { JupyterCell as ICell, LabCell } from '@msrvida/python-program-analysis/lib/cell';
3-
import { CellSlice } from '@msrvida/python-program-analysis/lib/cellslice';
4-
import { ExecutionLogSlicer } from '@msrvida/python-program-analysis/lib/log-slicer';
2+
import { Cell as ICell, LogCell } from '@msrvida/python-program-analysis/dist/es5/cell';
3+
import { CellSlice } from '@msrvida/python-program-analysis/dist/es5/cellslice';
4+
import { ExecutionLogSlicer } from '@msrvida/python-program-analysis/dist/es5/log-slicer';
55

66
import { inject, injectable } from 'inversify';
77
// tslint:disable-next-line: no-require-imports
@@ -15,7 +15,7 @@ import { Common } from '../../common/utils/localize';
1515
import { noop } from '../../common/utils/misc';
1616
import { CellMatcher } from '../cellMatcher';
1717
import { concatMultilineString } from '../common';
18-
import { CellState, ICell as IVscCell, IGatherExecution, INotebookExecutionLogger, internalUseCellKey } from '../types';
18+
import { CellState, ICell as IVscCell, IGatherExecution, INotebookExecutionLogger } from '../types';
1919

2020
/**
2121
* An adapter class to wrap the code gathering functionality from [microsoft/python-program-analysis](https://www.npmjs.com/package/@msrvida/python-program-analysis).
@@ -34,11 +34,10 @@ export class GatherExecution implements IGatherExecution, INotebookExecutionLogg
3434
) {
3535
this._enabled = this.configService.getSettings().datascience.enableGather ? true : false;
3636

37-
const rules = this.configService.getSettings().datascience.gatherRules;
38-
this.dataflowAnalyzer = new DataflowAnalyzer(rules);
37+
this.dataflowAnalyzer = new DataflowAnalyzer();
3938
this._executionSlicer = new ExecutionLogSlicer(this.dataflowAnalyzer);
4039

41-
if (this.enabled) {
40+
if (this._enabled) {
4241
this.disposables.push(this.configService.getSettings().onDidChange(e => this.updateEnableGather(e)));
4342
}
4443

@@ -51,9 +50,10 @@ export class GatherExecution implements IGatherExecution, INotebookExecutionLogg
5150
}
5251

5352
public async postExecute(vscCell: IVscCell, _silent: boolean): Promise<void> {
54-
if (this.enabled) {
55-
// Don't log if vscCell.data.source is an empty string. Original Jupyter extension also does this.
56-
if (vscCell.data.source !== '') {
53+
if (this._enabled) {
54+
// Don't log if vscCell.data.source is an empty string or if it was
55+
// silently executed. Original Jupyter extension also does this.
56+
if (vscCell.data.source !== '' && !_silent) {
5757
// First make a copy of this cell, as we are going to modify it
5858
const cloneCell: IVscCell = cloneDeep(vscCell);
5959

@@ -62,12 +62,10 @@ export class GatherExecution implements IGatherExecution, INotebookExecutionLogg
6262
cloneCell.data.source = cellMatcher.stripFirstMarker(concatMultilineString(vscCell.data.source));
6363

6464
// Convert IVscCell to IGatherCell
65-
const cell = convertVscToGatherCell(cloneCell) as LabCell;
65+
const cell = convertVscToGatherCell(cloneCell) as LogCell;
6666

6767
// Call internal logging method
68-
if (!cloneCell.data.source.startsWith(internalUseCellKey)) {
69-
this._executionSlicer.logExecution(cell);
70-
}
68+
this._executionSlicer.logExecution(cell);
7169
}
7270
}
7371
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.