Skip to content

Commit

Permalink
modified examples to remove unpacking numpy array into list
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheusser committed Apr 18, 2017
1 parent 4801f25 commit 7117ef1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
3 changes: 1 addition & 2 deletions examples/animate.py
Expand Up @@ -17,8 +17,7 @@
import numpy as np

data = hyp.tools.load('weights')
w = [i for i in data]
aligned_w = hyp.tools.align(w)
aligned_w = hyp.tools.align(data)

w1 = np.mean(aligned_w[:17],0)
w2 = np.mean(aligned_w[18:],0)
Expand Down
9 changes: 4 additions & 5 deletions examples/plot_align.py
Expand Up @@ -18,10 +18,9 @@
import numpy as np

data = hyp.tools.load('weights')
w = [i for i in data]
aligned_w = hyp.tools.align(w)
aligned_data = hyp.tools.align(data)

w1 = np.mean(aligned_w[:17],0)
w2 = np.mean(aligned_w[18:],0)
group1 = np.mean(aligned_data[:17],0)
group2 = np.mean(aligned_data[18:],0)

hyp.plot([w1[:100,:],w2[:100,:]])
hyp.plot([group1[:100,:],group2[:100,:]])
5 changes: 2 additions & 3 deletions examples/save_image.py
Expand Up @@ -15,7 +15,6 @@
import scipy.io as sio
import numpy as np

data = hyp.tools.load('weights')
w=[i for i in data[0:3]]
data = hyp.tools.load('weights_sample')

hyp.plot(w,'o', save_path='test-image.pdf')
hyp.plot(data, 'o', save_path='test-image.pdf')
9 changes: 4 additions & 5 deletions examples/save_movie.py
Expand Up @@ -17,10 +17,9 @@
import numpy as np

data = hyp.tools.load('weights')
w = [i for i in data]
aligned_w = hyp.tools.align(w)
aligned_data = hyp.tools.align(data)

w1 = np.mean(aligned_w[:17],0)
w2 = np.mean(aligned_w[18:],0)
group1 = np.mean(aligned_data[:17], 0)
group2 = np.mean(aligned_data[18:], 0)

hyp.plot([w1,w2], animate=True, zoom=2.5, save_path='animation.mp4')
hyp.plot([group1, group2], animate=True, zoom=2.5, save_path='animation.mp4')

0 comments on commit 7117ef1

Please sign in to comment.