From 328bb23deb421a8ce7b5416055d3c1ea363e343d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dav=C3=ADd=20Brakenhoff?= Date: Wed, 18 Dec 2024 10:37:35 +0100 Subject: [PATCH] add show_versions function --- timml/__init__.py | 2 +- timml/version.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/timml/__init__.py b/timml/__init__.py index 2a3c804..8c30dd9 100644 --- a/timml/__init__.py +++ b/timml/__init__.py @@ -44,7 +44,7 @@ from timml.stripareasink import XsectionAreaSink from timml.trace import timtraceline, timtracelines from timml.uflow import Uflow -from timml.version import __version__ +from timml.version import __version__, show_versions from timml.well import HeadWell, LargeDiameterWell, Well, WellBase # default bessel module is numba diff --git a/timml/version.py b/timml/version.py index 95c1711..0af9db8 100644 --- a/timml/version.py +++ b/timml/version.py @@ -1 +1,18 @@ +from importlib import metadata +from platform import python_version + __version__ = "6.6.0.dev0" + + +def show_versions() -> None: + """Print the version of dependencies.""" + msg = ( + f"TimML version : {__version__}\n\n" + f"Python version : {python_version()}\n" + f"Numpy version : {metadata.version('numpy')}\n" + f"Numba version : {metadata.version('numba')}\n" + f"Scipy version : {metadata.version('scipy')}\n" + f"Pandas version : {metadata.version('pandas')}\n" + f"Matplotlib version : {metadata.version('matplotlib')}" + ) + print(msg)