Skip to content

Commit

Permalink
Merge pull request #7 from JupyterPhysSciLab/auto_save
Browse files Browse the repository at this point in the history
Auto save
  • Loading branch information
gutow authored Jul 16, 2021
2 parents f4abc56 + 36d15e0 commit bab89c6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## jupyter_Pandas_GUI
[Introduction](#introduction) | [Current Features](#current-features) |
[Wishlist](#wishlist) | [Usage](#usage) | [Installation](#installation) |
[Issues or comments](#issues-or-comments) |
[Change Log](#change-log) | [Issues or comments](#issues-or-comments) |
[License](#this-software-is-distributed-under-the-gnu-v3-license)
#### Introduction:

Expand Down Expand Up @@ -107,7 +107,15 @@ _Development_
Simply replace `$ pip install jupyter-Pandas-GUI` with `$ pip
install -e ../jupyter_Pandas_GUI` in the _Production_
instructions.

#### Change Log
* 0.5.2
* Widget states autosaved when a new plot is made.
* Began making use of [JPSLUtils](https://github.com/JupyterPhysSciLab/JPSLUtils).
* 0.5.1
* Possible to use pandas dataframes in namespaces other than the
user global namespace.
* Readme updates.
* 0.5.0 Initial beta release.
#### Issues or comments

[JupyterPhysSciLab/jupyter_Pandas_GUI](https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI)
Expand Down
3 changes: 2 additions & 1 deletion pandas_GUI/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
# load any supporting files

from pandas_GUI.new_pandas_column_GUI import new_pandas_column_GUI
from pandas_GUI.plot_Pandas_GUI import plot_pandas_GUI
from pandas_GUI.plot_Pandas_GUI import plot_pandas_GUI
import JPSLUtils
13 changes: 12 additions & 1 deletion pandas_GUI/plot_Pandas_GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def plot_pandas_GUI(dfs_info=None, show_text_col = False, **kwargs):
insert_text_into_next_cell, insert_text_at_beginning_of_current_cell, \
insert_newline_at_end_of_current_cell, select_containing_cell, \
delete_selected_cell, iconselector, notice_group
import JPSLUtils

if dfs_info == None:
from .utils import find_pandas_dataframe_names
Expand Down Expand Up @@ -533,11 +534,21 @@ def get_mirror_text():
text = figname+'.update_layout(title = \''+plot_title.value+'\', '
text += 'template = \''+ plot_template.value +'\')'
insert_newline_at_end_of_current_cell(text)
text = figname +'.show()'
insert_newline_at_end_of_current_cell(text)
text = '# Force save widget states so that graph will still be'
insert_newline_at_end_of_current_cell(text)
text = '# available when notebook next opened in trusted state.'
insert_newline_at_end_of_current_cell(text)
jscode = 'Jupyter.actions.call(\\"widgets:save-with-widgets\\");'
text = 'JPSLUtils.OTJS(\''+jscode+'\')'
insert_newline_at_end_of_current_cell(text)
# run the cell to build the plot
display(JS('Jupyter.notebook.get_selected_cell().execute()'))
JPSLUtils.OTJS('Jupyter.notebook.get_selected_cell().execute()')
# remove the GUI cell
select_containing_cell('pandasplotGUI')
delete_selected_cell()
from time import sleep
pass
makeplotbut = Button(description = 'Make Plot', disabled = True)
makeplotbut.on_click(makeplt_click)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="jupyter_Pandas_GUI",
version="0.5.1",
version="0.5.2",
description="Pandas expression composers using Jupyter widgets.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand All @@ -23,6 +23,7 @@
'numpy>=1.19.0',
'plotly>=4.14.3',
'ipywidgets>=7.6.2',
'JPSLUtils>=0.5.3',
],
classifiers=[
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit bab89c6

Please sign in to comment.