Skip to content

Commit

Permalink
Python 2 compatibility fixes in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
hakonsbm committed Aug 14, 2018
1 parent 06819c5 commit 4b92278
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pynest/examples/brunel_alpha_evolution_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
'''

from __future__ import print_function
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import numpy as np
Expand Down Expand Up @@ -404,7 +405,7 @@ def optimize(func, mu, sigma, learning_rate_mu=None, learning_rate_sigma=None,
while True:

# create new population using the search distribution
s = np.random.normal(0, 1, size=(population_size, *np.shape(mu)))
s = np.random.normal(0, 1, size=(population_size,) + np.shape(mu))
z = mu + sigma * s

# add mirrored perturbations if enabled
Expand Down
2 changes: 1 addition & 1 deletion pynest/examples/hh_psc_alpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@


# Simulation loop
n_data = dcto / float(dcstep)
n_data = int(dcto / float(dcstep))
amplitudes = np.zeros(n_data)
event_freqs = np.zeros(n_data)
for i, amp in enumerate(range(dcfrom, dcto, dcstep)):
Expand Down
2 changes: 1 addition & 1 deletion pynest/examples/sinusoidal_gamma_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def plot_hist(spikes):
t = 1000
n = 1000
dt = 1.0
steps = t / dt
steps = int(t / dt)
offset = t / 1000. * 2 * np.pi

'''
Expand Down

0 comments on commit 4b92278

Please sign in to comment.