Skip to content

Commit

Permalink
Starred expressions must be last value for Py < 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
stinebuu committed Oct 11, 2019
1 parent ba6397a commit 7d8ef1d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pynest/nest/lib/hl_api_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -1345,8 +1345,8 @@ def PlotProbabilityParameter(source, parameter=None, mask=None, edges=[-0.5, 0.5

if parameter is not None:
z = np.zeros(shape[::-1])
for i, x in enumerate(np.linspace(*edges[:2], shape[0])):
positions = [[x, y] for y in np.linspace(*edges[2:], shape[1])]
for i, x in enumerate(np.linspace(edges[0], edges[1], shape[0])):
positions = [[x, y] for y in np.linspace(edges[2], edges[3], shape[1])]
values = parameter.apply(source, positions)
z[:, i] = np.array(values)
img = ax.imshow(np.minimum(np.maximum(z, 0.0), 1.0), extent=edges,
Expand Down
2 changes: 1 addition & 1 deletion pynest/nest/tests/test_topology/test_dumping.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_DumpNodes(self):
nest.DumpLayerNodes(l, filename)

npa = np.genfromtxt(filename)
reference = np.array([[n.get('global_id'), *nest.GetPosition(n)] for n in l])
reference = np.array([[n.get('global_id')] + list(nest.GetPosition(n)) for n in l])
self.assertTrue(np.allclose(npa, reference))
os.remove(filename)

Expand Down
4 changes: 2 additions & 2 deletions pynest/nest/tests/test_topology/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def probability_calculation(distance):

# Calculate reference values
ref_probability = np.zeros(plot_shape[::-1])
for i, x in enumerate(np.linspace(*plot_edges[:2], plot_shape[0])):
positions = np.array([[x, y] for y in np.linspace(*plot_edges[2:], plot_shape[1])])
for i, x in enumerate(np.linspace(plot_edges[0], plot_edges[1], plot_shape[0])):
positions = np.array([[x, y] for y in np.linspace(plot_edges[2], plot_edges[3], plot_shape[1])])
ref_distances = np.sqrt((positions[:, 0] - source_x)**2 + (positions[:, 1] - source_y)**2)
values = probability_calculation(ref_distances)
ref_probability[:, i] = np.maximum(np.minimum(np.array(values), 1.0), 0.0)
Expand Down

0 comments on commit 7d8ef1d

Please sign in to comment.