Skip to content

Commit

Permalink
pygmt.config: Support autocompletion of all parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Nov 26, 2022
1 parent 3e33467 commit 3d8acc7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pygmt/src/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
config - set GMT defaults globally or locally.
"""
from inspect import Parameter, Signature

from pygmt.clib import Session


Expand All @@ -19,6 +21,14 @@ class config: # pylint: disable=invalid-name
Full GMT defaults list at :gmt-docs:`gmt.conf.html`
"""
# Manually set the __signature__ attribute to enable tab autocompletion
_keywords = ["FONT_LABEL", "FONT_TAG", "FONT_TITLE"]
__signature__ = Signature(
parameters=[
Parameter(key, kind=Parameter.KEYWORD_ONLY, default=None)
for key in _keywords
]
)

def __init__(self, **kwargs):
# Save values so that we can revert to their initial values
Expand Down

0 comments on commit 3d8acc7

Please sign in to comment.