Skip to content
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

Bugfix in list_engine #4811

Merged
merged 19 commits into from
Jan 19, 2021
Merged

Bugfix in list_engine #4811

merged 19 commits into from
Jan 19, 2021

Conversation

aurghs
Copy link
Collaborator

@aurghs aurghs commented Jan 14, 2021

Currently list_engines returns the list of all installed backend plus the list of the internal ones. For the internal ones, there is no check on the installed dependencies.
Now the registration of the internal backends is done by the backends only if the needed dependencies are installed.

  • Passes pre-commit run --all-files

@alexamici
Copy link
Collaborator

Using importlib.util.find_spec is very elegant but much less readable than a try: except ModuleNotFoundError: block, I suggest to convert all checks on imports to them.

@pep8speaks
Copy link

pep8speaks commented Jan 15, 2021

Hello @aurghs! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-01-19 08:51:47 UTC

@aurghs aurghs changed the title WIP: Bugfix in list_engine Bugfix in list_engine Jan 18, 2021
xarray/backends/common.py Outdated Show resolved Hide resolved
xarray/backends/cfgrib_.py Show resolved Hide resolved
@alexamici
Copy link
Collaborator

alexamici commented Jan 19, 2021

With this change xr.list_engines() returns a dictionary with all usable engines.

The implementation is forward compatible, so once backends are split off the main package newer backend registered via the APIv2 plugin interface have precedence.

I'll merge it.

@alexamici alexamici merged commit 7dbbdca into pydata:master Jan 19, 2021
dcherian added a commit to TomNicholas/xarray that referenced this pull request Jan 29, 2021
* upstream/master:
  Bugfix in list_engine (pydata#4811)
  Add drop_isel (pydata#4819)
  Fix RST.
  Remove the references to `_file_obj` outside low level code paths, change to `_close` (pydata#4809)
dcherian added a commit to dcherian/xarray that referenced this pull request Jan 29, 2021
* upstream/master:
  speed up the repr for big MultiIndex objects (pydata#4846)
  dim -> coord in DataArray.integrate (pydata#3993)
  WIP: backend interface, now it uses subclassing  (pydata#4836)
  weighted: small improvements (pydata#4818)
  Update related-projects.rst (pydata#4844)
  iris update doc url (pydata#4845)
  Faster unstacking (pydata#4746)
  Allow swap_dims to take kwargs (pydata#4841)
  Move skip ci instructions to contributing guide (pydata#4829)
  fix issues in drop_sel and drop_isel (pydata#4828)
  Bugfix in list_engine (pydata#4811)
  Add drop_isel (pydata#4819)
  Fix RST.
  Remove the references to `_file_obj` outside low level code paths, change to `_close` (pydata#4809)
dcherian added a commit to dcherian/xarray that referenced this pull request Feb 3, 2021
* master: (458 commits)
  Add units if "unit" is in the attrs. (pydata#4850)
  speed up the repr for big MultiIndex objects (pydata#4846)
  dim -> coord in DataArray.integrate (pydata#3993)
  WIP: backend interface, now it uses subclassing  (pydata#4836)
  weighted: small improvements (pydata#4818)
  Update related-projects.rst (pydata#4844)
  iris update doc url (pydata#4845)
  Faster unstacking (pydata#4746)
  Allow swap_dims to take kwargs (pydata#4841)
  Move skip ci instructions to contributing guide (pydata#4829)
  fix issues in drop_sel and drop_isel (pydata#4828)
  Bugfix in list_engine (pydata#4811)
  Add drop_isel (pydata#4819)
  Fix RST.
  Remove the references to `_file_obj` outside low level code paths, change to `_close` (pydata#4809)
  fix decode for scale/ offset list (pydata#4802)
  Expand user dir paths (~) in open_mfdataset and to_zarr. (pydata#4795)
  add a version info step to the upstream-dev CI (pydata#4815)
  fix the ci trigger action (pydata#4805)
  scatter plot by order of the first appearance of hue (pydata#4723)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants