MCPcopy Create free account
hub / github.com/kernc/backtesting.py / _grid_size

Method _grid_size

backtesting/backtesting.py:1490–1496  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1488 return self[item]
1489
1490 def _grid_size():
1491 size = int(np.prod([len(_tuple(v)) for v in kwargs.values()]))
1492 if size < 10_000 and have_constraint:
1493 size = sum(1 for p in product(*(zip(repeat(k), _tuple(v))
1494 for k, v in kwargs.items()))
1495 if constraint(AttrDict(p)))
1496 return size
1497
1498 def _optimize_grid() -> Union[pd.Series, Tuple[pd.Series, pd.Series]]:
1499 rand = default_rng(random_state).random

Callers

nothing calls this directly

Calls 1

AttrDictClass · 0.85

Tested by

no test coverage detected