rusandris / StateTransitionNetworks.jl

Toolkit for dynamics on state transition networks
2 stars 0 forks source link

Optimize non-mutating `timeseries_to_grid` for all dimensions #6

Closed rusandris closed 9 months ago

rusandris commented 9 months ago

In the non-mutating timeseries_to_grid methods use extrema instead of trying to find mins and maxes separately


if isempty(grid_edges)      
 x_min = minimum(timeseries[:, 1])
 y_min = minimum(timeseries[:, 2])
 x_max = maximum(timeseries[:, 1])
 y_max = maximum(timeseries[:, 2])
else
 x_min,y_min,x_max,y_max = grid_edges 
end

Also, views should be used instead of making a copies with slices along the axes.