Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Hotfix for v2.4.2#222

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
minjk-bl merged 6 commits intovisualpython:devopsfromminjk-bl:devops
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,3 +6,4 @@ jupyternotebook/visualpython
colab/visualpython
test/
.gitignore
visualpython/js/com/com_Config.js
Binary file modifiedjupyterlab/.jupyterlite.doit.db
View file
Open in desktop
Binary file not shown.
24 changes: 22 additions & 2 deletionsvisualpython/js/com/com_Config.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -296,6 +296,7 @@ define([
* - automatically restart on jupyter kernel restart (loadVisualpython.js)
*/
readKernelFunction() {
let that = this;
// CHROME: change method to load py files ($.get -> require)
return new Promise(function(resolve, reject) {
var libraryList = [
Expand All@@ -314,7 +315,26 @@ define([
libraryList.forEach(libCode => {
promiseList.push(vpKernel.execute(libCode, true));
});


if (that.extensionType === 'lite') {
let preInstallCode = '';
let preInstallPackList = [
'seaborn',
'plotly',
'scikit-learn',
'scipy',
'statsmodels'
];
preInstallPackList.forEach((packName, idx) => {
preInstallCode += '%pip install ' + packName
if (idx < preInstallPackList.length - 1) {
preInstallCode += '\n';
}
});
// pre-install packages
promiseList.push(vpKernel.execute(preInstallCode, true));
}

// run all promises
let failed = false;
Promise.all(promiseList).then(function(resultObj) {
Expand DownExpand Up@@ -918,7 +938,7 @@ define([
'- Save VP Note before refreshing the page.'
];
com_interface.insertCell('markdown', info.join('\n'));
com_interface.insertCell('code', "import piplite\npiplite.install('jupyterlab-visualpython==" + latestVersion + "')");
com_interface.insertCell('code', "%pipinstalljupyterlab-visualpython==" + latestVersion);
}

// update version_timestamp
Expand Down
30 changes: 26 additions & 4 deletionsvisualpython/js/com/component/PackageManager.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,28 @@ define([
'PyMuPDF': { pipName: 'PyMuPDF' },
'sweetviz': { pipName: 'sweetviz' },
}

if (vpConfig.extensionType === 'lite') {
this.packageLibTemplate = {
'numpy': { pipName: 'numpy' },
'pandas': { pipName: 'pandas' },
'matplotlib': { pipName: 'matplotlib' },
'seaborn': { pipName: 'seaborn' },
'plotly': { pipName: 'plotly' },
'sklearn': { pipName: 'scikit-learn' },
'scikit-posthocs': { pipName: 'scikit-posthocs' },
'scipy': { pipName: 'scipy' },
'statsmodels': { pipName: 'statsmodels' },
'factor-analyzer': { pipName: 'factor-analyzer' },
'category_encoders': { pipName: 'category_encoders' },
'imblearn': { pipName: 'imblearn' },
'xgboost': { pipName: 'xgboost' },
'lightgbm': { pipName: 'lightgbm' },
'catboost': { pipName: 'catboost' },
'auto-sklearn': { pipName: 'auto-sklearn' },
'sweetviz': { pipName: 'sweetviz' },
}
}
}

_bindEvent() {
Expand DownExpand Up@@ -148,7 +170,7 @@ define([
var pipName = that.packageLib[key].pipName;
var code = com_util.formatString("!pip uninstall -y {0}", pipName);
if (vpConfig.extensionType === 'lite') {
code = com_util.formatString("import piplite\npiplite.uninstall('{0}')", pipName);
code = com_util.formatString("%pipuninstall{0}", pipName);
}
// create block and run it
$('#vp_wrapper').trigger({
Expand All@@ -162,7 +184,7 @@ define([
var pipName = that.packageLib[key].pipName;
var code = com_util.formatString("!pip install --upgrade {0}", pipName);
if (vpConfig.extensionType === 'lite') {
code = com_util.formatString("%pip install--upgrade{0}", pipName);
code = com_util.formatString("%pip install {0}", pipName);
}
// create block and run it
$('#vp_wrapper').trigger({
Expand DownExpand Up@@ -269,15 +291,15 @@ define([
var pipName = this.packageLib[this.state.selected].pipName;
var code = com_util.formatString("!pip install {0}", pipName);
if (vpConfig.extensionType === 'lite') {
code = com_util.formatString("import piplite\npiplite.install('{0}')", pipName);
code = com_util.formatString("%pipinstall{0}", pipName);
}
if (versionType === 'specified') {
// specified version
let version = $(this.wrapSelector('.vp-inner-popup-version')).val();
if (version && version !== '') {
code = com_util.formatString("!pip install {0}=={1}", pipName, version);
if (vpConfig.extensionType === 'lite') {
code = com_util.formatString("import piplite\npiplite.install('{0}=={1}')", pipName, version);
code = com_util.formatString("%pipinstall{0}=={1}", pipName, version);
}
} else {
$(this.wrapSelector('.vp-inner-popup-version')).focus();
Expand Down
12 changes: 9 additions & 3 deletionsvisualpython/js/m_apps/PDF.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,9 +21,9 @@ define([
'vp_base/js/com/component/FileNavigation'
], function(pdfHtml, pdfCss, com_String, com_interface, PopupComponent, FileNavigation) {

const PDF_SHOW = '!pip show PyMuPDF nltk'
const PDF_INSTALL1 = '!pip install PyMuPDF'
const PDF_INSTALL2 = '!pip install nltk'
var PDF_SHOW = '!pip show PyMuPDF nltk'
var PDF_INSTALL1 = '!pip install PyMuPDF'
var PDF_INSTALL2 = '!pip install nltk'

const PDF_IMPORT = `import pandas as pd
import fitz
Expand DownExpand Up@@ -80,6 +80,12 @@ nltk.download('punkt')`;
vp_pdfReturn: '',
...this.state
}

if (vpConfig.extensionType === 'lite') {
PDF_SHOW = PDF_SHOW.replace('!', '%');
PDF_INSTALL1 = PDF_INSTALL1.replace('!', '%');
PDF_INSTALL2 = PDF_INSTALL2.replace('!', '%');
}
}

_bindEvent() {
Expand Down
18 changes: 15 additions & 3 deletionsvisualpython/js/m_stats/Anova.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -252,7 +252,11 @@ define([
}

if (tukey === true || scheffe === true || duncan === true) {
codeList.push("!pip install scikit-posthocs");
if (vpConfig.extensionType === 'lite') {
codeList.push("%pip install scikit-posthocs");
} else {
codeList.push("!pip install scikit-posthocs");
}

// Post hoc analysis - Tukey
if (tukey === true) {
Expand DownExpand Up@@ -379,7 +383,11 @@ define([
}
if (tukey === true || scheffe === true || duncan === true) {
// Add installation code
codeList.push("!pip install scikit-posthocs");
if (vpConfig.extensionType === 'lite') {
codeList.push("%pip install scikit-posthocs");
} else {
codeList.push("!pip install scikit-posthocs");
}

// Post hoc analysis - Tukey
if (tukey === true) {
Expand DownExpand Up@@ -445,7 +453,11 @@ define([
}

// Add installation code : # pip install pingouin
codeList.push("!pip install pingouin");
if (vpConfig.extensionType === 'lite') {
codeList.push("%pip install pingouin");
} else {
codeList.push("!pip install pingouin");
}

code.appendLine();
code.appendLine();
Expand Down
7 changes: 7 additions & 0 deletionsvisualpython/js/m_stats/FactorAnalysis.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -167,6 +167,13 @@ define([
let codeList = [];
let code = new com_String();

// Add installation code FIXME:
if (vpConfig.extensionType === 'lite') {
codeList.push(that.generateInstallCode().replace('!', '%'));
} else {
codeList.push(that.generateInstallCode());
}

// data declaration
code.appendFormat("vp_df = {0}", data);
if (this.columnSelector) {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp