Skip to content

Commit

Permalink
Merge pull request #192 from BlueBrain/outputpath
Browse files Browse the repository at this point in the history
Put output pickle path into fetachable functions
  • Loading branch information
AurelienJaquier authored Aug 5, 2024
2 parents 06846ab + 4d53392 commit ad1861d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions bluepyefe/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@
logger = logging.getLogger(__name__)


def cells_pickle_output_path(output_directory):
"""Returns the cells.pkl output file path
Args:
output_directory (Path): the output directory
"""
return output_directory / "cells.pkl"


def protocols_pickle_output_path(output_directory):
"""Returns the protocols.pkl output file path
Args:
output_directory (Path): the output directory
"""
return output_directory / "protocols.pkl"


def _create_cell(cell_definition, recording_reader, efel_settings=None):
"""
Initialize a Cell object and populate it with the content of the associated
Expand Down Expand Up @@ -1037,8 +1055,8 @@ def extract_efeatures(
if pickle_cells:
path_cells = pathlib.Path(output_directory)
path_cells.mkdir(parents=True, exist_ok=True)
pickle.dump(cells, open(path_cells / "cells.pkl", 'wb'))
pickle.dump(protocols, open(path_cells / "protocols.pkl", 'wb'))
pickle.dump(cells, open(cells_pickle_output_path(path_cells), 'wb'))
pickle.dump(protocols, open(protocols_pickle_output_path(path_cells), 'wb'))

if plot:
plot_all_recordings_efeatures(
Expand Down

0 comments on commit ad1861d

Please sign in to comment.