You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function calculate area in tobac.analysis is quite slow for large segmentation masks due to looping over each feature individually. This would be a good candidate for improving performance by vectorizing this loop using scipy.labelled_comprehension or scipy.binned_statistic
The text was updated successfully, but these errors were encountered:
It turns out that the majority of the time it calculate_area is spend adding a column to the dataframe with the results. I guess this is good motivation to move to using xarray instead...
Interesting. That's similar to what we saw in the tracking module. You may be able to get good performance by constructing the column first as a dict/list/'numpy array and then adding the column in as one vectorized operation. That has generally worked well for us.
Turns out I was wrong, and in fact I'd just not properly reloaded my changes due to relative imports and it just appeared that way, when in reality it was still running the old, slow code. Turns out it doesn't actually take 6 seconds to add a new array from a numpy array of values...
The function calculate area in tobac.analysis is quite slow for large segmentation masks due to looping over each feature individually. This would be a good candidate for improving performance by vectorizing this loop using scipy.labelled_comprehension or scipy.binned_statistic
The text was updated successfully, but these errors were encountered: