-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add xarray.show_backends
alias
#9821
base: main
Are you sure you want to change the base?
Conversation
9f8248d
to
bed7e1d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly would improve discoverability if top level API.
Not sure on the name, maybe backend
is better than engine
, but whether list
or show
....
Does anyone have a stronger preference on this?
@@ -132,6 +132,19 @@ def list_engines() -> dict[str, BackendEntrypoint]: | |||
return build_engines(entrypoints) | |||
|
|||
|
|||
def show_backends() -> dict[str, BackendEntrypoint]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def show_backends() -> dict[str, BackendEntrypoint]: | |
show_backends = list_engines |
Would be easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, it would be easier, but the different name wouldn't be reflected in the docstrings or in the help information.
from xarray.backends import list_engines
show_backends = list_engines
print(help(show_backends))
gives
Help on _lru_cache_wrapper in module xarray.backends.plugins:
list_engines() -> 'dict[str, BackendEntrypoint]'
Return a dictionary of available engines and their BackendEntrypoint objects.
Returns
-------
dictionary
Notes
-----
This function lives in the backends namespace (``engs=xr.backends.list_engines()``).
If available, more information is available about each backend via ``engs["eng_name"]``.
Not sure if theres a standard approach to this sort of aliasing...
whats-new.rst
api.rst
Implemented according to #6577 (comment)