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
When using slice_dims, each slice runs an independent tsam.aggregate() call. These are embarrassingly parallel — no shared state between slices. tsam already implements file-based parallelization in find_pareto_front() (via n_jobs parameter, no pickling needed), so we can follow the same pattern.
Proposed API
result=tsam_xarray.aggregate(
da,
n_clusters=8,
time_dim="time",
stack_dims=["variable", "region"],
slice_dims=["scenario"],
n_jobs=-1, # all CPUs, or int for specific count
)
Implementation
Add n_jobs: int | None = None parameter to aggregate()
None or 1 = sequential (current behavior)
n_jobs > 1 or -1 = parallel via concurrent.futures or joblib
Each slice is independent — no shared state, trivial to parallelize
Motivation
When using
slice_dims, each slice runs an independenttsam.aggregate()call. These are embarrassingly parallel — no shared state between slices. tsam already implements file-based parallelization infind_pareto_front()(vian_jobsparameter, no pickling needed), so we can follow the same pattern.Proposed API
Implementation
n_jobs: int | None = Noneparameter toaggregate()Noneor1= sequential (current behavior)n_jobs > 1or-1= parallel viaconcurrent.futuresorjoblibfind_optimal_combination()andfind_pareto_front()wrappers (feat: wrap tuning functions (find_optimal_combination, find_pareto_front) #10)