Bump version: 0.1.7 → 0.1.8 (+7 squashed commits)

Squashed commits:
[ac5bb36] Bump version: 0.1.8 → 0.1.9
[8acd6b2] ImportException --> ImportError
[ac410a8] matplotlib.pyplot has errors on import, put these in the functions
that rely on them directly.
[f128a20] Bump version: 0.1.6 → 0.1.7
[5866bea] Remove IPython utils.

These are out of date, and have problems on Linux (without a proper
visual backend).
[a519e56] Bump version: 0.1.5 → 0.1.6
[f45aa83] Bump version: 0.1.4 → 0.1.5
This commit is contained in:
Rowan Cockett
2016-01-10 13:38:06 -08:00
parent 8da717521c
commit 985d5b6469
13 changed files with 50 additions and 107 deletions
-1
View File
@@ -3,7 +3,6 @@ from codeutils import *
from meshutils import exampleLrmGrid, meshTensor, closestPoints, readUBCTensorMesh, writeUBCTensorMesh, writeUBCTensorModel, readVTRFile, writeVTRFile
from curvutils import volTetra, faceInfo, indexCube
from interputils import interpmat
from ipythonutils import easyAnimate as animate
from CounterUtils import *
import ModelBuilder
import SolverUtils
-28
View File
@@ -1,28 +0,0 @@
from tempfile import NamedTemporaryFile
import matplotlib.pyplot as plt
from matplotlib import animation
# http://jakevdp.github.io/blog/2013/05/12/embedding-matplotlib-animations/
# http://www.renevolution.com/how-to-install-ffmpeg-on-mac-os-x/
VIDEO_TAG = """<video controls loop>
<source src="data:video/x-m4v;base64,{0}" type="video/mp4">
Your browser does not support the video tag.
</video>"""
def anim_to_html(anim):
if not hasattr(anim, '_encoded_video'):
with NamedTemporaryFile(suffix='.mp4') as f:
anim.save(f.name, fps=20, extra_args=['-vcodec', 'libx264', '-pix_fmt', 'yuv420p'])
video = open(f.name, "rb").read()
anim._encoded_video = video.encode("base64")
return VIDEO_TAG.format(anim._encoded_video)
def display_animation(anim):
plt.close(anim._fig)
return anim_to_html(anim)
animation.Animation._repr_html_ = display_animation
easyAnimate = animation.FuncAnimation