Skip to content

Commit 4484bb4

Browse files
committed
Merge branch 'textbox_for_snippet'
2 parents c61c67b + 686d7f7 commit 4484bb4

17 files changed

+2194
-1291
lines changed

Development Notes.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
[General](#general-notes) | [Make Docs](#constructing-the-documentation) |
22
[Build PyPi Package](#building-pypi-package)|
33
## General Notes
4-
1. Have not completely converted to JPSLUtils for javascript tools and
5-
accessing code cells. This will need to be complete before trying to
6-
make the software JLab vs ClassicNB aware.
7-
2. Thoughts on GUI for loading data. Could use ipyfilechooser to select
4+
1. Thoughts on GUI for loading data. Could use ipyfilechooser to select
85
local files. A dropdown for html vs csv to filter and select the reader.
96
A checkbox for the index (label) column or not in file. The html loader
107
creates an array of dataframes, one for each table.
11-
3. To make it work across more platforms could try having the computed code
12-
block built in a textbox widget. This looses the syntax highlighting,
13-
but would allow copy and paste into cells in things like Colab.
8+
2. To make it work across more platforms could try having the computed code.
149

1510
## Constructing the Documentation
1611

README.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
This package provides GUI tools to help the user construct Pandas and Python
1515
expressions
1616
to create things such as new calculated columns, plots or fits. The tools are
17-
meant to run in an interactive Jupyter notebook. **Currently, they only work
18-
in the classic Jupyter notebook and not Jupyter lab.** All tools are based on
19-
Jupyter widgets.
17+
meant to run in an interactive Jupyter notebook in
18+
[classic Jupyter](https://jupyter-notebook.readthedocs.io/en/latest/),
19+
[Jupyter Lab](https://jupyterlab.readthedocs.io/en/stable/)
20+
and [Google Colab](https://colab.research.google.com/). All tools are based on ipywidgets widgets.
2021

2122
These tools are meant to help the user learn how to construct the commands.
2223
They are intended for new or occasional users of Pandas. However,
@@ -27,11 +28,14 @@ the ability to choose python objects from menus can reduce errors.
2728

2829
The user can pass the GUI tools a list of Pandas
2930
DataFrames to work with. If nothing is passed, the GUI will look for
30-
Pandas DataFrames in the interactive session. The whole GUI and the Jupyter
31-
cell that created it are deleted when done. This leaves only the code that was
32-
generated by the GUI and the results of running the generated code.
33-
34-
The generated code contains sparse comments meant to help new users
31+
Pandas DataFrames in the interactive session. In classic Jupyter the whole GUI
32+
and the Jupyter cell that created it are deleted when done. This leaves
33+
only the code that was generated by the GUI and the results of running the
34+
generated code. In Colab and Lab the code is generated in an editable text
35+
box. In Colab it can be run by clicking a button. In Lab it is best to copy
36+
the code into a new cell before running it.
37+
38+
The generated code contains comments meant to help new users
3539
understand the code.
3640

3741
*Currently defined GUIs:*
@@ -48,13 +52,14 @@ understand the code.
4852

4953
* `fit_pandas_GUI()`: A GUI with six steps to lead the user through fitting
5054
Pandas data to a line, polynomial, exponential, Gaussian or sine function.
55+
**Selecting regions of the data set to fit does NOT currently
56+
work in Colab**.
5157

5258
<img src = "https://jupyterphysscilab.github.io/jupyter_Pandas_GUI/DataSets/GUI_fitexp_1.png" style="width:90%;"/>
5359

5460
#### Wishlist:
5561

5662
* GUIs for plots beyond scatter/line plots.
57-
* Make the GUIs work in Jupyter Lab.
5863

5964
#### Usage:
6065
If the `jupyter_Pandas_GUI` is installed in your Jupyter/Python environment
@@ -95,15 +100,16 @@ available in your command shell. More discussion:
95100
1. Navigate to the directory where this package will be installed.
96101
1. Start a shell in the environment `$ pipenv shell`.
97102
1. Install using pip.
98-
1. `$ pip install jupyter-Pandas-GUI`. This will install
103+
1. `pip install jupyter-Pandas-GUI`. This will install
99104
Jupyter into the same virtual
100105
environment if you do not already have it on your machine. If Jupyter is already
101106
installed the virtual environment will use the existing installation. This takes
102107
a long time on a Raspberry Pi. It will not run on a 3B+ without at least 1 GB of
103108
swap. See: [Build Jupyter on a Pi
104109
](https://www.uwosh.edu/facstaff/gutow/computer-and-programming-how-tos/installing-jupyter-on-raspberrian).
105110
2. Still within the environment shell test this by starting jupyter
106-
`$ jupyter notebook`. Jupyter should launch in your browser.
111+
`jupyter notebook` or `Jupyter lab`. The version of Jupyter requested should
112+
launch in your browser.
107113
1. Open a new notebook using the default (Python 3) kernel.
108114
1. In the first cell import the pandas_GUI module:
109115
`from pandas_GUI import *`
@@ -129,6 +135,14 @@ install -e ../jupyter_Pandas_GUI` in the _Production_
129135
instructions.
130136

131137
#### Change Log
138+
* 0.7.0
139+
* GUIs now also work in Jupyter Lab and Google Colab, although less
140+
elegently than in classic Jupyter. Only the fit range selection tab
141+
does not yet work in Google Colab.
142+
* Some minor bug fixes and clarification of instructions.
143+
* More and better comments in generated code.
144+
* Replacement of notebook cell javascript tools with those from JPSLUtils
145+
is complete.
132146
* 0.6.2.1 Fix for python move of `Iterable` to `collections.abc`
133147
* 0.6.2
134148
* Can now pass dataframes to the GUIs and they will search for additional

docs/DataSets/new_col_in_Colab.png

80.3 KB
Loading

docs/Lab_Colab_vs_NBClassic.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Pandas GUI behavior in Lab and Colab versus Classic Jupyter</title>
6+
</head>
7+
<body>
8+
<h1>Pandas GUI behavior in Lab and Colab versus Classic Jupyter</h1>
9+
<a href="https://jupyterphysscilab.github.io/jupyter_Pandas_GUI/">
10+
Return to Documentation Home Page</a>
11+
<h2>Introduction</h2>
12+
<p>The examples in the documentation are all based on how the GUI tools work
13+
in the classic
14+
Jupyter notebook environment. If you are using these tools in
15+
<a href = "https://jupyter.org/">Jupyter Lab</a> or
16+
<a href = "https://colab.research.google.com">Google Colab</a> keep in
17+
mind the differences in behavior described below.</p>
18+
<h2>Differences common to Lab and Colab</h2>
19+
<ul>
20+
<li>Rather then generate the code directly in a notebook cell
21+
immediately below the tabbed GUI, the code is generated in an
22+
editable textarea below the tabbed GUI. See the image below for
23+
the <code>new_pandas_column_GUI()</code>.</li>
24+
<image src = "DataSets/new_col_in_Colab.png"></image>
25+
<li>If you wish the generated code to persist after cell outputs are
26+
cleared, the generated code needs to be manually copied to a code
27+
cell.</li>
28+
</ul>
29+
<h2>Running the code in Lab and Colab</h2>
30+
<uL>
31+
<li><span style="color:blue;">In Colab</span> the code can be run by
32+
clicking on the "run code" button and the results will appear in
33+
the output of the cell.</li>
34+
<li><span style="color:red;">In Lab</span> clicking on the "run code"
35+
button will output the results to the log console,
36+
which defaults to appearing at the bottom of the window. To make
37+
the results appear in the output of a notebook cell the code must
38+
be copied to a cell and the cell run.</li>
39+
</uL>
40+
<a href="https://jupyterphysscilab.github.io/jupyter_Pandas_GUI/">
41+
Return to Documentation Home Page</a>
42+
</body>
43+
</html>

docs/Pandas_GUI_Doc_Home.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
<H3>Usage Examples</H3>
2626
<ul>
2727
<li><a href = "Overview_Demo_pandas_GUI.html">Quick Overview</a></li>
28+
<li><a href = "Lab_Colab_vs_NBClassic.html">Behavior in Jupyter Lab and
29+
Google Colab</a></li>
2830
<li><a href="New_calculated_column.html">New Calculated Column</a></li>
2931
<li>Plotting
3032
<ul><li>
@@ -76,8 +78,13 @@ <h3><a href="https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI">GIT
7678
<a href="https://python.org">Python</a> 3 kernel. See the <a href
7779
="pandas_GUI.html">documentation</a>
7880
for more detailed information on usage and installation.</p>
79-
<h5>Currently these tools only work in classic Jupyter notebooks. They
80-
do not yet work in Jupyter Lab.</h5>
81+
<h5>These tools work in classic Jupyter notebooks, Jupyter Lab and
82+
Google Colab.</h5>
83+
<p>The interface is less elegant in Jupyter Lab and Colab than in
84+
classic Jupyter, because the generated code cannot be built
85+
directly in a code cell. Clicking on a graph of the data
86+
to select regions of the data to fit does not yet work in
87+
<a href="https://colab.research.google.com/">Google Colab</a>.</p>
8188
</main>
8289
<script>
8390
function escapeHTML(html) {

docs/intro.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
This package provides GUI tools to help the user construct Pandas and Python
1515
expressions
1616
to create things such as new calculated columns, plots or fits. The tools are
17-
meant to run in an interactive Jupyter notebook. **Currently, they only work
18-
in the classic Jupyter notebook and not Jupyter lab.** All tools are based on
19-
Jupyter widgets.
17+
meant to run in an interactive Jupyter notebook in
18+
[classic Jupyter](https://jupyter-notebook.readthedocs.io/en/latest/),
19+
[Jupyter Lab](https://jupyterlab.readthedocs.io/en/stable/)
20+
and [Google Colab](https://colab.research.google.com/). All tools are based on ipywidgets widgets.
2021

2122
These tools are meant to help the user learn how to construct the commands.
2223
They are intended for new or occasional users of Pandas. However,
@@ -27,11 +28,14 @@ the ability to choose python objects from menus can reduce errors.
2728

2829
The user can pass the GUI tools a list of Pandas
2930
DataFrames to work with. If nothing is passed, the GUI will look for
30-
Pandas DataFrames in the interactive session. The whole GUI and the Jupyter
31-
cell that created it are deleted when done. This leaves only the code that was
32-
generated by the GUI and the results of running the generated code.
33-
34-
The generated code contains sparse comments meant to help new users
31+
Pandas DataFrames in the interactive session. In classic Jupyter the whole GUI
32+
and the Jupyter cell that created it are deleted when done. This leaves
33+
only the code that was generated by the GUI and the results of running the
34+
generated code. In Colab and Lab the code is generated in an editable text
35+
box. In Colab it can be run by clicking a button. In Lab it is best to copy
36+
the code into a new cell before running it.
37+
38+
The generated code contains comments meant to help new users
3539
understand the code.
3640

3741
*Currently defined GUIs:*
@@ -48,13 +52,14 @@ understand the code.
4852

4953
* `fit_pandas_GUI()`: A GUI with six steps to lead the user through fitting
5054
Pandas data to a line, polynomial, exponential, Gaussian or sine function.
55+
**Selecting regions of the data set to fit does NOT currently
56+
work in Colab**.
5157

5258
<img src = "https://jupyterphysscilab.github.io/jupyter_Pandas_GUI/DataSets/GUI_fitexp_1.png" style="width:90%;"/>
5359

5460
#### Wishlist:
5561

5662
* GUIs for plots beyond scatter/line plots.
57-
* Make the GUIs work in Jupyter Lab.
5863

5964
#### Usage:
6065
If the `jupyter_Pandas_GUI` is installed in your Jupyter/Python environment
@@ -95,15 +100,16 @@ available in your command shell. More discussion:
95100
1. Navigate to the directory where this package will be installed.
96101
1. Start a shell in the environment `$ pipenv shell`.
97102
1. Install using pip.
98-
1. `$ pip install jupyter-Pandas-GUI`. This will install
103+
1. `pip install jupyter-Pandas-GUI`. This will install
99104
Jupyter into the same virtual
100105
environment if you do not already have it on your machine. If Jupyter is already
101106
installed the virtual environment will use the existing installation. This takes
102107
a long time on a Raspberry Pi. It will not run on a 3B+ without at least 1 GB of
103108
swap. See: [Build Jupyter on a Pi
104109
](https://www.uwosh.edu/facstaff/gutow/computer-and-programming-how-tos/installing-jupyter-on-raspberrian).
105110
2. Still within the environment shell test this by starting jupyter
106-
`$ jupyter notebook`. Jupyter should launch in your browser.
111+
`jupyter notebook` or `Jupyter lab`. The version of Jupyter requested should
112+
launch in your browser.
107113
1. Open a new notebook using the default (Python 3) kernel.
108114
1. In the first cell import the pandas_GUI module:
109115
`from pandas_GUI import *`
@@ -129,6 +135,14 @@ install -e ../jupyter_Pandas_GUI` in the _Production_
129135
instructions.
130136

131137
#### Change Log
138+
* 0.7.0
139+
* GUIs now also work in Jupyter Lab and Google Colab, although less
140+
elegently than in classic Jupyter. Only the fit range selection tab
141+
does not yet work in Google Colab.
142+
* Some minor bug fixes and clarification of instructions.
143+
* More and better comments in generated code.
144+
* Replacement of notebook cell javascript tools with those from JPSLUtils
145+
is complete.
132146
* 0.6.2.1 Fix for python move of `Iterable` to `collections.abc`
133147
* 0.6.2
134148
* Can now pass dataframes to the GUIs and they will search for additional

docs/pandas_GUI.html

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h2>API Documentation</h2>
3939
</ul>
4040

4141

42-
<footer>jupyter_Pandas_GUI v0.6.2.1</footer>
42+
<footer>jupyter_Pandas_GUI v0.7.0</footer>
4343

4444
<a class="attribution" title="pdoc: Python API documentation generator" href="https://pdoc.dev">
4545
built with <span class="visually-hidden">pdoc</span><img
@@ -107,9 +107,10 @@ <h4 id="introduction">Introduction:</h4>
107107
<p>This package provides GUI tools to help the user construct Pandas and Python
108108
expressions
109109
to create things such as new calculated columns, plots or fits. The tools are
110-
meant to run in an interactive Jupyter notebook. <strong>Currently, they only work
111-
in the classic Jupyter notebook and not Jupyter lab.</strong> All tools are based on
112-
Jupyter widgets.</p>
110+
meant to run in an interactive Jupyter notebook in
111+
<a href="https://jupyter-notebook.readthedocs.io/en/latest/">classic Jupyter</a>,
112+
<a href="https://jupyterlab.readthedocs.io/en/stable/">Jupyter Lab</a>
113+
and <a href="https://colab.research.google.com/">Google Colab</a>. All tools are based on ipywidgets widgets.</p>
113114

114115
<p>These tools are meant to help the user learn how to construct the commands.
115116
They are intended for new or occasional users of Pandas. However,
@@ -120,11 +121,14 @@ <h4 id="current-features">Current Features:</h4>
120121

121122
<p>The user can pass the GUI tools a list of Pandas
122123
DataFrames to work with. If nothing is passed, the GUI will look for
123-
Pandas DataFrames in the interactive session. The whole GUI and the Jupyter
124-
cell that created it are deleted when done. This leaves only the code that was
125-
generated by the GUI and the results of running the generated code.</p>
126-
127-
<p>The generated code contains sparse comments meant to help new users
124+
Pandas DataFrames in the interactive session. In classic Jupyter the whole GUI
125+
and the Jupyter cell that created it are deleted when done. This leaves
126+
only the code that was generated by the GUI and the results of running the
127+
generated code. In Colab and Lab the code is generated in an editable text
128+
box. In Colab it can be run by clicking a button. In Lab it is best to copy
129+
the code into a new cell before running it.</p>
130+
131+
<p>The generated code contains comments meant to help new users
128132
understand the code.</p>
129133

130134
<p><em>Currently defined GUIs:</em></p>
@@ -139,7 +143,9 @@ <h4 id="current-features">Current Features:</h4>
139143

140144
<p><img src = "https://jupyterphysscilab.github.io/jupyter_Pandas_GUI/DataSets/plot_GUI.png" style="width:90%;"/></p></li>
141145
<li><p><code>fit_pandas_GUI()</code>: A GUI with six steps to lead the user through fitting
142-
Pandas data to a line, polynomial, exponential, Gaussian or sine function.</p>
146+
Pandas data to a line, polynomial, exponential, Gaussian or sine function.
147+
<strong>Selecting regions of the data set to fit does NOT currently
148+
work in Colab</strong>.</p>
143149

144150
<p><img src = "https://jupyterphysscilab.github.io/jupyter_Pandas_GUI/DataSets/GUI_fitexp_1.png" style="width:90%;"/></p></li>
145151
</ul>
@@ -148,7 +154,6 @@ <h4 id="wishlist">Wishlist:</h4>
148154

149155
<ul>
150156
<li>GUIs for plots beyond scatter/line plots.</li>
151-
<li>Make the GUIs work in Jupyter Lab.</li>
152157
</ul>
153158

154159
<h4 id="usage">Usage:</h4>
@@ -197,15 +202,16 @@ <h4 id="installation">Installation:</h4>
197202
<li><p>Install using pip.</p>
198203

199204
<ol>
200-
<li><code>$ pip install jupyter-Pandas-GUI</code>. This will install
205+
<li><code>pip install jupyter-Pandas-GUI</code>. This will install
201206
Jupyter into the same virtual
202207
environment if you do not already have it on your machine. If Jupyter is already
203208
installed the virtual environment will use the existing installation. This takes
204209
a long time on a Raspberry Pi. It will not run on a 3B+ without at least 1 GB of
205210
swap. See: <a href="https://www.uwosh.edu/facstaff/gutow/computer-and-programming-how-tos/installing-jupyter-on-raspberrian">Build Jupyter on a Pi
206211
</a>.</li>
207212
<li>Still within the environment shell test this by starting jupyter
208-
<code>$ jupyter notebook</code>. Jupyter should launch in your browser.
213+
<code>jupyter notebook</code> or <code>Jupyter lab</code>. The version of Jupyter requested should
214+
launch in your browser.
209215
<ol>
210216
<li>Open a new notebook using the default (Python 3) kernel.</li>
211217
<li>In the first cell import the pandas_GUI module:
@@ -241,6 +247,17 @@ <h4 id="installation">Installation:</h4>
241247
<h4 id="change-log">Change Log</h4>
242248

243249
<ul>
250+
<li>0.7.0
251+
<ul>
252+
<li>GUIs now also work in Jupyter Lab and Google Colab, although less
253+
elegently than in classic Jupyter. Only the fit range selection tab
254+
does not yet work in Google Colab.</li>
255+
<li>Some minor bug fixes and clarification of instructions.</li>
256+
<li>More and better comments in generated code.</li>
257+
<li>Replacement of notebook cell javascript tools with those from JPSLUtils
258+
is complete.</li>
259+
</ul></li>
260+
<li>0.6.2.1 Fix for python move of <code>Iterable</code> to <code>collections.abc</code></li>
244261
<li>0.6.2
245262
<ul>
246263
<li>Can now pass dataframes to the GUIs and they will search for additional

0 commit comments

Comments
 (0)