"""Wrapper for NequIP-Allegro models in TorchSim.This module re-exports the NequIP framework's torch-sim integration for convenientimporting. The actual implementation is maintained in the NequIP package.References: - NequIP Package: https://github.com/mir-group/nequip"""importtracebackimportwarningsfromtypingimportAnytry:fromnequip.integrations.torchsimimportNequIPTorchSimCalc# Re-export with backward-compatible nameclassNequIPFrameworkModel(NequIPTorchSimCalc):"""NequIP model framework wrapper for torch-sim. NOTE: NequIPFrameworkModel.dtype is always set to torch.float64. The AOTInductor may actually contain a different dtype but the model will cast to the correct dtype internally. """exceptImportErrorasexc:warnings.warn(f"NequIP import failed: {traceback.format_exc()}",stacklevel=2)fromtorch_sim.models.interfaceimportModelInterface
[docs]classNequIPFrameworkModel(ModelInterface):# type: ignore[no-redef]"""NequIP model framework wrapper for torch-sim. NOTE:This class is a placeholder when NequIP is not installed. It raises an ImportError if accessed. """def__init__(self,err:ImportError=exc,*_args:Any,**_kwargs:Any)->None:"""Dummy init for type checking."""raiseerr