Docs improvement for Module.from_checkpoint#1180
Docs improvement for Module.from_checkpoint#1180CharlelieLrt wants to merge 3 commits intoNVIDIA:mainfrom
Module.from_checkpoint#1180Conversation
Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
Signed-off-by: Charlelie Laurent <claurent@nvidia.com>
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR enhances the docstring for the Module.from_checkpoint method in physicsnemo/models/module.py to provide clearer guidance on model class inference during checkpoint loading. The documentation now explicitly describes the three-step precedence order: (1) using the qualifier when calling on a subclass (e.g., MyModuleSubclass.from_checkpoint), (2) looking up the class in PhysicsNeMo's model registry, and (3) importing from the module path stored in the checkpoint file. The PR emphasizes best practice by recommending users call from_checkpoint on the specific subclass rather than the base Module class, which is particularly important for both built-in PhysicsNeMo models and custom user-defined subclasses. This documentation improvement integrates with PhysicsNeMo's existing architecture where models can be discovered through the ModelRegistry (as seen in the registry system mentioned in the repository root documentation) or loaded from .mdlus checkpoint files, making the checkpoint loading mechanism more transparent.
PR Description Notes:
- Contains a typo in the docstring: "instantiatie" should be "instantiate" (line 596)
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it only modifies documentation without changing any functional code.
- Score reflects that this is a documentation-only change with clear improvements, though a minor typo should be corrected before final merge. No code logic changes means very low risk of runtime issues.
- No files require special attention beyond a quick typo correction in
physicsnemo/models/module.pyline 596.
1 file reviewed, no comments
|
This pull request is stale because it has been open for 90 days with no activity. Remove the stale label or comment to keep it open, otherwise this will be closed in 14 days. |
PhysicsNeMo Pull Request
Description
This PR improves the docstring for the method
Module.from_checkpointwith added details regarding the mechanism to infer the class, as well as recommended usage.Note: This PR has a companion PR in the documentation repo, and they should be merged together.
Checklist
Dependencies