Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit ad1861d

Browse files
Merge pull request #192 from BlueBrain/outputpath
Put output pickle path into fetachable functions
2 parents 06846ab + 4d53392 commit ad1861d

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

bluepyefe/extract.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,24 @@
4343
logger = logging.getLogger(__name__)
4444

4545

46+
def cells_pickle_output_path(output_directory):
47+
"""Returns the cells.pkl output file path
48+
49+
Args:
50+
output_directory (Path): the output directory
51+
"""
52+
return output_directory / "cells.pkl"
53+
54+
55+
def protocols_pickle_output_path(output_directory):
56+
"""Returns the protocols.pkl output file path
57+
58+
Args:
59+
output_directory (Path): the output directory
60+
"""
61+
return output_directory / "protocols.pkl"
62+
63+
4664
def _create_cell(cell_definition, recording_reader, efel_settings=None):
4765
"""
4866
Initialize a Cell object and populate it with the content of the associated
@@ -1037,8 +1055,8 @@ def extract_efeatures(
10371055
if pickle_cells:
10381056
path_cells = pathlib.Path(output_directory)
10391057
path_cells.mkdir(parents=True, exist_ok=True)
1040-
pickle.dump(cells, open(path_cells / "cells.pkl", 'wb'))
1041-
pickle.dump(protocols, open(path_cells / "protocols.pkl", 'wb'))
1058+
pickle.dump(cells, open(cells_pickle_output_path(path_cells), 'wb'))
1059+
pickle.dump(protocols, open(protocols_pickle_output_path(path_cells), 'wb'))
10421060

10431061
if plot:
10441062
plot_all_recordings_efeatures(

0 commit comments

Comments
 (0)