xarray icon indicating copy to clipboard operation
xarray copied to clipboard

xarray.concat docstring confuses PyCharm type detection

Open gimperiale opened this issue 7 years ago • 5 comments

PyCharm inspects docstrings to figure out the return type of functions. In the case of xarray.concat(), it believes it is 'type'; this causes it to prominently highlight the user code as an error:

pycharm

gimperiale avatar Apr 05 '19 10:04 gimperiale

Do we know why it thinks it's type?

max-sixty avatar Apr 05 '19 12:04 max-sixty

@max-sixty because of this https://github.com/pydata/xarray/blob/c33dab237a0aca316b7f6d4ba10857829a895a25/xarray/core/combine.py#L73

gimperiale avatar Apr 05 '19 14:04 gimperiale

Interesting, we could definitely fix this.

Actually, I suspect the ideal situation would be to use type annotations -- then PyCharm should not need to inspect the docstrings at all.

shoyer avatar Apr 05 '19 18:04 shoyer

@shoyer indeed. I'll start working on type annotations straight away.

crusaderky avatar Apr 07 '19 10:04 crusaderky

#2877 doesn't fix it... More pulls will be needed

crusaderky avatar Apr 10 '19 21:04 crusaderky