nvalchemi.dynamics.WithinBudget#

class nvalchemi.dynamics.WithinBudget(atoms=None, edges=None)[source]#

Fit policy that admits a batch while its totals stay within the given bounds.

Parameters:
  • atoms (int | None, optional) – Total atoms the drawn batch may hold. Default None (unbounded).

  • edges (int | None, optional) – Total stored edges the drawn batch may hold. A dataset reports the edge count it stored, not the size of the neighbor list a propagator rebuilds every step, so set this bound only when the stored count is the one that matters. Default None (unbounded).

Examples

>>> from nvalchemi.dynamics import WithinBudget
>>> WithinBudget(atoms=10)(num_atoms=8, num_edges=0)
True
>>> WithinBudget(atoms=10)(num_atoms=12, num_edges=0)
False