physicsnemo icon indicating copy to clipboard operation
physicsnemo copied to clipboard

🚀[FEA]: Add better logging for `Module.instantiate` calls

Open akshaysubr opened this issue 2 years ago • 0 comments

Is this a new feature, an improvement, or a change to existing functionality?

New Feature

How would you describe the priority of this feature request

Critical (currently preventing usage)

Please provide a clear description of problem you would like to solve.

Currently, there aren't enough guardrails or descriptive error messages when calling modulus.Module.instantiate. The type annotations say that you can pass in an arbitrary Dict[str, Any] which isn't very informative. The docstrings are useful and say: This should have three keys: '__name__', '__module__', and '__args__'. but you could also skip the __module__ key if the __name__ key is in the model registry. If you want to instantiate from the model registry and therefore skip the __module__ key, but the __name__ is not in the registry, no useful exception is raised. Ideally, this should trigger a custom modulus exception with a useful error message.

Describe any alternatives you have considered

No response

akshaysubr avatar Oct 03 '23 23:10 akshaysubr