Skip to content

Commit

Permalink
Reduce memory footprint (#82)
Browse files Browse the repository at this point in the history
* sum probe signals incrementally

* fixed deprecated code

* double precision
  • Loading branch information
espenhgn authored Apr 23, 2023
1 parent 2435ced commit 01ec571
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hybridLFPy/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 01ec571

Please sign in to comment.