Skip to content

Release v2.4.3 (HotFix) #223

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 9 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ jupyternotebook/visualpython
colab/visualpython
test/
.gitignore
visualpython/js/com/com_Config.js
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#=============================================================================
# Set version and replace it
#=============================================================================
VP_ORG_VER=2.4.0
VP_NEW_VER=2.4.1
VP_ORG_VER=2.4.2
VP_NEW_VER=2.4.3

# update version info
grep -REil "VP_ORG_VER=.+$" colab/build.colab.sh jupyterlab/build.jupyterlab.sh jupyternotebook/build.jupyternotebook.sh | xargs sed -i "s/VP_ORG_VER=.\+$/VP_ORG_VER=${VP_ORG_VER}/g"
Expand Down
4 changes: 2 additions & 2 deletions colab/build.colab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#=============================================================================
# Replace Version
#=============================================================================
VP_ORG_VER=2.4.0
VP_NEW_VER=2.4.1
VP_ORG_VER=2.4.2
VP_NEW_VER=2.4.3

# update version info
# update manifest version with new numbering for new version
Expand Down
2 changes: 1 addition & 1 deletion colab/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Visual Python for Colab",
"description": "GUI-based Python code generator for Google Colab as an extension",
"version": "2.4.1",
"version": "2.4.3",
"manifest_version": 3,
"icons": {
"48": "icon.png",
Expand Down
Binary file modified jupyterlab/.jupyterlite.doit.db
Binary file not shown.
4 changes: 2 additions & 2 deletions jupyterlab/build.jupyterlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#=============================================================================
# Replace Version and Basic Files
#=============================================================================
VP_ORG_VER=2.4.0
VP_NEW_VER=2.4.1
VP_ORG_VER=2.4.2
VP_NEW_VER=2.4.3

# update version info
grep -REil "\"version\": \"${VP_ORG_VER}\"" package.json | xargs sed -i "s/\"version\": \"${VP_ORG_VER//\./\\.}\"/\"version\": \"${VP_NEW_VER}\"/g"
Expand Down
4 changes: 2 additions & 2 deletions jupyterlab/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jupyterlab/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jupyterlab-visualpython",
"version": "2.4.1",
"version": "2.4.3",
"description": "GUI-based Python code generator for Jupyter Lab as an extension",
"keywords": [
"jupyter",
Expand Down
4 changes: 2 additions & 2 deletions jupyterlab/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
version = "2.4.1"
version = "2.4.3"

[project.license]
file = "LICENSE"
Expand Down Expand Up @@ -92,7 +92,7 @@ file = [
]

[tool.tbump.version]
current = "2.4.1"
current = "2.4.3"
regex = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)((?P<channel>a|b|rc|.dev)(?P<release>\\d+))?"

[tool.tbump.git]
Expand Down
4 changes: 2 additions & 2 deletions jupyternotebook/build.jupyternotebook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#=============================================================================
# Replace Version and Basic Files
#=============================================================================
VP_ORG_VER=2.4.0
VP_NEW_VER=2.4.1
VP_ORG_VER=2.4.2
VP_NEW_VER=2.4.3

# update version info
grep -REil ${VP_ORG_VER//\./\\.} setup.py visualpython/js/com/com_Config.js visualpython/js/com/com_Const.js | xargs sed -i --follow-symlinks "s/${VP_ORG_VER//\./\\.}/${VP_NEW_VER}/g"
Expand Down
2 changes: 1 addition & 1 deletion jupyternotebook/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name = name,
version = '2.4.1',
version = '2.4.3',
packages = find_packages(),
package_data = {"": ["*"], 'visualpython' : ['visualpython.yaml', 'README.md']},
scripts = ['visualpython/bin/visualpy', 'visualpython/bin/visualpy.bat'],
Expand Down
26 changes: 23 additions & 3 deletions visualpython/js/com/com_Config.js
Original file line number Diff line number Diff 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 Down Expand 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', "%pip install jupyterlab-visualpython==" + latestVersion);
}

// update version_timestamp
Expand Down Expand Up @@ -991,7 +1011,7 @@ define([
/**
* Version
*/
Config.version = "2.4.1";
Config.version = "2.4.3";

/**
* Type of mode
Expand Down
2 changes: 1 addition & 1 deletion visualpython/js/com/com_Const.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define ([
class Constants { }

Constants.TOOLBAR_BTN_INFO = {
HELP: "Visual Python 2.4.1"
HELP: "Visual Python 2.4.3"
, ICON: "vp-main-icon"
, ID: "vpBtnToggle"
, NAME: "toggle-vp"
Expand Down
2 changes: 1 addition & 1 deletion visualpython/js/com/com_interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ define([
}, 300);
}
}
} else if (vpConfig.extensionType === 'lab') {
} else if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') {
if (notebookPanel && notebookPanel.sessionContext){
var sessionContext = notebookPanel.sessionContext;
let sessionType = sessionContext.type;
Expand Down
30 changes: 26 additions & 4 deletions visualpython/js/com/component/PackageManager.js
Original file line number Diff line number Diff 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 Down Expand 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("%pip uninstall {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 Down Expand 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("%pip install {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("%pip install {0}=={1}", pipName, version);
}
} else {
$(this.wrapSelector('.vp-inner-popup-version')).focus();
Expand Down
6 changes: 3 additions & 3 deletions visualpython/js/m_apps/Frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ define([
that.setPreview(that.getCurrentCode());
});

// menu on column (Deprecated on v2.3.6 - Temporarily Show on v.2.4.1)
// menu on column (Deprecated on v2.3.6 - Temporarily Show on v.2.4.3)
$(document).on('contextmenu', this.wrapSelector('.' + VP_FE_TABLE + ' .' + VP_FE_TABLE_COLUMN), function(event) {
event.preventDefault();

Expand Down Expand Up @@ -270,7 +270,7 @@ define([
that.showMenu(thisPos.left, thisPos.top + thisRect.height);
});

// menu on row (Deprecated on v2.3.6 - Temporarily Show on v.2.4.1)
// menu on row (Deprecated on v2.3.6 - Temporarily Show on v.2.4.3)
$(document).on('contextmenu', this.wrapSelector('.' + VP_FE_TABLE + ' .' + VP_FE_TABLE_ROW), function(event) {
event.preventDefault();
var idx = $(that.wrapSelector('.' + VP_FE_TABLE_ROW)).index(this); // 0 ~ n
Expand Down Expand Up @@ -595,7 +595,7 @@ define([
that.loadCode(that.getTypeCode(FRAME_EDIT_TYPE.SHOW), true);
});

// click toolbar item (Deprecated on v2.3.6 - Temporarily Show on v.2.4.1)
// click toolbar item (Deprecated on v2.3.6 - Temporarily Show on v.2.4.3)
$(document).on('click', this.wrapSelector('.vp-fe-toolbar-item'), function(evt) {
evt.stopPropagation();
var itemType = $(this).data('type');
Expand Down
12 changes: 9 additions & 3 deletions visualpython/js/m_apps/PDF.js
Original file line number Diff line number Diff 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 Down Expand 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 deletions visualpython/js/m_stats/Anova.js
Original file line number Diff line number Diff 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 Down Expand 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 Down Expand 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 deletions visualpython/js/m_stats/FactorAnalysis.js
Original file line number Diff line number Diff 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('%pip install factor-analyzer');
} else {
codeList.push('!pip install factor-analyzer');
}

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