Skip to content

Commit

Permalink
Merge pull request #49 from OpenBioSim/fix_version_logging
Browse files Browse the repository at this point in the history
Make sure versions are logged to file
  • Loading branch information
lohedges authored Jun 14, 2024
2 parents 4bfdf5a + 6152b7d commit 2d9e1c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/somd2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,3 @@
# Store the sire version.
from sire import __version__ as _sire_version
from sire import __revisionid__ as _sire_revisionid

# Determine whether we're being run interactively.
try:
_shell = get_ipython().__class__.__name__
if _shell == "ZMQInteractiveShell":
_is_interactive = True # Jupyter notebook or qtconsole
elif _shell == "TerminalInteractiveShell":
_is_interactive = True # Terminal running IPython
else:
_is_interactive = False # Other type (?)
del _shell
except NameError:
_is_interactive = False # Probably standard Python interpreter

if not _is_interactive:
# Log the versions of somd2 and sire.
_logger.info(f"somd2 version: {__version__}")
_logger.info(f"sire version: {_sire_version}+{_sire_revisionid}")

del _is_interactive
6 changes: 6 additions & 0 deletions src/somd2/runner/_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ def __init__(self, system, config):
self._config = config
self._config._extra_args = {}

# Log the versions of somd2 and sire.
from somd2 import __version__, _sire_version, _sire_revisionid

_logger.info(f"somd2 version: {__version__}")
_logger.info(f"sire version: {_sire_version}+{_sire_revisionid}")

# Check whether we need to apply a perturbation to the reference system.
if self._config.pert_file is not None:
_logger.info(
Expand Down

0 comments on commit 2d9e1c8

Please sign in to comment.