You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of decorators in aiida-core cause the functions that are wrapped to lose their function signature. This will cause inspect to fail miserably. The same problem occurs with it losing its __name__ and __doc__, which is sometimes fixed by using functools.wraps, however, that does not properly restore the function signature. Example:
Now this is currently not causing any problems, that we know of, but it might in the future. In addition, I use the inspect functionality in launch scripts that I have to wrap with with_dbenv and those now stopped working. There are various solutions, of which the wrapt library is the best as in most correct, but also slowest. Let's discuss if we would be willing to put this in our dependencies and fix our decorators.
The text was updated successfully, but these errors were encountered:
The current implementation of decorators in
aiida-core
cause the functions that are wrapped to lose their function signature. This will causeinspect
to fail miserably. The same problem occurs with it losing its__name__
and__doc__
, which is sometimes fixed by usingfunctools.wraps
, however, that does not properly restore the function signature. Example:Now when we wrap it, for example with
with_dbenv
decorator, we get:Now this is currently not causing any problems, that we know of, but it might in the future. In addition, I use the
inspect
functionality in launch scripts that I have to wrap withwith_dbenv
and those now stopped working. There are various solutions, of which the wrapt library is the best as in most correct, but also slowest. Let's discuss if we would be willing to put this in our dependencies and fix our decorators.The text was updated successfully, but these errors were encountered: