Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 871 quickplot #886

Merged
merged 26 commits into from
Mar 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c1e615e
#871 start making changes to quickplot, still working on 3D
valentinsulzer Mar 5, 2020
4a10ad0
Merge branch 'develop' into issue-871-quickplot
valentinsulzer Mar 11, 2020
b1377bc
#871 more work on 3d
valentinsulzer Mar 11, 2020
5ea27f0
Merge branch 'develop' of github.com:pybamm-team/PyBaMM into issue-87…
valentinsulzer Mar 11, 2020
cf400bf
#871 move widgets to quickplot, accept simulations as inputs
valentinsulzer Mar 11, 2020
98f5434
#871 get 3D working ok
valentinsulzer Mar 11, 2020
a50bdee
#871 cosmetic improvements
valentinsulzer Mar 12, 2020
5fedf67
#871 spatial vars
valentinsulzer Mar 12, 2020
71076fc
Merge branch 'develop' into issue-871-quickplot
valentinsulzer Mar 12, 2020
3189c48
Merge branch 'issue-871-quickplot' of github.com:pybamm-team/PyBaMM i…
valentinsulzer Mar 12, 2020
c74ba60
#871 fix docs
valentinsulzer Mar 12, 2020
bcfba9f
Merge branch 'develop' of github.com:pybamm-team/PyBaMM into issue-87…
valentinsulzer Mar 13, 2020
6bac2d7
#871 fix coverage and remove redundant test
valentinsulzer Mar 13, 2020
0b65f65
#871 improve 2d
valentinsulzer Mar 13, 2020
cd88ea9
#871 coverage again
valentinsulzer Mar 13, 2020
7ec446d
#871 merge develop
valentinsulzer Mar 17, 2020
9e9352c
#871 trying one way of varying axes, not super promising
valentinsulzer Mar 17, 2020
9572618
is_notebook return false if running in ipython interactive shell
TomTranter Mar 18, 2020
c3c7083
Merge branch 'issue-871-quickplot' of github.com:pybamm-team/PyBaMM i…
valentinsulzer Mar 18, 2020
0853d1b
#871 merge master
valentinsulzer Mar 20, 2020
8532c55
#871 fix variable limits for 1D plots
valentinsulzer Mar 20, 2020
d95909b
#871 fix 2d plots
valentinsulzer Mar 20, 2020
1b5233f
#871 test and coverage
valentinsulzer Mar 20, 2020
76d5ad7
#871 fix docs
valentinsulzer Mar 21, 2020
2e225bd
#871 coverage
valentinsulzer Mar 21, 2020
c76a8a2
#871 merge master
valentinsulzer Mar 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exclude=
share,
pyvenv.cfg,
third-party,
sundials-5.0.0,
ignore=
# False positive for white space before ':' on list slice
# black should format these correctly
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@

## Features

<<<<<<< HEAD
- Added functionality to broadcast to edges ([#891](https://github.com/pybamm-team/PyBaMM/pull/891))
- Reformatted and cleaned up `QuickPlot` ([#886](https://github.com/pybamm-team/PyBaMM/pull/886))
- Added thermal effects to lead-acid models ([#885](https://github.com/pybamm-team/PyBaMM/pull/885))
- Add new symbols `VariableDot`, representing the derivative of a variable wrt time,
and `StateVectorDot`, representing the derivative of a state vector wrt time
([#858](https://github.com/pybamm-team/PyBaMM/issues/858))
=======
- Add new symbols `VariableDot`, representing the derivative of a variable wrt time,
and `StateVectorDot`, representing the derivative of a state vector wrt time
([#858](https://github.com/pybamm-team/PyBaMM/issues/858))
- Added functionality to broadcast to edges
([#891](https://github.com/pybamm-team/PyBaMM/pull/891))
>>>>>>> 1b0e0c59154736ed48c92f45e042a9f006f33162
- Added additional notebooks showing how to create and compare models ([#877](https://github.com/pybamm-team/PyBaMM/pull/877))
- Added `Minimum`, `Maximum` and `Sign` operators
([#876](https://github.com/pybamm-team/PyBaMM/pull/876))
Expand Down
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ Contents
source/spatial_methods/index
source/solvers/index
source/experiments/index
source/simulation
source/quick_plot
source/processed_variable
source/util
source/simulation
source/citations
source/parameters_cli

Expand Down
5 changes: 5 additions & 0 deletions docs/source/quick_plot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Quick Plot
==========

.. autoclass:: pybamm.QuickPlot
:members:
32 changes: 12 additions & 20 deletions examples/notebooks/change-input-current.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "528740d94922483b86f14724fcfa32b8",
"model_id": "8247adc1a3fd42dba31101bc6b501ed9",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.0006659775771737802, step=0.005), Output()…"
"interactive(children=(FloatSlider(value=0.0, description='t', max=15.050167224080266, step=0.15050167224080266…"
]
},
"metadata": {},
Expand All @@ -98,9 +98,7 @@
"\n",
"# plot\n",
"quick_plot = pybamm.QuickPlot(solution)\n",
"\n",
"import ipywidgets as widgets\n",
"widgets.interact(quick_plot.plot, t=widgets.FloatSlider(min=0,max=solution.t[-1],step=0.005,value=0));"
"quick_plot.dynamic_plot();"
]
},
{
Expand All @@ -118,12 +116,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2811c58f82064ae6b2e558d33c5551fd",
"model_id": "511a6922f3f34350a543367723f09572",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.022125255063884477, step=0.005), Output())…"
"interactive(children=(FloatSlider(value=0.0, description='t', max=500.0, step=5.0), Output()), _dom_classes=('…"
]
},
"metadata": {},
Expand All @@ -136,9 +134,7 @@
"\n",
"# plot\n",
"quick_plot = pybamm.QuickPlot(solution)\n",
"\n",
"import ipywidgets as widgets\n",
"widgets.interact(quick_plot.plot, t=widgets.FloatSlider(min=0,max=solution.t[-1],step=0.005,value=0));"
"quick_plot.dynamic_plot();"
]
},
{
Expand All @@ -158,12 +154,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8bad57c00aec41bd85c17bec2981a8da",
"model_id": "def542dad39b4ddebcd9a555cf684580",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.026550306076661374, step=0.001), Output())…"
"interactive(children=(FloatSlider(value=0.0, description='t', max=600.0, step=6.0), Output()), _dom_classes=('…"
]
},
"metadata": {},
Expand Down Expand Up @@ -195,9 +191,7 @@
"\n",
"# plot\n",
"quick_plot = pybamm.QuickPlot(solution)\n",
"\n",
"import ipywidgets as widgets\n",
"widgets.interact(quick_plot.plot, t=widgets.FloatSlider(min=0,max=solution.t[-1],step=0.001,value=0));"
"quick_plot.dynamic_plot();"
]
},
{
Expand Down Expand Up @@ -279,12 +273,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "47c47acd733b46428148e9dc7cdf373e",
"model_id": "7f4df64df94d410fb9aff92003538b14",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.0013275153038330688, step=6.63757651916534…"
"interactive(children=(FloatSlider(value=0.0, description='t', max=30.0, step=0.3), Output()), _dom_classes=('w…"
]
},
"metadata": {},
Expand All @@ -309,9 +303,7 @@
"# plot current and voltage\n",
"output_variables = [\"Current [A]\", \"Terminal voltage [V]\"]\n",
"quick_plot = pybamm.QuickPlot(solution, output_variables, label)\n",
"\n",
"import ipywidgets as widgets\n",
"widgets.interact(quick_plot.plot, t=widgets.FloatSlider(min=0,max=solution.t[-1],step=solution.t[-1]/20,value=0));"
"quick_plot.dynamic_plot();"
]
},
{
Expand Down
12 changes: 5 additions & 7 deletions examples/notebooks/models/DFN.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"To get a quick overview of the model outputs we can use the QuickPlot class, which plots a common set of useful outputs. The method Quickplot.plot(t) is simply a function which either can be used statically to create a plot for a particular time, or interactively with a slider widget."
"To get a quick overview of the model outputs we can use the QuickPlot class, which plots a common set of useful outputs. The method `Quickplot.dynamic_plot` makes a slider widget."
]
},
{
Expand All @@ -195,12 +195,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "db794fc42b6743c4a2baad036cc9b5bc",
"model_id": "29f22a3ab3bd4ce8825acdd6fb655f36",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.15930183645996823, step=0.05), Output()), …"
"interactive(children=(FloatSlider(value=0.0, description='t', max=3599.9999999999995, step=35.99999999999999),…"
]
},
"metadata": {},
Expand All @@ -209,9 +209,7 @@
],
"source": [
"quick_plot = pybamm.QuickPlot(solution)\n",
"\n",
"import ipywidgets as widgets\n",
"widgets.interact(quick_plot.plot, t=widgets.FloatSlider(min=0,max=solution.t[-1],step=0.05,value=0));"
"quick_plot.dynamic_plot();"
]
},
{
Expand Down Expand Up @@ -273,7 +271,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
Loading