-
Notifications
You must be signed in to change notification settings - Fork 73
Type checker #527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Type checker #527
Conversation
64a9f0a
to
9ef2f45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me looks good the structure, I am only wondering if we should merge it as it is or making it draft, update all files where we want type checking and then merge
I share this doubt with you. As it is, this decorator is nice but cannot be used immediately, as we do not have any type suggestions in PINA. I see the following options:
Of course, the second is an option only if the decorator is faster than hard coded checks, which I think might not be the case. The first one requires a lot of work, but I would be happy to contribute. Let me know what you think about it, @dario-coscia! |
I
The type checker only checks types, but the Line <line> of file <file> ===> Entered in function <function name>, with input <input name> and input type <input type>
===> Entered in ....
===> Entered in ....
Line <line> of file <file> ===> Entered in function <function name>, with input <input name> and input type <input type>
===> Entered in .... This way, it is by default turned off, but when debugging is enabled, it does the following. We can start thinking about adding it to the solver and see where it is also needed. Let's also listen to @ndem0 and @FilippoOlivo for this |
a84b105
to
a2b6c1f
Compare
Maybe also related to #551 ? @GiovanniCanali what do you think? |
9ef2f45
to
eb4e6b0
Compare
Yes, definitively! |
Fixes #440: add a type checker to be used for debugging.
If the debugging level is set to
DEBUG
, theenforce_type
decorator will enforce the type hints both for the decorated function's arguments and return value.It requires type hints in the decorated function.
Example: