nvalchemi.csp.packer.CrystalPacker#
- class nvalchemi.csp.packer.CrystalPacker(*args, **kwargs)[source]#
Structural interface for a local crystal packer.
An implementation owns its device and completes one local packing call. A caller can use PackingContext to assign shared run identity and rank-strided structure IDs; this protocol does not perform communication. Implementations accept a zero output target and return a typed empty result.
- pack(inputs, *, num_samples=1, rng=None, context=None, **options)[source]#
Generate packed structures for one formula-unit input.
- Parameters:
inputs (MolecularPackingInput) – One validated formula-unit input.
num_samples (int, default=1) – Nonnegative number of accepted structures to request.
rng (torch.Generator, optional) – Random source for candidate generation.
context (PackingContext, optional) – Caller-assigned run identity and rank information.
**options – Implementation-specific packing options.
- Returns:
Local typed structures and one rank-local packing report.
- Return type: