-
Notifications
You must be signed in to change notification settings - Fork 7
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
Backward compatible support for ADIOS2 2.10.x #60
Backward compatible support for ADIOS2 2.10.x #60
Conversation
src/adios4dolfinx/adios2_helpers.py
Outdated
if (packaging.version.parse(adios2.__version__) | ||
>= packaging.version.Version("2.10.0")): | ||
adios2 = adios2.bindings | ||
|
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.
Could we use:
https://docs.python.org/3/library/importlib.metadata.html
for the versioning?
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.
Or something like
try:
import adios2.bindings as adios2
except ImportError:
import adios2
?
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.
Yep, this might be better in case they revert the bindings at some point
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.
The disadvantage with the try catch is the yielded exception may be confusing regarding the true nature of the problem. I.e. does adios2
exist, or is it simply a scope resolution issue between versions of the package.
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.
what about:
def import_adios():
try:
import adios2
return adios2.bindings
except AttributeError:
import adios2
return adios2
* Add openmpi and failing adios2 version to CI. * Remove formatting-check from openmpi * Add petsc_arch * Fix outsize dtype * Add debug print * Remove error from print * Set environment variable * Revert debug print * Set ompi flags to openmpi pipeline * Deactivate v2.10.0-rc1 waiting for #60
…nate-sime/adios4dolfinx into nate/adios2.10-interface-change
Addresses #59.