From c4332a38becaea3b48f48dd15c8844aebd1b8b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Sat, 20 Jul 2019 18:49:45 +0200 Subject: [PATCH 01/11] Fix new issue with Mayavi dependencies --- src/python/espressomd/visualization.pyx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/python/espressomd/visualization.pyx b/src/python/espressomd/visualization.pyx index 5947d81d258..db417c0a31a 100644 --- a/src/python/espressomd/visualization.pyx +++ b/src/python/espressomd/visualization.pyx @@ -6,12 +6,16 @@ try: from .visualization_mayavi import mayaviLive else: raise ImportError("Cannot connect to X server") -except ImportError as e: - class mayaviLive(object): - deferred_ImportError = e +except BaseException as e: + if isinstance(e, ImportError) or isinstance(e, RuntimeError) and \ + e.args[0] == 'No pyface.toolkits plugin could be loaded for wx': + class mayaviLive(object): + deferred_ImportError = e - def __init__(self, *args, **kwargs): - raise self.deferred_ImportError + def __init__(self, *args, **kwargs): + raise self.deferred_ImportError + else: + raise e try: from .visualization_opengl import openGLLive From 028ad7981bdb61f5ea2b5886d30c8609d48cfee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Sat, 20 Jul 2019 18:52:13 +0200 Subject: [PATCH 02/11] Update tutorials kernel to Python3 Python2 is not supported anymore. Tutorials now start with the Python3 kernel. --- doc/tutorials/01-lennard_jones/01-lennard_jones.ipynb | 10 +++++----- .../02-charged_system/02-charged_system-1.ipynb | 10 +++++----- .../02-charged_system/02-charged_system-2.ipynb | 10 +++++----- .../04-lattice_boltzmann_part1.ipynb | 10 +++++----- .../04-lattice_boltzmann_part2.ipynb | 10 +++++----- .../04-lattice_boltzmann_part3.ipynb | 10 +++++----- .../04-lattice_boltzmann_part4.ipynb | 10 +++++----- .../05-raspberry_electrophoresis.ipynb | 10 +++++----- doc/tutorials/08-visualization/08-visualization.ipynb | 10 +++++----- doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb | 10 +++++----- doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb | 10 +++++----- doc/tutorials/11-ferrofluid/11-ferrofluid_part3.ipynb | 10 +++++----- 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/doc/tutorials/01-lennard_jones/01-lennard_jones.ipynb b/doc/tutorials/01-lennard_jones/01-lennard_jones.ipynb index 940b5fb2db7..c92c3f7cf47 100644 --- a/doc/tutorials/01-lennard_jones/01-lennard_jones.ipynb +++ b/doc/tutorials/01-lennard_jones/01-lennard_jones.ipynb @@ -598,21 +598,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.15rc1" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/02-charged_system/02-charged_system-1.ipynb b/doc/tutorials/02-charged_system/02-charged_system-1.ipynb index d3a3354ba26..61f6d856831 100644 --- a/doc/tutorials/02-charged_system/02-charged_system-1.ipynb +++ b/doc/tutorials/02-charged_system/02-charged_system-1.ipynb @@ -461,21 +461,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.14" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/02-charged_system/02-charged_system-2.ipynb b/doc/tutorials/02-charged_system/02-charged_system-2.ipynb index 2afb32949a7..fed6d5a19cb 100644 --- a/doc/tutorials/02-charged_system/02-charged_system-2.ipynb +++ b/doc/tutorials/02-charged_system/02-charged_system-2.ipynb @@ -471,21 +471,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.14" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part1.ipynb b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part1.ipynb index f7e8775ca0f..8528d0a2251 100644 --- a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part1.ipynb +++ b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part1.ipynb @@ -521,21 +521,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.12" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part2.ipynb b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part2.ipynb index d8e68103332..9a152884286 100644 --- a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part2.ipynb +++ b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part2.ipynb @@ -192,21 +192,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.12" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb index 9273fab2eab..4d57a7f67b4 100644 --- a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb +++ b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb @@ -187,21 +187,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.12" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part4.ipynb b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part4.ipynb index 431b546bc41..59bb2ae11b8 100644 --- a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part4.ipynb +++ b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part4.ipynb @@ -124,21 +124,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.12" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/05-raspberry_electrophoresis/05-raspberry_electrophoresis.ipynb b/doc/tutorials/05-raspberry_electrophoresis/05-raspberry_electrophoresis.ipynb index ba32ec538b0..ac1c46563cd 100644 --- a/doc/tutorials/05-raspberry_electrophoresis/05-raspberry_electrophoresis.ipynb +++ b/doc/tutorials/05-raspberry_electrophoresis/05-raspberry_electrophoresis.ipynb @@ -615,21 +615,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.12" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/08-visualization/08-visualization.ipynb b/doc/tutorials/08-visualization/08-visualization.ipynb index f217b0f45ef..afdd9c25d3a 100644 --- a/doc/tutorials/08-visualization/08-visualization.ipynb +++ b/doc/tutorials/08-visualization/08-visualization.ipynb @@ -384,21 +384,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.15rc1" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb b/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb index a4ec29660d3..c95205b8230 100644 --- a/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb +++ b/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb @@ -820,21 +820,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.15rc1" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb b/doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb index 259875c8d57..23689af8240 100644 --- a/doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb +++ b/doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb @@ -852,21 +852,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.15rc1" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, diff --git a/doc/tutorials/11-ferrofluid/11-ferrofluid_part3.ipynb b/doc/tutorials/11-ferrofluid/11-ferrofluid_part3.ipynb index 2f4922eaa59..c310b248b70 100644 --- a/doc/tutorials/11-ferrofluid/11-ferrofluid_part3.ipynb +++ b/doc/tutorials/11-ferrofluid/11-ferrofluid_part3.ipynb @@ -680,21 +680,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.15rc1" + "pygments_lexer": "ipython3", + "version": "3.6.8" } }, "nbformat": 4, From 48e9682246c4930530f3e4efe9f5504cb375605f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Sat, 20 Jul 2019 18:54:26 +0200 Subject: [PATCH 03/11] Fix matplotlib plotting in notebook mode Having the matplotlib import statement in the same cell as plt.show() causes the matplotlib object to be returned instead of being drawn in the notebook. The user has to run the cell again to get the plot drawn. --- .../02-charged_system/02-charged_system-2.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/tutorials/02-charged_system/02-charged_system-2.ipynb b/doc/tutorials/02-charged_system/02-charged_system-2.ipynb index fed6d5a19cb..3c897e5a2fd 100644 --- a/doc/tutorials/02-charged_system/02-charged_system-2.ipynb +++ b/doc/tutorials/02-charged_system/02-charged_system-2.ipynb @@ -425,8 +425,15 @@ "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", - "plt.ion()\n", - "\n", + "plt.ion()\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "plt.figure(figsize=(10, 6), dpi=80)\n", "plt.plot(z_values, z_dens_na, label='Na')\n", "plt.plot(z_values, z_dens_cl, label='Cl')\n", From dc7e9824b4422b140e39a004d1d743effdd535fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Sat, 20 Jul 2019 19:02:57 +0200 Subject: [PATCH 04/11] Move main() definition --- .../scripts/nacl_units_vis.py | 159 +++++++++--------- 1 file changed, 81 insertions(+), 78 deletions(-) diff --git a/doc/tutorials/02-charged_system/scripts/nacl_units_vis.py b/doc/tutorials/02-charged_system/scripts/nacl_units_vis.py index e207dc30d8b..665dfb1333f 100644 --- a/doc/tutorials/02-charged_system/scripts/nacl_units_vis.py +++ b/doc/tutorials/02-charged_system/scripts/nacl_units_vis.py @@ -67,88 +67,91 @@ def decreaseTemp(): 'g', visualization_opengl.KeyboardFireEvent.Hold, decreaseTemp)) -def main(): +print("\n--->Setup system") + +# System parameters +n_ppside = 10 +n_part = int(n_ppside**3) +n_ionpairs = n_part / 2 +density = 1.5736 +time_step = 0.001823 +temp = 298.0 +gamma = 20.0 +#l_bjerrum = 0.885^2 * e^2/(4*pi*epsilon_0*k_B*T) +l_bjerrum = 130878.0 / temp + +num_steps_equilibration = 30 + +# Particle parameters +types = {"Cl": 0, "Na": 1} +numbers = {"Cl": n_ionpairs, "Na": n_ionpairs} +charges = {"Cl": -1.0, "Na": 1.0} +lj_sigmas = {"Cl": 3.85, "Na": 2.52} +lj_epsilons = {"Cl": 192.45, "Na": 17.44} + +lj_cuts = {"Cl": 3.0 * lj_sigmas["Cl"], + "Na": 3.0 * lj_sigmas["Na"]} + +masses = {"Cl": 35.453, "Na": 22.99} + +# Setup System +box_l = (n_ionpairs * sum(masses.values()) / density)**(1. / 3.) +system.box_l = [box_l, box_l, box_l] +system.periodicity = [1, 1, 1] +system.time_step = time_step +system.cell_system.skin = 0.3 +system.thermostat.set_langevin(kT=temp, gamma=gamma, seed=42) + +# Place particles on a face-centered cubic lattice +q = 1 +l = box_l / n_ppside +for i in range(n_ppside): + for j in range(n_ppside): + for k in range(n_ppside): + p = numpy.array([i, j, k]) * l + if q < 0: + system.part.add(id=len( + system.part), type=types["Cl"], pos=p, q=charges["Cl"], mass=masses["Cl"]) + else: + system.part.add(id=len( + system.part), type=types["Na"], pos=p, q=charges["Na"], mass=masses["Na"]) - print("\n--->Setup system") - - # System parameters - n_ppside = 10 - n_part = int(n_ppside**3) - n_ionpairs = n_part / 2 - density = 1.5736 - time_step = 0.001823 - temp = 298.0 - gamma = 20.0 - #l_bjerrum = 0.885^2 * e^2/(4*pi*epsilon_0*k_B*T) - l_bjerrum = 130878.0 / temp - - num_steps_equilibration = 30 - - # Particle parameters - types = {"Cl": 0, "Na": 1} - numbers = {"Cl": n_ionpairs, "Na": n_ionpairs} - charges = {"Cl": -1.0, "Na": 1.0} - lj_sigmas = {"Cl": 3.85, "Na": 2.52} - lj_epsilons = {"Cl": 192.45, "Na": 17.44} - - lj_cuts = {"Cl": 3.0 * lj_sigmas["Cl"], - "Na": 3.0 * lj_sigmas["Na"]} - - masses = {"Cl": 35.453, "Na": 22.99} - - # Setup System - box_l = (n_ionpairs * sum(masses.values()) / density)**(1. / 3.) - system.box_l = [box_l, box_l, box_l] - system.periodicity = [1, 1, 1] - system.time_step = time_step - system.cell_system.skin = 0.3 - system.thermostat.set_langevin(kT=temp, gamma=gamma, seed=42) - - # Place particles on a face-centered cubic lattice - q = 1 - l = box_l / n_ppside - for i in range(n_ppside): - for j in range(n_ppside): - for k in range(n_ppside): - p = numpy.array([i, j, k]) * l - if q < 0: - system.part.add(id=len( - system.part), type=types["Cl"], pos=p, q=charges["Cl"], mass=masses["Cl"]) - else: - system.part.add(id=len( - system.part), type=types["Na"], pos=p, q=charges["Na"], mass=masses["Na"]) - - q *= -1 q *= -1 q *= -1 + q *= -1 + + +def combination_rule_epsilon(rule, eps1, eps2): + if rule == "Lorentz": + return (eps1 * eps2)**0.5 + else: + return ValueError("No combination rule defined") + + +def combination_rule_sigma(rule, sig1, sig2): + if rule == "Berthelot": + return (sig1 + sig2) * 0.5 + else: + return ValueError("No combination rule defined") + +# Lennard-Jones interactions parameters +for s in [["Cl", "Na"], ["Cl", "Cl"], ["Na", "Na"]]: + lj_sig = combination_rule_sigma( + "Berthelot", lj_sigmas[s[0]], lj_sigmas[s[1]]) + lj_cut = combination_rule_sigma( + "Berthelot", lj_cuts[s[0]], lj_cuts[s[1]]) + lj_eps = combination_rule_epsilon( + "Lorentz", lj_epsilons[s[0]], lj_epsilons[s[1]]) + + system.non_bonded_inter[types[s[0]], types[s[1]]].lennard_jones.set_params( + epsilon=lj_eps, sigma=lj_sig, cutoff=lj_cut, shift="auto") - def combination_rule_epsilon(rule, eps1, eps2): - if rule == "Lorentz": - return (eps1 * eps2)**0.5 - else: - return ValueError("No combination rule defined") - - def combination_rule_sigma(rule, sig1, sig2): - if rule == "Berthelot": - return (sig1 + sig2) * 0.5 - else: - return ValueError("No combination rule defined") - - # Lennard-Jones interactions parameters - for s in [["Cl", "Na"], ["Cl", "Cl"], ["Na", "Na"]]: - lj_sig = combination_rule_sigma( - "Berthelot", lj_sigmas[s[0]], lj_sigmas[s[1]]) - lj_cut = combination_rule_sigma( - "Berthelot", lj_cuts[s[0]], lj_cuts[s[1]]) - lj_eps = combination_rule_epsilon( - "Lorentz", lj_epsilons[s[0]], lj_epsilons[s[1]]) - - system.non_bonded_inter[types[s[0]], types[s[1]]].lennard_jones.set_params( - epsilon=lj_eps, sigma=lj_sig, cutoff=lj_cut, shift="auto") - - print("\n--->Tuning Electrostatics") - p3m = electrostatics.P3M(prefactor=l_bjerrum, accuracy=1e-2) - system.actors.add(p3m) +print("\n--->Tuning Electrostatics") +p3m = electrostatics.P3M(prefactor=l_bjerrum, accuracy=1e-2) +system.actors.add(p3m) + + +def main(): print("\n--->Temperature Equilibration") system.time = 0.0 From 67033d4199d3c762ca6c3cb641a15200205f7bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Mon, 22 Jul 2019 11:32:31 +0200 Subject: [PATCH 05/11] Fix matplotlib plotting in notebook mode Same as 48e9682246c. --- doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb | 1 - doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb b/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb index c95205b8230..b96d7e1633a 100644 --- a/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb +++ b/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb @@ -785,7 +785,6 @@ "metadata": {}, "outputs": [], "source": [ - "import matplotlib.pyplot as plt\n", "plt.figure(figsize=(10,10))\n", "plt.grid()\n", "plt.xticks(range(0,20))\n", diff --git a/doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb b/doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb index 23689af8240..ed899c4ccb7 100644 --- a/doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb +++ b/doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb @@ -248,7 +248,15 @@ "metadata": {}, "outputs": [], "source": [ - "import matplotlib.pyplot as plt\n", + "import matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "plt.figure(figsize=(10,10))\n", "plt.xlim(0, box_size)\n", "plt.ylim(0, box_size)\n", From c719778a76ab89dea9bcbe39e508ad8ae0d66851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Mon, 22 Jul 2019 11:34:49 +0200 Subject: [PATCH 06/11] Fix base64 encoding error in Python3 --- doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb | 6 ++++-- doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb b/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb index b96d7e1633a..07012da5bf4 100644 --- a/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb +++ b/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb @@ -612,6 +612,7 @@ "import matplotlib.pyplot as plt\n", "import matplotlib.animation as animation\n", "from tempfile import NamedTemporaryFile\n", + "import base64\n", "\n", "VIDEO_TAG = \"\"\"