[yt-svn] commit/yt: 4 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon May 1 08:31:34 PDT 2017


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/bd7bfec01cec/
Changeset:   bd7bfec01cec
Branch:      yt
User:        ngoldbaum
Date:        2017-03-10 01:01:41+00:00
Summary:     Add a cookbook example on how to make movies using matplotlib's animation framework
Affected #:  3 files

diff -r 1088ca4ac8d84017d1809a6f114c852297286350 -r bd7bfec01cec187d304680da277e1117dd95314b doc/extensions/yt_cookbook.py
--- a/doc/extensions/yt_cookbook.py
+++ b/doc/extensions/yt_cookbook.py
@@ -23,7 +23,7 @@
 
     return retdict
 
-data_patterns = ["*.h5", "*.out", "*.dat"]
+data_patterns = ["*.h5", "*.out", "*.dat", "*.mp4"]
 
 class CookbookScript(Directive):
     required_arguments = 1

diff -r 1088ca4ac8d84017d1809a6f114c852297286350 -r bd7bfec01cec187d304680da277e1117dd95314b doc/source/cookbook/complex_plots.rst
--- a/doc/source/cookbook/complex_plots.rst
+++ b/doc/source/cookbook/complex_plots.rst
@@ -71,6 +71,13 @@
 
 .. yt_cookbook:: multi_plot_3x2_FRB.py
 
+Time Series Movie
+~~~~~~~~~~~~~~~~~
+
+This shows how to use matplotlib's animation framework with yt plots.
+
+.. yt_cookbook:: matplotlib-animation.py
+
 .. _cookbook-offaxis_projection:
 
 Off-Axis Projection (an alternate method)

diff -r 1088ca4ac8d84017d1809a6f114c852297286350 -r bd7bfec01cec187d304680da277e1117dd95314b doc/source/cookbook/matplotlib-animation.py
--- /dev/null
+++ b/doc/source/cookbook/matplotlib-animation.py
@@ -0,0 +1,22 @@
+import yt
+from matplotlib.animation import FuncAnimation
+from matplotlib import rc_context
+
+ts = yt.load('GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_*')
+
+plot = yt.SlicePlot(ts[0], 'z', 'density')
+plot.set_zlim('density', 8e-29, 3e-26)
+
+fig = plot.plots['density'].figure
+
+# animate must accept an integer frame number. We use the frame number
+# to identify which dataset in the time series we want to load
+def animate(i):
+    ds = ts[i]
+    plot._switch_ds(ds)
+
+animation = FuncAnimation(fig, animate, frames=len(ts))
+
+# Override matplotlib's defaults to get a nicer looking font
+with rc_context({'mathtext.fontset': 'stix'}):
+    animation.save('animation.mp4')


https://bitbucket.org/yt_analysis/yt/commits/fbfdadf1f907/
Changeset:   fbfdadf1f907
Branch:      yt
User:        ngoldbaum
Date:        2017-03-10 02:05:50+00:00
Summary:     ensure movie files are copied over
Affected #:  1 file

diff -r bd7bfec01cec187d304680da277e1117dd95314b -r fbfdadf1f907abcc288b362fb5d07d0456d9598e doc/helper_scripts/run_recipes.py
--- a/doc/helper_scripts/run_recipes.py
+++ b/doc/helper_scripts/run_recipes.py
@@ -12,7 +12,7 @@
 from multiprocessing import Pool
 from yt.config import ytcfg
 
-FPATTERNS = ['*.png', '*.txt', '*.h5', '*.dat']
+FPATTERNS = ['*.png', '*.txt', '*.h5', '*.dat', '*.mp4']
 DPATTERNS = ['LC*', 'LR', 'DD0046']
 BADF = ['cloudy_emissivity.h5', 'apec_emissivity.h5',
         'xray_emissivity.h5', 'AMRGridData_Slice_x_density.png']


https://bitbucket.org/yt_analysis/yt/commits/16648a21c113/
Changeset:   16648a21c113
Branch:      yt
User:        ngoldbaum
Date:        2017-04-26 17:54:18+00:00
Summary:     blacklist the animation recipe
Affected #:  1 file

diff -r fbfdadf1f907abcc288b362fb5d07d0456d9598e -r 16648a21c11382634523f66677fe05cbee53a905 doc/source/cookbook/tests/test_cookbook.py
--- a/doc/source/cookbook/tests/test_cookbook.py
+++ b/doc/source/cookbook/tests/test_cookbook.py
@@ -36,7 +36,7 @@
 
 
 PARALLEL_TEST = {"rockstar_nest.py": "3"}
-BLACKLIST = ["opengl_ipython.py", "opengl_vr.py"]
+BLACKLIST = ["opengl_ipython.py", "opengl_vr.py", "matplotlib-animation.py"]
 
 if sys.version_info >= (3,0,0):
     BLACKLIST.append("rockstar_nest.py")


https://bitbucket.org/yt_analysis/yt/commits/09d6e114abd2/
Changeset:   09d6e114abd2
Branch:      yt
User:        ngoldbaum
Date:        2017-05-01 15:31:30+00:00
Summary:     Merged in ngoldbaum/yt (pull request #2544)

Add a cookbook example on how to make movies using matplotlib's animation framework

Approved-by: Alexander Lindsay <al007 at illinois.edu>
Approved-by: Kacper Kowalik <xarthisius.kk at gmail.com>
Affected #:  5 files

diff -r 7d5ef3be2dd810cb64faab4838b195e9604f9f71 -r 09d6e114abd2fed4d527359f6c9ed87a59a1e1ac doc/extensions/yt_cookbook.py
--- a/doc/extensions/yt_cookbook.py
+++ b/doc/extensions/yt_cookbook.py
@@ -23,7 +23,7 @@
 
     return retdict
 
-data_patterns = ["*.h5", "*.out", "*.dat"]
+data_patterns = ["*.h5", "*.out", "*.dat", "*.mp4"]
 
 class CookbookScript(Directive):
     required_arguments = 1

diff -r 7d5ef3be2dd810cb64faab4838b195e9604f9f71 -r 09d6e114abd2fed4d527359f6c9ed87a59a1e1ac doc/helper_scripts/run_recipes.py
--- a/doc/helper_scripts/run_recipes.py
+++ b/doc/helper_scripts/run_recipes.py
@@ -12,7 +12,7 @@
 from multiprocessing import Pool
 from yt.config import ytcfg
 
-FPATTERNS = ['*.png', '*.txt', '*.h5', '*.dat']
+FPATTERNS = ['*.png', '*.txt', '*.h5', '*.dat', '*.mp4']
 DPATTERNS = ['LC*', 'LR', 'DD0046']
 BADF = ['cloudy_emissivity.h5', 'apec_emissivity.h5',
         'xray_emissivity.h5', 'AMRGridData_Slice_x_density.png']

diff -r 7d5ef3be2dd810cb64faab4838b195e9604f9f71 -r 09d6e114abd2fed4d527359f6c9ed87a59a1e1ac doc/source/cookbook/complex_plots.rst
--- a/doc/source/cookbook/complex_plots.rst
+++ b/doc/source/cookbook/complex_plots.rst
@@ -71,6 +71,13 @@
 
 .. yt_cookbook:: multi_plot_3x2_FRB.py
 
+Time Series Movie
+~~~~~~~~~~~~~~~~~
+
+This shows how to use matplotlib's animation framework with yt plots.
+
+.. yt_cookbook:: matplotlib-animation.py
+
 .. _cookbook-offaxis_projection:
 
 Off-Axis Projection (an alternate method)

diff -r 7d5ef3be2dd810cb64faab4838b195e9604f9f71 -r 09d6e114abd2fed4d527359f6c9ed87a59a1e1ac doc/source/cookbook/matplotlib-animation.py
--- /dev/null
+++ b/doc/source/cookbook/matplotlib-animation.py
@@ -0,0 +1,22 @@
+import yt
+from matplotlib.animation import FuncAnimation
+from matplotlib import rc_context
+
+ts = yt.load('GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_*')
+
+plot = yt.SlicePlot(ts[0], 'z', 'density')
+plot.set_zlim('density', 8e-29, 3e-26)
+
+fig = plot.plots['density'].figure
+
+# animate must accept an integer frame number. We use the frame number
+# to identify which dataset in the time series we want to load
+def animate(i):
+    ds = ts[i]
+    plot._switch_ds(ds)
+
+animation = FuncAnimation(fig, animate, frames=len(ts))
+
+# Override matplotlib's defaults to get a nicer looking font
+with rc_context({'mathtext.fontset': 'stix'}):
+    animation.save('animation.mp4')

diff -r 7d5ef3be2dd810cb64faab4838b195e9604f9f71 -r 09d6e114abd2fed4d527359f6c9ed87a59a1e1ac doc/source/cookbook/tests/test_cookbook.py
--- a/doc/source/cookbook/tests/test_cookbook.py
+++ b/doc/source/cookbook/tests/test_cookbook.py
@@ -36,7 +36,7 @@
 
 
 PARALLEL_TEST = {"rockstar_nest.py": "3"}
-BLACKLIST = ["opengl_ipython.py", "opengl_vr.py"]
+BLACKLIST = ["opengl_ipython.py", "opengl_vr.py", "matplotlib-animation.py"]
 
 if sys.version_info >= (3,0,0):
     BLACKLIST.append("rockstar_nest.py")

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list