Skip to content

Commit

Permalink
Merge pull request #160 from BlueBrain/eval-map-fix
Browse files Browse the repository at this point in the history
Force evaluation for built-in map()
  • Loading branch information
ilkilic authored Oct 9, 2023
2 parents b4aaba0 + 4a94a0a commit dfa0d83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bluepyefe/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ def _plot(cell, output_dir, show=False):

def plot_all_recordings(cells, output_dir, show=False, mapper=map):
"""Plot recordings for all cells and all protocols"""
mapper(partial(_plot, output_dir=output_dir, show=show), cells)
if mapper == map:
# For the built-in map(), ensure immediate evaluation as it returns a lazy iterator
# which won't execute the function until iterated over. Converting to a list forces this iteration.
list(mapper(partial(_plot, output_dir=output_dir, show=show), cells))
else:
mapper(partial(_plot, output_dir=output_dir, show=show), cells)


def plot_efeature(
Expand Down

0 comments on commit dfa0d83

Please sign in to comment.