Geocene / trainset

A lightweight web application for brushing labels onto time series data; useful for building training sets.
https://trainset.geocene.com/
MIT License
162 stars 36 forks source link

fix: replace filter by a for loop in getMinMax to prevent the call stack to fill up. #113

Closed levaphenyl closed 2 years ago

levaphenyl commented 3 years ago

When uploading a time series that is too large, the upload fails with error RangeError: Maximum call stack size exceeded. This is due to the use of filter(...).map(...) in the getMinMax function, as it fills the call stack with small function calls. Possibly related to https://github.com/Geocene/trainset/issues/109

zekeshearer commented 2 years ago

@levaphenyl, could you provide an example dataset that is large enough to fail without this fix? Thanks, Zeke

daterdots commented 2 years ago

Here's a test file with 1M rows filesdummy-input-length-1e+06.csv.zip

levaphenyl commented 2 years ago

Closing in favor of https://github.com/Geocene/trainset/issues/117, whose solution is more elegant.