-
Notifications
You must be signed in to change notification settings - Fork 10
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
adding type hinting #44
Conversation
Hi @Gerson2102 if you could paste the errors maybe we can offer a helping hand |
For sure:
All the errors that starts with "Cannot find" I ignored them. |
Taking out the "library is missing stubs" ones these are left:
I think that besides this one:
Others can be tackle as well, some of them require code changes and not just typing, for example # this would give a similar error
# word type hint is: Optional[str]
word.upper()
# Adding a check that word is none should fix the error
if word is not None:
word.upper()
else:
# Here we could handle if word = None, maybe raising an exception if necessary
... Also, @Gerson2102 make sure to update your fork as it seems to be missing the latest changes, making the CI fail.
|
I dont know why the CI keep failing. I did a git rebase and everything should be good. |
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.
The old agents.py
functions should be handled as this is old behaviour and it needs to be improved. With the updates it might have been done along the way. This needs to be fixed for the PR to be merged.
Pre-commit check is failing in the CI check
Make sure to install and run pre-commit prior to comitting the changes.
Right now, I'm just getting this error: |
Dont worry about this you have done a great job, we need the CI to pass and some simple things |
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.
This is almost done!
We need to make some changes regarding some code changes and running pre-commit, once this is done it will be go to go 🚀
giza_actions/model.py
Outdated
@@ -275,7 +278,7 @@ def predict( | |||
output_dtype = self._get_output_dtype() | |||
else: | |||
output_dtype = custom_output_dtype | |||
|
|||
output_dtype = output_dtype or "DefaultType" |
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.
I would say that shi change is not needed, as this is handled in the if else.
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.
I get it. But if i change it, we will have another error.
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.
Let this error be I'll handle it. Remove this line and the PR will be merged as CI is passing 🥳
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.
Let this error be I'll handle it. Remove this line and the PR will be merged as CI is passing 🥳
Finally haha!
CI tests fails due to circular imports, this is due to importing classes just for type checking. Check this https://mypy.readthedocs.io/en/stable/runtime_troubles.html#import-cycles |
@Gonmeso Lets see if we are done here. |
Incredible work @Gerson2102 ! LGTM! |
Adding a lot more types to functions and parameters. There are still some errors, but I dont understand them, maybe somebody can help me.
This is the related issue: #36