Inspecting arguments with custom accessors

Hey there!

I recently read about the suggested approach to extending xarray here: Extending xarray

We have a lot of functions on xarray datasets that are domain-specific enough to spatial mosaics that I think I want to start using these.

One issue I am seeing so far is that when I use the accessor in jupyter notebook, the arguments and docs are inspected and returned, which makes it nice and usable. However, within vscode, it is unable to inspect the args. The side effect is slower development and no more type checking, which isn’t ideal.

Am I missing something here? Has anyone noticed this and is there an existing fix?

For example

## inside notebooks
ds.sp.my_function() # I can inspect as usual

## inside vscode
ds.sp.my_function() # I can not inspect the args or their types

I have seen sphinx-autosummary-accessors — sphinx-autosummary-accessors documentation, but that only seems relevant for doc generation.

It seems like the same thing holds for pandas accessors. I am also not able to see any of the rio accessor args in vscode…

Hi @Leonard_Strnad - I’m not immediately aware of a fix, but I do think that you are more likely to find an answer on the xarray issue tracker than here. (As this is a problem specific to xarray’s code that otherwise is unrelated to pangeo. :slight_smile: )

1 Like

see: Inspecting arguments with accessors · Issue #7234 · pydata/xarray · GitHub