Skip to content

Commit

Permalink
Reduced memory usage of EventList.from_lc()
Browse files Browse the repository at this point in the history
  • Loading branch information
pupperemeritus committed Sep 18, 2023
1 parent 34665e2 commit 6e5bcd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stingray/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ def from_lc(lc):
"""

# Multiply times by number of counts
times = [[i] * int(j) for i, j in zip(lc.time, lc.counts)]
times = ([i] * int(j) for i, j in zip(lc.time, lc.counts))
# Concatenate all lists
times = [i for j in times for i in j]
times = list(i for j in times for i in j)

return EventList(time=times, gti=lc.gti)

Expand Down

0 comments on commit 6e5bcd6

Please sign in to comment.