Conversation
3d877ff to
966537f
Compare
| projection: Any = None, | ||
| area_thresh: Any = None, | ||
| frame: Any = None, | ||
| resolution: Literal["f", "h", "i", "l", "c", "a", None] = None, |
There was a problem hiding this comment.
Do you think if we could get this to show up in the Sphinx docs too at https://pygmt-dev--2793.org.readthedocs.build/en/2793/api/generated/pygmt.Figure.coast.html? Currently we're following GMT and it might be a bit confusing for new users on what | means
One way is to use something like https://github.com/tox-dev/sphinx-autodoc-typehints. See example at https://pyproject-api.readthedocs.io/en/latest/#pyproject_api.Frontend.metadata_from_built on how it could look like:
But of course, this is the simple case. There are other cases where we can combine letters, and we'll need to think about that.
There was a problem hiding this comment.
I think it's worth a try.
|
Can anyone else check if changes in this PR work in Jupyter Notebooks? I can't make it work even after following this post (https://saturncloud.io/blog/autocomplete-jupyter-notebook/). |
Doesn't seem to work for me on JupyterLab 4.0.7: Using |




Description of proposed changes
Related to #2794.
Type Hints are powerful and can be used to provide better auto-completion (address #1203).
Here are some showcases in VSCode.
Autocompletion for
**kwargsparametersautocompletion-parameters.webm
Autocompletion for parameter's allowed values
autocompletion-valid-values.mov
Autocompletion for dict keys
Implement the syntax 1 in #1078 (comment) and address the concern in #1078 (comment)
autocompletion-dict-keys.webm