diff --git a/.gitignore b/.gitignore index 396b0deb..8eaa6c8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,8 @@ dist/ jupyterlab/_output -jupyterlab/.jupyterlite.doit.db +jupyterlab/.jupyterlite.doit* jupyterlab/lib/visualpython jupyternotebook/visualpython colab/visualpython test/ .gitignore -visualpython/js/com/com_Config.js diff --git a/build.sh b/build.sh index d71b2bc5..c394364e 100755 --- a/build.sh +++ b/build.sh @@ -11,8 +11,8 @@ #============================================================================= # Set version and replace it #============================================================================= -VP_ORG_VER=2.4.2 -VP_NEW_VER=2.4.3 +VP_ORG_VER=2.4.3 +VP_NEW_VER=2.4.4 # 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" diff --git a/colab/build.colab.sh b/colab/build.colab.sh index 57471d46..0fc663f4 100755 --- a/colab/build.colab.sh +++ b/colab/build.colab.sh @@ -11,8 +11,8 @@ #============================================================================= # Replace Version #============================================================================= -VP_ORG_VER=2.4.2 -VP_NEW_VER=2.4.3 +VP_ORG_VER=2.4.3 +VP_NEW_VER=2.4.4 # update version info # update manifest version with new numbering for new version diff --git a/colab/manifest.json b/colab/manifest.json index dcbc487d..4024cf56 100644 --- a/colab/manifest.json +++ b/colab/manifest.json @@ -1,7 +1,7 @@ { "name": "Visual Python for Colab", "description": "GUI-based Python code generator for Google Colab as an extension", - "version": "2.4.3", + "version": "2.4.4", "manifest_version": 3, "icons": { "48": "icon.png", diff --git a/jupyterlab/build.jupyterlab.sh b/jupyterlab/build.jupyterlab.sh index a477fb99..9d43a172 100755 --- a/jupyterlab/build.jupyterlab.sh +++ b/jupyterlab/build.jupyterlab.sh @@ -11,8 +11,8 @@ #============================================================================= # Replace Version and Basic Files #============================================================================= -VP_ORG_VER=2.4.2 -VP_NEW_VER=2.4.3 +VP_ORG_VER=2.4.3 +VP_NEW_VER=2.4.4 # update version info grep -REil "\"version\": \"${VP_ORG_VER}\"" package.json | xargs sed -i "s/\"version\": \"${VP_ORG_VER//\./\\.}\"/\"version\": \"${VP_NEW_VER}\"/g" diff --git a/jupyterlab/dev-build.jupyterlab.sh b/jupyterlab/dev-build.jupyterlab.sh index 29c2f980..7ebac489 100755 --- a/jupyterlab/dev-build.jupyterlab.sh +++ b/jupyterlab/dev-build.jupyterlab.sh @@ -50,4 +50,7 @@ jlpm run build # jupyter lite build # Run jupyterlite server -# jupyter lite serve \ No newline at end of file +# jupyter lite serve # init + build + serve + +# If something went wrong, remove _output/extensions folder and run command below +# jupyter lite init \ No newline at end of file diff --git a/jupyterlab/package-lock.json b/jupyterlab/package-lock.json index 899cf924..1e440644 100644 --- a/jupyterlab/package-lock.json +++ b/jupyterlab/package-lock.json @@ -1,12 +1,12 @@ { "name": "jupyterlab-visualpython", - "version": "2.4.2", + "version": "2.4.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "jupyterlab-visualpython", - "version": "2.4.2", + "version": "2.4.3", "license": "GPLv3 with Visual Python special exception", "dependencies": { "@jupyterlab/cells": "^3.5.2", diff --git a/jupyterlab/package.json b/jupyterlab/package.json index be5d17d1..c0b0cba8 100644 --- a/jupyterlab/package.json +++ b/jupyterlab/package.json @@ -1,6 +1,6 @@ { "name": "jupyterlab-visualpython", - "version": "2.4.3", + "version": "2.4.4", "description": "GUI-based Python code generator for Jupyter Lab as an extension", "keywords": [ "jupyter", diff --git a/jupyterlab/pyproject.toml b/jupyterlab/pyproject.toml index 865e3110..48944c97 100644 --- a/jupyterlab/pyproject.toml +++ b/jupyterlab/pyproject.toml @@ -32,7 +32,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", ] -version = "2.4.3" +version = "2.4.4" [project.license] file = "LICENSE" @@ -92,7 +92,7 @@ file = [ ] [tool.tbump.version] -current = "2.4.3" +current = "2.4.4" regex = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)((?Pa|b|rc|.dev)(?P\\d+))?" [tool.tbump.git] diff --git a/jupyternotebook/build.jupyternotebook.sh b/jupyternotebook/build.jupyternotebook.sh index 5c52d21d..d896b220 100755 --- a/jupyternotebook/build.jupyternotebook.sh +++ b/jupyternotebook/build.jupyternotebook.sh @@ -11,8 +11,8 @@ #============================================================================= # Replace Version and Basic Files #============================================================================= -VP_ORG_VER=2.4.2 -VP_NEW_VER=2.4.3 +VP_ORG_VER=2.4.3 +VP_NEW_VER=2.4.4 # 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" diff --git a/jupyternotebook/setup.py b/jupyternotebook/setup.py index cd492f04..f41228e7 100644 --- a/jupyternotebook/setup.py +++ b/jupyternotebook/setup.py @@ -10,7 +10,7 @@ setup( name = name, - version = '2.4.3', + version = '2.4.4', packages = find_packages(), package_data = {"": ["*"], 'visualpython' : ['visualpython.yaml', 'README.md']}, scripts = ['visualpython/bin/visualpy', 'visualpython/bin/visualpy.bat'], diff --git a/visualpython/css/mainFrame.css b/visualpython/css/mainFrame.css index 1efd12b7..c22373d5 100644 --- a/visualpython/css/mainFrame.css +++ b/visualpython/css/mainFrame.css @@ -59,6 +59,43 @@ div#vp_wrapper.colab * { #vp_wrapper.lab *, #vp_wrapper.lite * { box-sizing: border-box !important; } +/* LITE: show protector */ +#vp_wrapper.lab .vp-protector, +#vp_wrapper.lite .vp-protector { + background-color: rgb(33 33 33 / 77%); + position: absolute; + width: 100%; + height: 100%; + z-index: 100; +} +#vp_wrapper.lab .vp-protector-info, +#vp_wrapper.lite .vp-protector-info { + background-color: var(--vp-background-color); + width: 250px; + height: 170px; + padding: 10px; + margin: auto; + top: calc(50% - 80px); + position: relative; + display: grid; + grid-template-rows: 20px 100px 30px; +} +#vp_wrapper.lab .vp-protector-title, +#vp_wrapper.lite .vp-protector-title { + font-weight: bold; + color: var(--vp-font-highlight); +} +#vp_wrapper.lab .vp-protector-content, +#vp_wrapper.lite .vp-protector-content { + border: 0.25px solid var(--vp-border-gray-color); + border-radius: 10px; + padding: 10px; + margin: 5px 0; +} +#vp_wrapper.lab .vp-protector-footer, +#vp_wrapper.lite .vp-protector-footer { + text-align: right; +} /* resizing handle */ #vp_wrapper > .ui-resizable-handle { diff --git a/visualpython/css/root.css b/visualpython/css/root.css index 1ad1ec16..55a7a79f 100644 --- a/visualpython/css/root.css +++ b/visualpython/css/root.css @@ -378,6 +378,22 @@ button.vp-button { background: #C4C4C4; } +/* Scrollbar vertical only */ +.vp-scrollbar-vertical { + overflow-x: hidden; + overflow-y: auto; + white-space: nowrap; + --webkit-mask-position: left top; +} +.vp-scrollbar-vertical::-webkit-scrollbar { + width: 5px; + height: 5px; +} +.vp-scrollbar-vertical::-webkit-scrollbar-thumb { + border: 0.3px solid #C4C4C4; + background: #C4C4C4; +} + /* Scrollbar horizontal */ .vp-scrollbar-horizontal { overflow-x: auto; diff --git a/visualpython/data/m_library/pandasLibrary.js b/visualpython/data/m_library/pandasLibrary.js index 488f9ef5..0646205b 100644 --- a/visualpython/data/m_library/pandasLibrary.js +++ b/visualpython/data/m_library/pandasLibrary.js @@ -44,7 +44,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -79,7 +79,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -110,7 +110,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -178,8 +178,9 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" - ] + "input" + ], + "value": "vp_df" }, { "name": "encoding", @@ -348,7 +349,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -418,7 +419,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -487,7 +488,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -558,7 +559,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -647,7 +648,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -703,7 +704,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -777,7 +778,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -841,7 +842,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -920,7 +921,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -962,7 +963,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1004,7 +1005,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1056,7 +1057,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1108,7 +1109,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1160,7 +1161,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1222,7 +1223,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1281,7 +1282,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1340,7 +1341,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1399,7 +1400,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1458,7 +1459,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1517,7 +1518,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1593,7 +1594,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1669,7 +1670,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1765,7 +1766,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1797,7 +1798,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1880,7 +1881,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -1964,7 +1965,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -1992,7 +1993,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2021,7 +2022,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2048,7 +2049,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2076,7 +2077,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2105,7 +2106,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2132,7 +2133,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2165,7 +2166,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2198,7 +2199,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2226,7 +2227,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2253,7 +2254,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2281,7 +2282,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2309,7 +2310,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2336,7 +2337,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2365,7 +2366,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2393,7 +2394,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2417,7 +2418,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2444,7 +2445,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2480,7 +2481,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2534,7 +2535,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2600,7 +2601,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2666,7 +2667,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2732,7 +2733,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2785,7 +2786,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -2901,7 +2902,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -2930,7 +2931,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3003,7 +3004,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3063,7 +3064,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3145,7 +3146,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3179,7 +3180,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3219,7 +3220,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3264,7 +3265,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3290,7 +3291,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3316,7 +3317,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3342,7 +3343,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3368,7 +3369,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3394,7 +3395,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3420,7 +3421,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3462,7 +3463,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3491,7 +3492,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3525,8 +3526,9 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" - ] + "input" + ], + "value": "vp_df" }, { "name": "typ", @@ -3608,7 +3610,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3682,8 +3684,9 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" - ] + "input" + ], + "value": "vp_df" } ] }, @@ -3722,7 +3725,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -3749,7 +3752,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3792,7 +3795,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3831,7 +3834,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3874,7 +3877,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3927,7 +3930,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -3979,7 +3982,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4059,7 +4062,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -4091,7 +4094,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4144,7 +4147,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4183,7 +4186,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4260,7 +4263,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4322,7 +4325,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -4353,7 +4356,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4437,7 +4440,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4526,7 +4529,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -4560,7 +4563,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -4603,7 +4606,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4661,7 +4664,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4705,7 +4708,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4795,7 +4798,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4889,7 +4892,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -4957,7 +4960,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -5012,7 +5015,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5062,7 +5065,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "var_type": [ "Series" @@ -5136,7 +5139,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "var_type": [ "Series", @@ -5221,7 +5224,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -5259,7 +5262,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "var_type": [ "Series", @@ -5335,7 +5338,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "var_type": [ "Series", @@ -5386,7 +5389,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5450,7 +5453,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5520,7 +5523,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ], "var_type": [ "Series", @@ -5582,7 +5585,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5670,7 +5673,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5757,7 +5760,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5883,7 +5886,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -5963,7 +5966,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -6058,7 +6061,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -6145,7 +6148,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -6204,7 +6207,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -6273,7 +6276,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] }, { @@ -6535,8 +6538,9 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" - ] + "input" + ], + "value": "vp_df" }, { "name": "sheet_name", @@ -6613,7 +6617,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -6640,7 +6644,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -6669,7 +6673,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -6696,7 +6700,7 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" + "input" ] } ] @@ -6721,8 +6725,9 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" - ] + "input" + ], + "value": "vp_df" }, { "name": "format", @@ -6766,8 +6771,9 @@ define([ "label": "Allocate to", "output": true, "component": [ - "data_select" - ] + "input" + ], + "value": "vp_df" }, { "name": "usecols", diff --git a/visualpython/html/m_apps/file.html b/visualpython/html/m_apps/file.html index eebfd00f..c1117704 100644 --- a/visualpython/html/m_apps/file.html +++ b/visualpython/html/m_apps/file.html @@ -74,8 +74,8 @@ - - + + diff --git a/visualpython/html/m_apps/sweetviz.html b/visualpython/html/m_apps/sweetviz.html index 4769125a..0f059235 100644 --- a/visualpython/html/m_apps/sweetviz.html +++ b/visualpython/html/m_apps/sweetviz.html @@ -21,7 +21,7 @@ - +
diff --git a/visualpython/js/MainFrame.js b/visualpython/js/MainFrame.js index 0c8a9d98..1b9d0386 100644 --- a/visualpython/js/MainFrame.js +++ b/visualpython/js/MainFrame.js @@ -88,6 +88,11 @@ define([ top: colabHeaderHeight + 'px' }); }); + } else if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') { + $('#vp_protectorShowWithoutKernel').click(function(evt) { + // just hide protector + vpConfig.hideProtector(); + }); } window.vpEvent = new com_Event(this); @@ -250,6 +255,19 @@ define([ { vp_note_display: vp_note_display, vp_note_width: vp_note_width }, { parent: this } ); + + // load protector for jupyterlite + if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') { + $('#vp_wrapper').append(`
+
+
No kernel
+
You have to open the notebook or console to use Visual Python.
+ +
+
`) + } // consider height and width this._resizeWindow(); diff --git a/visualpython/js/com/com_Config.js b/visualpython/js/com/com_Config.js index 746d13f9..b5147665 100644 --- a/visualpython/js/com/com_Config.js +++ b/visualpython/js/com/com_Config.js @@ -52,7 +52,7 @@ define([ */ constructor(extensionType='notebook', initialData={}) { // initial mode - this.isReady = false; + this._isReady = { 'default': false }; this.extensionType = extensionType; this.parentSelector = 'body'; if (extensionType === 'notebook') { @@ -216,6 +216,41 @@ define([ } + get isReady() { + let sessionId = 'default'; + if (this.extensionType === 'lab' || this.extensionType === 'lite') { + let panelId = vpKernel.getLabPanelId(); + if (panelId) { + sessionId = panelId; + } + } + if (sessionId in this._isReady) { + return this._isReady[sessionId]; + } + return false; + } + + set isReady(ready) { + let sessionId = 'default'; + if (this.extensionType === 'lab' || this.extensionType === 'lite') { + let panelId = vpKernel.getLabPanelId(); + if (panelId) { + sessionId = panelId; + } + } + this._isReady[sessionId] = ready; + } + + showProtector(title='No kernel', content='You have to open the notebook or console to use Visual Python.') { + $('#vp_protector .vp-protector-title').text(title); + $('#vp_protector .vp-protector-content').text(content); + $('#vp_protector').show(); + } + + hideProtector() { + $('#vp_protector').hide(); + } + /** * Read dejault config */ @@ -300,6 +335,9 @@ define([ let that = this; // CHROME: change method to load py files ($.get -> require) return new Promise(function(resolve, reject) { + // if (that.extensionType === 'lite') { + // that.showProtector('Kernel loading', 'Required inner function is loading now...'); + // } var libraryList = [ printCommand, fileNaviCommand, pandasCommand, variableCommand, visualizationCommand ]; @@ -345,6 +383,9 @@ define([ console.log('visualpython - failed to load library', resultObj); // TODO: show to restart kernel }).finally(function() { + // if (that.extensionType === 'lite') { + // that.hideProtector(); + // } if (!failed) { console.log('visualpython - loaded libraries', libraryList); resolve(true); @@ -976,7 +1017,7 @@ define([ /** * Version */ - Config.version = "2.4.3"; + Config.version = "2.4.4"; /** * Type of mode diff --git a/visualpython/js/com/com_Const.js b/visualpython/js/com/com_Const.js index 7a936711..b4f72374 100644 --- a/visualpython/js/com/com_Const.js +++ b/visualpython/js/com/com_Const.js @@ -19,7 +19,7 @@ define ([ class Constants { } Constants.TOOLBAR_BTN_INFO = { - HELP: "Visual Python 2.4.3" + HELP: "Visual Python 2.4.4" , ICON: "vp-main-icon" , ID: "vpBtnToggle" , NAME: "toggle-vp" diff --git a/visualpython/js/com/com_Kernel.js b/visualpython/js/com/com_Kernel.js index ec01e35a..4282c1ad 100644 --- a/visualpython/js/com/com_Kernel.js +++ b/visualpython/js/com/com_Kernel.js @@ -44,6 +44,9 @@ define([ }, 'vpimport': { + }, + 'vppackman': { + } } } @@ -381,6 +384,8 @@ define([ } var future; if (vpConfig.isReady === false) { + vpConfig.isReady = true; + vpConfig.hideProtector(); vpConfig.readKernelFunction().then(function() { future = kernelConnection.requestExecute(codeObj); future.onIOPub = onIOPub; @@ -695,6 +700,9 @@ define([ case 'vpimport': configFile = 'import'; break; + case 'vppackman': + configFile = 'packman'; + break; } var cmd = com_util.formatString("print(_vp_get_colab_vpcfg('{0}'))", configFile); return new Promise(function(resolve, reject) { @@ -727,6 +735,9 @@ define([ case 'vpimport': configFile = 'import'; break; + case 'vppackman': + configFile = 'packman'; + break; } // write file var sbfileSaveCmd = new com_String(); @@ -761,6 +772,9 @@ define([ case 'vpimport': configFile = 'import'; break; + case 'vppackman': + configFile = 'packman'; + break; } var cmd = com_util.formatString("print(_vp_get_lab_vpcfg('{0}'))", configFile); return new Promise(function(resolve, reject) { @@ -793,6 +807,9 @@ define([ case 'vpimport': configFile = 'import'; break; + case 'vppackman': + configFile = 'packman'; + break; } // write file var sbfileSaveCmd = new com_String(); diff --git a/visualpython/js/com/com_interface.js b/visualpython/js/com/com_interface.js index 5a80ca98..4c12f1e5 100644 --- a/visualpython/js/com/com_interface.js +++ b/visualpython/js/com/com_interface.js @@ -111,6 +111,13 @@ define([ if (notebookPanel && notebookPanel.sessionContext){ var sessionContext = notebookPanel.sessionContext; let sessionType = sessionContext.type; + if (vpConfig.extensionType === 'lite') { + // check one more time for jupyter lite + // - it returns 'notebook' when it's console + if (notebookPanel.console !== undefined) { + sessionType = 'console'; + } + } if (sessionType === 'notebook') { var notebook = notebookPanel.content; var notebookModel = notebook.model; @@ -244,6 +251,13 @@ define([ if (notebookPanel && notebookPanel.sessionContext){ var sessionContext = notebookPanel.sessionContext; let sessionType = sessionContext.type; + if (vpConfig.extensionType === 'lite') { + // check one more time for jupyter lite + // - it returns 'notebook' when it's console + if (notebookPanel.console !== undefined) { + sessionType = 'console'; + } + } if (sessionType === 'notebook') { var notebook = notebookPanel.content; var notebookModel = notebook.model; diff --git a/visualpython/js/com/component/DataSelector.js b/visualpython/js/com/component/DataSelector.js index ca520774..d6d34108 100644 --- a/visualpython/js/com/component/DataSelector.js +++ b/visualpython/js/com/component/DataSelector.js @@ -230,6 +230,8 @@ define([ $(this).select(); $(this).autocomplete('search', $(this).val()); }).autocomplete('instance')._renderItem = function(ul, item) { + $(ul).addClass('vp-scrollbar-vertical'); + $(ul).css('max-height', '250px'); return $('
  • ').attr('data-value', item.value) .append(`
    ${item.label}
    `) .appendTo(ul); diff --git a/visualpython/js/com/component/FileNavigation.js b/visualpython/js/com/component/FileNavigation.js index d10de03b..603ff8a0 100644 --- a/visualpython/js/com/component/FileNavigation.js +++ b/visualpython/js/com/component/FileNavigation.js @@ -259,6 +259,7 @@ define([ if (allowExtensionList.length > 0 && !allowExtensionList.includes(extension)) { // TODO: alert //vpCommon.renderAlertModal('Not supported file type'); + vpLog.display(VP_LOG_TYPE.ERROR, 'Not supported file type: ' + extension); return; } diff --git a/visualpython/js/com/component/PackageManager.js b/visualpython/js/com/component/PackageManager.js index 95b7cb5f..350e9093 100644 --- a/visualpython/js/com/component/PackageManager.js +++ b/visualpython/js/com/component/PackageManager.js @@ -18,8 +18,9 @@ define([ 'vp_base/js/com/com_Const', 'vp_base/js/com/com_String', 'vp_base/js/com/component/PopupComponent', - 'vp_base/js/com/component/FileNavigation' -], function(ifHtml, ifCss, com_util, com_Const, com_String, PopupComponent, FileNavigation) { + 'vp_base/js/com/component/FileNavigation', + 'vp_base/js/com/component/LoadingSpinner' +], function(ifHtml, ifCss, com_util, com_Const, com_String, PopupComponent, FileNavigation, LoadingSpinner) { /** * PackageManager @@ -324,6 +325,7 @@ define([ super.render(); let that = this; + let loadingSpinner = new LoadingSpinner($(this.wrapSelector('.vp-popup-body'))); vpConfig.getData('', 'vppackman').then(function(savedData) { // Reset abnormal data if (savedData == undefined || savedData.packageList === undefined) { @@ -334,7 +336,7 @@ define([ that.packageLib = { ...savedData.packageList }; - + loadingSpinner.remove(); // load package list that.loadPackageList(); }).catch(function(err) { @@ -343,7 +345,7 @@ define([ that.packageLib = { ...that.packageLibTemplate }; - + loadingSpinner.remove(); // load package list that.loadPackageList(); }); @@ -399,6 +401,7 @@ define([ $(this.wrapSelector('.vp-pm-table')).html(''); let packageList = Object.keys(this.packageLib); + let loadingSpinner = new LoadingSpinner($(this.wrapSelector('.vp-popup-body'))); vpKernel.getPackageList(packageList).then(function(resultObj) { let { result } = resultObj; let packageInfo = JSON.parse(result); @@ -418,6 +421,8 @@ define([ that.bindItemEvent(); }).catch(function() { + }).finally(function() { + loadingSpinner.remove(); }); } diff --git a/visualpython/js/com/component/SuggestInput.js b/visualpython/js/com/component/SuggestInput.js index a0ae45f8..2c7fa96e 100644 --- a/visualpython/js/com/component/SuggestInput.js +++ b/visualpython/js/com/component/SuggestInput.js @@ -168,6 +168,8 @@ define([ $(this).select(); $(com_util.formatString(".{0}", that.uuid)).autocomplete('search', $(com_util.formatString(".{0}", that.uuid)).val()); }).autocomplete('instance')._renderItem = function(ul, item) { + $(ul).addClass('vp-scrollbar-vertical'); + $(ul).css('max-height', '250px'); if (item.dtype != undefined) { return $('
  • ').attr('data-value', item.value) .append(`
    ${item.label}
    `) diff --git a/visualpython/js/loadVisualpython.js b/visualpython/js/loadVisualpython.js index 6e704835..bd8b1781 100644 --- a/visualpython/js/loadVisualpython.js +++ b/visualpython/js/loadVisualpython.js @@ -209,38 +209,6 @@ define([ } } - var _checkVersion = function() { - // check version timestamp - let nowDate = new Date(); - vpConfig.getData('version_timestamp', 'vpcfg').then(function(data) { - let doCheckVersion = false; - if (data == undefined) { - // no timestamp, check version - doCheckVersion = true; - } else if (data != '') { - let lastCheck = new Date(parseInt(data)); - let diffCheck_now = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, nowDate.getDate()); - let diffCheck_last = new Date(lastCheck.getFullYear(), lastCheck.getMonth() + 1, lastCheck.getDate()); - - let diff = Math.abs(diffCheck_now.getTime() - diffCheck_last.getTime()); - diff = Math.ceil(diff / (1000 * 3600 * 24)); - - if (diff >= 1) { - // if More than 1 day passed, check version - doCheckVersion = true; - } - } - - // check version and update version_timestamp - if (doCheckVersion == true) { - vpConfig.checkVpVersion(true); - } - - }).catch(function(err) { - vpLog.display(VP_LOG_TYPE.ERROR, err); - }) - } - //======================================================================== // External call function //======================================================================== @@ -293,9 +261,10 @@ define([ _addToolBarVpButton(); } _loadVpResource(cfg); - _checkVersion(); - - if (cfg.vp_section_display && vpFrame) { + vpConfig.checkVersionTimestamp(); + + if ((cfg.vp_section_display && vpFrame) + || vpConfig.extensionType === 'colab') { // CHROME: default to display vp vpFrame.openVp(); } @@ -319,22 +288,35 @@ define([ // LAB: if widget is ready or changed, ready for lab kernel connected, and restart vp vpLab.shell._currentChanged.connect(function(s1, value) { var { newValue } = value; + vpLog.display(VP_LOG_TYPE.DEVELOP, 'jupyterlab shell currently changed', s1, value); // kernel restart for notebook and console if (newValue && newValue.sessionContext) { + vpConfig.hideProtector(); if (newValue.sessionContext.isReady) { - vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...'); - vpConfig.isReady = true; - vpConfig.readKernelFunction(); - } - newValue.sessionContext._connectionStatusChanged.connect(function(s2, status) { - if (status === 'connected') { + if (vpConfig.isReady === false) { vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...'); vpConfig.isReady = true; vpConfig.readKernelFunction(); + vpConfig.checkVersionTimestamp(); + } + } + newValue.sessionContext._connectionStatusChanged.connect(function(s2, status) { + if (status === 'connected') { + if (vpConfig.isReady === false) { + vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...'); + vpConfig.isReady = true; + vpConfig.readKernelFunction(); + vpConfig.checkVersionTimestamp(); + } } }); } else { vpLog.display(VP_LOG_TYPE.LOG, 'No widget detected...'); + vpConfig.isReady = false; + vpConfig.showProtector(); + if (vpConfig.extensionType === 'lite') { + vpLab.serviceManager.sessions.runningChanged.connect(handleRunningChanged); + } } }); } @@ -342,6 +324,22 @@ define([ return vpFrame; } + var handleRunningChanged = function(a, b) { + vpLog.display(VP_LOG_TYPE.DEVELOP, 'Current widget:', vpLab.shell.currentWidget); + if (vpLab.shell.currentWidget) { + vpLab.shell.currentWidget.sessionContext.statusChanged.connect(function(currentWidget, status) { + if (status === 'idle' && vpConfig.isReady === false) { + vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...'); + vpConfig.isReady = true; + vpConfig.hideProtector(); + vpConfig.readKernelFunction(); + vpConfig.checkVersionTimestamp(); + } + }); + vpLab.serviceManager.sessions.runningChanged.disconnect(handleRunningChanged); + } + } + return { initVisualpython: initVisualpython, readConfig: readConfig }; }); /* function, define */ diff --git a/visualpython/js/m_apps/File.js b/visualpython/js/m_apps/File.js index 39699cc1..19bbc796 100644 --- a/visualpython/js/m_apps/File.js +++ b/visualpython/js/m_apps/File.js @@ -176,7 +176,8 @@ define([ "data_select" ], "output": true, - "required": true + "required": true, + "value": 'vp_df' } ] } @@ -234,9 +235,14 @@ define([ type = 'open'; } + let extensionList = []; + if (that.state.fileExtension !== '') { + extensionList = [ that.state.fileExtension ]; + } + let fileNavi = new FileNavigation({ type: type, - extensions: [ that.state.fileExtension ], + extensions: extensionList, finish: function(filesPath, status, error) { let {file, path} = filesPath[0]; that.state.selectedFile = file; @@ -306,7 +312,15 @@ define([ templateForBody() { /** Implement generating template */ - return fileHtml; + let page = $(fileHtml); + + // Removed dataselector for Allocation input + // let allocateSelector = new DataSelector({ + // pageThis: this, id: 'vp_sampleReturn', placeholder: 'Variable name', value: 'vp_df' + // }); + // $(page).find('#vp_sampleReturn').replaceWith(allocateSelector.toTagString()); + + return page; } renderPage(pageType) { diff --git a/visualpython/js/m_apps/Frame.js b/visualpython/js/m_apps/Frame.js index a07f7299..44d4727c 100644 --- a/visualpython/js/m_apps/Frame.js +++ b/visualpython/js/m_apps/Frame.js @@ -37,7 +37,7 @@ define([ this.state = { originObj: '', tempObj: '_vp', - returnObj: '_vp', + returnObj: 'vp_df', inplace: false, menu: '', menuItem: '', @@ -176,7 +176,7 @@ define([ // initialize state values that.state.originObj = origin; that.state.tempObj = '_vp'; - that.state.returnObj = that.state.tempObj; + that.state.returnObj = 'vp_df'; if (that.state.inplace === true) { that.state.returnObj = origin; } @@ -228,7 +228,7 @@ define([ // check/uncheck inplace $(this.wrapSelector('#inplace')).on('change', function() { let checked = $(this).prop('checked'); - let returnVariable = '_vp'; + let returnVariable = 'vp_df'; if (checked === true) { returnVariable = that.state.originObj; } @@ -240,7 +240,7 @@ define([ that.setPreview(that.getCurrentCode()); }); - // menu on column (Deprecated on v2.3.6 - Temporarily Show on v.2.4.3) + // menu on column (Deprecated on v2.3.6 - Temporarily Show on v.2.4.4) $(document).on('contextmenu', this.wrapSelector('.' + VP_FE_TABLE + ' .' + VP_FE_TABLE_COLUMN), function(event) { event.preventDefault(); @@ -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.3) + // menu on row (Deprecated on v2.3.6 - Temporarily Show on v.2.4.4) $(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 @@ -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.3) + // click toolbar item (Deprecated on v2.3.6 - Temporarily Show on v.2.4.4) $(document).on('click', this.wrapSelector('.vp-fe-toolbar-item'), function(evt) { evt.stopPropagation(); var itemType = $(this).data('type'); @@ -1121,10 +1121,11 @@ define([ templateForBody() { let page = $(frameHtml); - let allocateSelector = new DataSelector({ - pageThis: this, id: 'vp_feReturn', placeholder: 'Variable name', required: true, value: '_vp' - }); - $(page).find('#vp_feReturn').replaceWith(allocateSelector.toTagString()); + // Removed dataselector for Allocation input + // let allocateSelector = new DataSelector({ + // pageThis: this, id: 'vp_feReturn', placeholder: 'Variable name', required: true, value: 'vp_df' + // }); + // $(page).find('#vp_feReturn').replaceWith(allocateSelector.toTagString()); return page; } diff --git a/visualpython/js/m_apps/Import.js b/visualpython/js/m_apps/Import.js index 42f85f86..38b6aec6 100644 --- a/visualpython/js/m_apps/Import.js +++ b/visualpython/js/m_apps/Import.js @@ -70,10 +70,6 @@ define([ } this.importTemplatesCopy = JSON.parse(JSON.stringify(importTemplates)); - if (vpConfig.extensionType === 'lite') { - // for LITE: set default checked state as false on seaborn package - this.importTemplatesCopy['data-analysis'][3].checked = false; - } if (!this.state.importMeta || this.state.importMeta.length <= 0) { this.state.importMeta = JSON.parse(JSON.stringify(this.importTemplatesCopy[this.state.tabType])); diff --git a/visualpython/js/m_apps/Instance.js b/visualpython/js/m_apps/Instance.js index 129162b2..2dda58e9 100644 --- a/visualpython/js/m_apps/Instance.js +++ b/visualpython/js/m_apps/Instance.js @@ -208,10 +208,11 @@ define([ }); $(page).find('#vp_instanceTarget').replaceWith(targetSelector.toTagString()); - let allocateSelector = new DataSelector({ - pageThis: this, id: 'vp_instanceAllocate', placeholder: 'Variable name' - }); - $(page).find('#vp_instanceAllocate').replaceWith(allocateSelector.toTagString()); + // Removed dataselector for Allocation input + // let allocateSelector = new DataSelector({ + // pageThis: this, id: 'vp_instanceAllocate', placeholder: 'Variable name' + // }); + // $(page).find('#vp_instanceAllocate').replaceWith(allocateSelector.toTagString()); return page; } diff --git a/visualpython/js/m_apps/PandasOption.js b/visualpython/js/m_apps/PandasOption.js index 0d6d1dfd..cb96e92c 100644 --- a/visualpython/js/m_apps/PandasOption.js +++ b/visualpython/js/m_apps/PandasOption.js @@ -17,9 +17,8 @@ define([ 'vp_base/js/com/com_util', 'vp_base/js/com/com_Const', 'vp_base/js/com/com_String', - 'vp_base/js/com/component/PopupComponent', - 'vp_base/js/com/component/DataSelector' -], function(poHTML, com_util, com_Const, com_String, PopupComponent, DataSelector) { + 'vp_base/js/com/component/PopupComponent' +], function(poHTML, com_util, com_Const, com_String, PopupComponent) { /** * PandasOption diff --git a/visualpython/js/m_apps/Subset.js b/visualpython/js/m_apps/Subset.js index 835a9196..5c923a62 100644 --- a/visualpython/js/m_apps/Subset.js +++ b/visualpython/js/m_apps/Subset.js @@ -168,13 +168,14 @@ define([ let page = $(subsetHtml); let that = this; - let allocateSelector = new DataSelector({ - pageThis: this, id: 'allocateTo', classes: VP_DS_ALLOCATE_TO, placeholder: 'New variable name', - finish: function() { - that.generateCode(); - } - }); - $(page).find('.' + VP_DS_ALLOCATE_TO).replaceWith(allocateSelector.toTagString()); + // Removed dataselector for Allocation input + // let allocateSelector = new DataSelector({ + // pageThis: this, id: 'allocateTo', classes: VP_DS_ALLOCATE_TO, placeholder: 'New variable name', + // finish: function() { + // that.generateCode(); + // } + // }); + // $(page).find('.' + VP_DS_ALLOCATE_TO).replaceWith(allocateSelector.toTagString()); return page; } diff --git a/visualpython/js/m_stats/Regression.js b/visualpython/js/m_stats/Regression.js index ab37b76f..0a0896a0 100644 --- a/visualpython/js/m_stats/Regression.js +++ b/visualpython/js/m_stats/Regression.js @@ -707,10 +707,8 @@ define([ code.appendLine("from IPython.display import display, Markdown"); code.appendLine("from scipy import stats"); code.appendLine("import statsmodels.api as sm"); - if (testType === 'multiple') { - if (['stepwise', 'backward', 'forward'].includes(method)) { - code.appendLine("_predict = _result.predict(sm.add_constant(vp_df[_model.exog_names[1:]]))"); - } + if (testType === 'multiple' && ['stepwise', 'backward', 'forward'].includes(method)) { + code.appendLine("_predict = _result.predict(sm.add_constant(vp_df[_model.exog_names[1:]]))"); } else { code.appendLine("_predict = _result.predict(vp_df)"); }