Source code for fenicsx_compat._dolfinx_version
import dolfinx
from packaging.version import Version
DOLFINX_VERSION = Version(dolfinx.__version__)
[docs]
def at_least(v: str) -> bool:
"""Whether the installed dolfinx is at least version `v`."""
return DOLFINX_VERSION >= Version(v)
[docs]
def before(v: str) -> bool:
"""Whether the installed dolfinx is strictly before version `v`."""
return DOLFINX_VERSION < Version(v)