-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from ianhi/gcf
Use _Backend from matplotlib to simplify the code
- Loading branch information
Showing
5 changed files
with
146 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ js/*.tgz | |
|
||
# OS X | ||
.DS_Store | ||
|
||
# vscode | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
[build-system] | ||
requires = ["jupyter_packaging~=0.7.0", "jupyterlab>=3.0.0,==3.*", "setuptools>=40.8.0", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
|
||
[tool.pytest.ini_options] | ||
testpaths = [ | ||
"test-notebooks", | ||
"examples", | ||
] | ||
norecursedirs = [ | ||
"node_modules", | ||
".ipynb_checkpoints", | ||
] | ||
addopts = "--nbval --current-env" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "antique-treasure", | ||
"metadata": {}, | ||
"source": [ | ||
"# User Automated Testing\n", | ||
"\n", | ||
"A notebook to run manually to catch issues with the backend." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "binary-speaker", | ||
"metadata": {}, | ||
"source": [ | ||
"# 1. Checking plt.show()\n", | ||
"\n", | ||
"The implementation of plt.show relies on the private `matplotlib._pylab_helpers.Gcf` which can break (https://github.com/matplotlib/ipympl/issues/303). The cell should run without any errors." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "agricultural-whole", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%matplotlib ipympl\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"plt.ioff()\n", | ||
"fig = plt.figure()\n", | ||
"plt.plot([0,1],[0,1])\n", | ||
"plt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "secure-consistency", | ||
"metadata": {}, | ||
"source": [ | ||
"# 2 plt.close()\n", | ||
"\n", | ||
"Calling `plt.close()` should prevent further interactions with the figure - so panning and resizing should no longer work after the second cell in this test." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "hollow-front", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"plt.ion()\n", | ||
"plt.figure()\n", | ||
"plt.plot([0,1],[0,1])\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "classical-pavilion", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"plt.close()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |