From 01ec571d67fc4312789d080e22f171e9d57d6e27 Mon Sep 17 00:00:00 2001 From: Espen Hagen <2492641+espenhgn@users.noreply.github.com> Date: Sun, 23 Apr 2023 20:45:48 +0200 Subject: [PATCH] Reduce memory footprint (#82) * sum probe signals incrementally * fixed deprecated code * double precision --- hybridLFPy/population.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hybridLFPy/population.py b/hybridLFPy/population.py index 07c77d6..48763d8 100644 --- a/hybridLFPy/population.py +++ b/hybridLFPy/population.py @@ -596,11 +596,11 @@ def calc_signal_sum(self, measure='LFP'): if self.RANK_CELLINDICES.size > 0: data = self.output[measure] else: - data = np.zeros(shape, dtype=np.float32) + data = np.zeros(shape, dtype=np.float64) # container for full LFP on RANK 0 if RANK == 0: - DATA = np.zeros_like(data, dtype=np.float32) + DATA = np.zeros_like(data, dtype=np.float64) else: DATA = None @@ -1290,8 +1290,7 @@ def cellsim(self, cellindex, return_just_cell=False): # downsample probe.data attribute and unset cell for probe in self.probes: probe.data = ss.decimate(probe.data, - q=self.decimatefrac - ).astype(np.float32) + q=self.decimatefrac) probe.cell = None # put all necessary cell output in output dict