mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 01:18:52 -06:00
Only use p_tqdm is n_jobs>1
This commit is contained in:
@@ -198,6 +198,9 @@ class Component:
|
||||
instance.free()
|
||||
return pre_instance
|
||||
|
||||
if n_jobs == 1:
|
||||
pre = [_pre_sample_xy(instance) for instance in instances]
|
||||
else:
|
||||
pre = p_umap(_pre_sample_xy, instances, num_cpus=n_jobs)
|
||||
pre_combined: Dict = {}
|
||||
for (cname, comp) in components.items():
|
||||
@@ -229,6 +232,9 @@ class Component:
|
||||
instance.free()
|
||||
return x_instance, y_instance
|
||||
|
||||
if n_jobs == 1:
|
||||
xy = [_sample_xy(instance) for instance in instances]
|
||||
else:
|
||||
xy = p_umap(_sample_xy, instances)
|
||||
|
||||
for (cname, comp) in components.items():
|
||||
|
||||
Reference in New Issue
Block a user