diff --git a/nutils/__init__.py b/nutils/__init__.py index 14b105f59..b7c01351c 100644 --- a/nutils/__init__.py +++ b/nutils/__init__.py @@ -1,4 +1,4 @@ 'Numerical Utilities for Finite Element Analysis' -__version__ = version = '9a1' +__version__ = version = '9a2' version_name = 'jook-sing' diff --git a/nutils/_util.py b/nutils/_util.py index cdad48e4e..a4aa57a4c 100644 --- a/nutils/_util.py +++ b/nutils/_util.py @@ -427,6 +427,18 @@ def in_context(*args, **kwargs): return in_context_wrapper +def log_version(f): + + from . import version, version_name + + @functools.wraps(f) + def log_version(*args, **kwargs): + treelog.info(f'NUTILS {version} "{version_name.title()}"') + return f(*args, **kwargs) + + return log_version + + def log_arguments(f): '''Decorator to log a function's arguments. diff --git a/nutils/cli.py b/nutils/cli.py index 9710f2f2b..63bf33f42 100644 --- a/nutils/cli.py +++ b/nutils/cli.py @@ -23,6 +23,7 @@ def run(f, *, argv=None): util.in_context(util.log_traceback), util.in_context(util.post_mortem), warnings.via(treelog.warning), + util.log_version, util.log_arguments, util.timeit(), )