Closed paulbrodersen closed 5 years ago
Interesting. Do you think we should keep the broadcasting version?
Personally, I wouldn't keep the broadcasting version. I left it in there to make the minimum number of changes to the code base possible.
Merging #37 into master will decrease coverage by
0.01%
. The diff coverage is42.85%
.
@@ Coverage Diff @@
## master #37 +/- ##
==========================================
- Coverage 86.07% 86.06% -0.02%
==========================================
Files 133 133
Lines 19430 19435 +5
Branches 1502 1503 +1
==========================================
+ Hits 16725 16726 +1
- Misses 2137 2141 +4
Partials 568 568
Impacted Files | Coverage Δ | |
---|---|---|
visbrain/io/rw_hypno.py | 65.5% <42.85%> (-1.17%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 94664d7...6414038. Read the comment docs.
… (npts) is very large.
When trying to import hypnograms in the stage-duration format, I am running out of memory on a 16 GB RAM machine as the (transiently) created array
index
inhypno_time_to_sample
becomes extremely large. Asindex
is collapsed in one dimension right in the next line, I just substituted the relevant lines with a for loop that computes the collapsed array in one go. This is probably even faster than the version with (the arguably more elegant) broadcasting as the allocation for the broadcasted array will eat a lot of time; however, I haven't timed it (just noticed a faster startup ofSleep.show()
even for small files).