Autocomplete not working with xarray object
Answered
Hi,
I installed pycharm with anaconda3 as the root (and the only) environment. Autocompletion works fine fine except for xarray and netcdf4 objects. Let me give an example. I read in a netcdf file like so:
import xarray as xr
import netcdf4 as nc4
ds1 = xr.open_dataset('HadISST_sst.nc')
ds2 = nc4.Dataset('HadISST_sst.nc')
When I type ds1. or ds2. the objects' methods and attributes are not displayed. This happens only for xarray and netcdf4 objects. Autocomplete works well with objects of other types.
I would appreciate any help, thanks!
Please sign in to leave a comment.
I've created an issue about it: https://youtrack.jetbrains.com/issue/PY-26971 in PyCharm bug tracker, please follow it for updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.
As a workaround you can add an explicit type hint: