Skip to content

Commit ab614e2

Browse files
binarymasonkernc
authored andcommitted
REF: Update optimize batch size to minimize idle cores (#295)
* update batch sizes to minimize idle cores Refs: #293
1 parent 73e1534 commit ab614e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backtesting/backtesting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ def _optimize_grid() -> Union[pd.Series, Tuple[pd.Series, pd.Series]]:
13331333
names=next(iter(param_combos)).keys()))
13341334

13351335
def _batch(seq):
1336-
n = np.clip(len(seq) // (os.cpu_count() or 1), 5, 300)
1336+
n = np.clip(int(len(seq) // (os.cpu_count() or 1)), 1, 300)
13371337
for i in range(0, len(seq), n):
13381338
yield seq[i:i + n]
13391339

0 commit comments

Comments
 (0)