nvalchemi.dynamics.StructureSource#
- class nvalchemi.dynamics.StructureSource(*args, **kwargs)[source]#
Structures a propagator starts from, served in order from one position.
The protocol lists the members an in-flight batching driver reads, so any object that provides them can stand in for a dataset-backed sampler.
probe()returns one row for checks that run at construction.shard()narrows the source to the rows one rank owns and resets the position.initial_batch()builds the batch the first step propagates from.draw()serves the fresh structures a backfill adds.exhaustedreports whether any structure is left.state_dict()andload_state_dict()carry the position through a restart.OrderedStructureSampleris the reference implementation, backed by a dataset.Examples
>>> from nvalchemi.dynamics import OrderedStructureSampler, StructureSource >>> isinstance(OrderedStructureSampler(dataset), StructureSource) True
- draw(*, limit=None, fits=None, on_miss='stop')[source]#
Serve the next structures while they pass fits.
- Parameters:
limit (int | None)
fits (FitPolicy | None)
on_miss (Literal['stop', 'skip'])
- Return type:
list[AtomicData]
- property exhausted: bool#
Whether the source has no structure left to hand out.
- initial_batch()[source]#
Return the batch the first step propagates from, advancing the position.
A source that feeds a trajectory lifecycle stamps every structure with a
statusof0and its ownsystem_id, asOrderedStructureSamplerdoes.- Return type:
- load_state_dict(state)[source]#
Resume this source at the position state recorded.
- Parameters:
state (Mapping[str, Any])
- Return type:
None
- probe()[source]#
Return one row, collated as the one-graph batch a propagator receives.
- Return type: