Issue
It is a bit strange that in PyCharm IDE, sklearn.datasets.make_classification()
function does not show me possible inner arguments, only *args and **kwargs are showing.
i have installed latest version of Pycharm,i dont know if it is reason, maybe there is some parameter- which need to be changed? please advice me what to do?
it is how pycharm is showing(it is 2021 version)
Solution
Things to investigate:
- Try instead using the fully qualified name
sklearn.datasets.make_classification()
, does this still happen? I suspect PyCharm IDE does not instantly resolve the imports so it doesn't know wheremake_classification()
comes from, hence its arg signature. - Look for a ⚠️yellow warning exclamation sign in the top right, click on it, I get a warning "Cannot find reference 'make_classification' in 'init.py'". Somehow PyCharm is not resolving the import correctly.
- Dig into this: click on that warning, PyCharm will open the warning in the 'Problems' window, then right-click on that, and look at PyCharm's suggested list of 'Show Quick Fixes' (not that any of its three suggestions would solve this, but it gives insight into why PyCharm is failing to resolve the import. See if you can fix the import so the warning goes away)
- does this happen on other functions with positional and keyword args?
- did you close and reopen PyCharm and recheck?
- When I browse to the sklearn source, I see that function is covered by a
@_deprecate_positional_args
decorator. That might be affecting PyCharm behavior. But you'd still expect PyCharm to show keyword args.- does PyCharm only not show args on functions with a
@_deprecate_positional_args
decorator? - try commenting out
@_deprecate_positional_args
decorator in your source, saving and reloading, does it still do this?
- does PyCharm only not show args on functions with a
- can you post a screenshot of what it does highlight?
My current version is PyCharm Community Edition 2020.3.5
Answered By - smci
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.