Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility issues with Python 2 #1004

Merged
merged 4 commits into from Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
108 changes: 54 additions & 54 deletions doc/model_details/HillTononiModels.ipynb

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pynest/examples/brunel_alpha_evolution_strategies.py
Expand Up @@ -64,6 +64,7 @@

'''

from __future__ import print_function
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this future import?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the end=' ' here:

print('Statistics after optimization:', end=' ')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

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
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
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