Skip to content

Import ADIOS2 only when actually used to remove warning#342

Merged
dschwoerer merged 3 commits intomasterfrom
fix-adios-warning
Apr 16, 2026
Merged

Import ADIOS2 only when actually used to remove warning#342
dschwoerer merged 3 commits intomasterfrom
fix-adios-warning

Conversation

@mikekryjak
Copy link
Copy Markdown
Collaborator

Every single time I use xBOUT I get this warning:

/home/mike/spack/var/spack/environments/hermes3/.spack-env/view/lib/python3.12/site-packages/xarray/backends/plugins.py:109: RuntimeWarning: Engine 'bout_adios2' loading failed:
No module named 'adios2'
  external_backend_entrypoints = backends_dict_from_pkg(entrypoints_unique)

This PR fixes this by making sure that from adios2 import FileReader is done only when xarray actually needs it, i.e. in the ADIOS2 backend.

Unfortunately as I have never used ADIOS2 and it is completely untested as far as I can tell, I cannot verify that this doesn't break loading with it... although it is a simple change.

Perhaps @pnorbert or someone else with ADIOS2 experience could review.

mikekryjak and others added 2 commits April 15, 2026 13:41
This removes warning on loading files
@mikekryjak
Copy link
Copy Markdown
Collaborator Author

David made a better one: #343 (review)

@mikekryjak mikekryjak closed this Apr 16, 2026
@dschwoerer dschwoerer reopened this Apr 16, 2026
@dschwoerer
Copy link
Copy Markdown
Contributor

@pnorbert if you think this is wrong, please open a bug, or a PR with a different solution.

@dschwoerer dschwoerer merged commit 8cfdf2d into master Apr 16, 2026
20 checks passed
@dschwoerer dschwoerer deleted the fix-adios-warning branch April 16, 2026 12:17
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.

2 participants