From a9228d8c979a4714527882b00cacf2ea8dddfb79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Mon, 5 Aug 2024 13:29:45 +0200 Subject: [PATCH 1/2] Put output pickle path into fetachable functions --- bluepyefe/extract.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/bluepyefe/extract.py b/bluepyefe/extract.py index 0193040..aa92345 100644 --- a/bluepyefe/extract.py +++ b/bluepyefe/extract.py @@ -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 @@ -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( From 4d53392aa9dca7891fca0f06996db1c05fc7b179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Mon, 5 Aug 2024 13:32:20 +0200 Subject: [PATCH 2/2] lint fix --- bluepyefe/extract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bluepyefe/extract.py b/bluepyefe/extract.py index aa92345..494ccf2 100644 --- a/bluepyefe/extract.py +++ b/bluepyefe/extract.py @@ -45,7 +45,7 @@ def cells_pickle_output_path(output_directory): """Returns the cells.pkl output file path - + Args: output_directory (Path): the output directory """ @@ -54,7 +54,7 @@ def cells_pickle_output_path(output_directory): def protocols_pickle_output_path(output_directory): """Returns the protocols.pkl output file path - + Args: output_directory (Path): the output directory """