Skip to content

Commit

Permalink
Merge branch 'textbox_for_snippet'
Browse files Browse the repository at this point in the history
  • Loading branch information
gutow committed Jul 15, 2022
2 parents c61c67b + 686d7f7 commit 4484bb4
Show file tree
Hide file tree
Showing 17 changed files with 2,194 additions and 1,291 deletions.
9 changes: 2 additions & 7 deletions Development Notes.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
[General](#general-notes) | [Make Docs](#constructing-the-documentation) |
[Build PyPi Package](#building-pypi-package)|
## General Notes
1. Have not completely converted to JPSLUtils for javascript tools and
accessing code cells. This will need to be complete before trying to
make the software JLab vs ClassicNB aware.
2. Thoughts on GUI for loading data. Could use ipyfilechooser to select
1. Thoughts on GUI for loading data. Could use ipyfilechooser to select
local files. A dropdown for html vs csv to filter and select the reader.
A checkbox for the index (label) column or not in file. The html loader
creates an array of dataframes, one for each table.
3. To make it work across more platforms could try having the computed code
block built in a textbox widget. This looses the syntax highlighting,
but would allow copy and paste into cells in things like Colab.
2. To make it work across more platforms could try having the computed code.

## Constructing the Documentation

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

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

The user can pass the GUI tools a list of Pandas
DataFrames to work with. If nothing is passed, the GUI will look for
Pandas DataFrames in the interactive session. The whole GUI and the Jupyter
cell that created it are deleted when done. This leaves only the code that was
generated by the GUI and the results of running the generated code.

The generated code contains sparse comments meant to help new users
Pandas DataFrames in the interactive session. In classic Jupyter the whole GUI
and the Jupyter cell that created it are deleted when done. This leaves
only the code that was generated by the GUI and the results of running the
generated code. In Colab and Lab the code is generated in an editable text
box. In Colab it can be run by clicking a button. In Lab it is best to copy
the code into a new cell before running it.

The generated code contains comments meant to help new users
understand the code.

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

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

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

#### Wishlist:

* GUIs for plots beyond scatter/line plots.
* Make the GUIs work in Jupyter Lab.

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

#### Change Log
* 0.7.0
* GUIs now also work in Jupyter Lab and Google Colab, although less
elegently than in classic Jupyter. Only the fit range selection tab
does not yet work in Google Colab.
* Some minor bug fixes and clarification of instructions.
* More and better comments in generated code.
* Replacement of notebook cell javascript tools with those from JPSLUtils
is complete.
* 0.6.2.1 Fix for python move of `Iterable` to `collections.abc`
* 0.6.2
* Can now pass dataframes to the GUIs and they will search for additional
Expand Down
Binary file added docs/DataSets/new_col_in_Colab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions docs/Lab_Colab_vs_NBClassic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pandas GUI behavior in Lab and Colab versus Classic Jupyter</title>
</head>
<body>
<h1>Pandas GUI behavior in Lab and Colab versus Classic Jupyter</h1>
<a href="https://jupyterphysscilab.github.io/jupyter_Pandas_GUI/">
Return to Documentation Home Page</a>
<h2>Introduction</h2>
<p>The examples in the documentation are all based on how the GUI tools work
in the classic
Jupyter notebook environment. If you are using these tools in
<a href = "https://jupyter.org/">Jupyter Lab</a> or
<a href = "https://colab.research.google.com">Google Colab</a> keep in
mind the differences in behavior described below.</p>
<h2>Differences common to Lab and Colab</h2>
<ul>
<li>Rather then generate the code directly in a notebook cell
immediately below the tabbed GUI, the code is generated in an
editable textarea below the tabbed GUI. See the image below for
the <code>new_pandas_column_GUI()</code>.</li>
<image src = "DataSets/new_col_in_Colab.png"></image>
<li>If you wish the generated code to persist after cell outputs are
cleared, the generated code needs to be manually copied to a code
cell.</li>
</ul>
<h2>Running the code in Lab and Colab</h2>
<uL>
<li><span style="color:blue;">In Colab</span> the code can be run by
clicking on the "run code" button and the results will appear in
the output of the cell.</li>
<li><span style="color:red;">In Lab</span> clicking on the "run code"
button will output the results to the log console,
which defaults to appearing at the bottom of the window. To make
the results appear in the output of a notebook cell the code must
be copied to a cell and the cell run.</li>
</uL>
<a href="https://jupyterphysscilab.github.io/jupyter_Pandas_GUI/">
Return to Documentation Home Page</a>
</body>
</html>
11 changes: 9 additions & 2 deletions docs/Pandas_GUI_Doc_Home.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<H3>Usage Examples</H3>
<ul>
<li><a href = "Overview_Demo_pandas_GUI.html">Quick Overview</a></li>
<li><a href = "Lab_Colab_vs_NBClassic.html">Behavior in Jupyter Lab and
Google Colab</a></li>
<li><a href="New_calculated_column.html">New Calculated Column</a></li>
<li>Plotting
<ul><li>
Expand Down Expand Up @@ -76,8 +78,13 @@ <h3><a href="https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI">GIT
<a href="https://python.org">Python</a> 3 kernel. See the <a href
="pandas_GUI.html">documentation</a>
for more detailed information on usage and installation.</p>
<h5>Currently these tools only work in classic Jupyter notebooks. They
do not yet work in Jupyter Lab.</h5>
<h5>These tools work in classic Jupyter notebooks, Jupyter Lab and
Google Colab.</h5>
<p>The interface is less elegant in Jupyter Lab and Colab than in
classic Jupyter, because the generated code cannot be built
directly in a code cell. Clicking on a graph of the data
to select regions of the data to fit does not yet work in
<a href="https://colab.research.google.com/">Google Colab</a>.</p>
</main>
<script>
function escapeHTML(html) {
Expand Down
36 changes: 25 additions & 11 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
This package provides GUI tools to help the user construct Pandas and Python
expressions
to create things such as new calculated columns, plots or fits. The tools are
meant to run in an interactive Jupyter notebook. **Currently, they only work
in the classic Jupyter notebook and not Jupyter lab.** All tools are based on
Jupyter widgets.
meant to run in an interactive Jupyter notebook in
[classic Jupyter](https://jupyter-notebook.readthedocs.io/en/latest/),
[Jupyter Lab](https://jupyterlab.readthedocs.io/en/stable/)
and [Google Colab](https://colab.research.google.com/). All tools are based on ipywidgets widgets.

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

The user can pass the GUI tools a list of Pandas
DataFrames to work with. If nothing is passed, the GUI will look for
Pandas DataFrames in the interactive session. The whole GUI and the Jupyter
cell that created it are deleted when done. This leaves only the code that was
generated by the GUI and the results of running the generated code.

The generated code contains sparse comments meant to help new users
Pandas DataFrames in the interactive session. In classic Jupyter the whole GUI
and the Jupyter cell that created it are deleted when done. This leaves
only the code that was generated by the GUI and the results of running the
generated code. In Colab and Lab the code is generated in an editable text
box. In Colab it can be run by clicking a button. In Lab it is best to copy
the code into a new cell before running it.

The generated code contains comments meant to help new users
understand the code.

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

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

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

#### Wishlist:

* GUIs for plots beyond scatter/line plots.
* Make the GUIs work in Jupyter Lab.

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

#### Change Log
* 0.7.0
* GUIs now also work in Jupyter Lab and Google Colab, although less
elegently than in classic Jupyter. Only the fit range selection tab
does not yet work in Google Colab.
* Some minor bug fixes and clarification of instructions.
* More and better comments in generated code.
* Replacement of notebook cell javascript tools with those from JPSLUtils
is complete.
* 0.6.2.1 Fix for python move of `Iterable` to `collections.abc`
* 0.6.2
* Can now pass dataframes to the GUIs and they will search for additional
Expand Down
43 changes: 30 additions & 13 deletions docs/pandas_GUI.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h2>API Documentation</h2>
</ul>


<footer>jupyter_Pandas_GUI v0.6.2.1</footer>
<footer>jupyter_Pandas_GUI v0.7.0</footer>

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

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

<p>The user can pass the GUI tools a list of Pandas
DataFrames to work with. If nothing is passed, the GUI will look for
Pandas DataFrames in the interactive session. The whole GUI and the Jupyter
cell that created it are deleted when done. This leaves only the code that was
generated by the GUI and the results of running the generated code.</p>

<p>The generated code contains sparse comments meant to help new users
Pandas DataFrames in the interactive session. In classic Jupyter the whole GUI
and the Jupyter cell that created it are deleted when done. This leaves
only the code that was generated by the GUI and the results of running the
generated code. In Colab and Lab the code is generated in an editable text
box. In Colab it can be run by clicking a button. In Lab it is best to copy
the code into a new cell before running it.</p>

<p>The generated code contains comments meant to help new users
understand the code.</p>

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

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

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

<ul>
<li>GUIs for plots beyond scatter/line plots.</li>
<li>Make the GUIs work in Jupyter Lab.</li>
</ul>

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

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

<ul>
<li>0.7.0
<ul>
<li>GUIs now also work in Jupyter Lab and Google Colab, although less
elegently than in classic Jupyter. Only the fit range selection tab
does not yet work in Google Colab.</li>
<li>Some minor bug fixes and clarification of instructions.</li>
<li>More and better comments in generated code.</li>
<li>Replacement of notebook cell javascript tools with those from JPSLUtils
is complete.</li>
</ul></li>
<li>0.6.2.1 Fix for python move of <code>Iterable</code> to <code>collections.abc</code></li>
<li>0.6.2
<ul>
<li>Can now pass dataframes to the GUIs and they will search for additional
Expand Down
Loading

0 comments on commit 4484bb4

Please sign in to comment.