From de87c15c582b3481a3677dbaeafe0680356fa46c Mon Sep 17 00:00:00 2001 From: Lee-Ping Wang Date: Tue, 23 Mar 2021 11:35:34 -0700 Subject: [PATCH] Update version number to 1.8.1, importlib replaces imp --- bin/ForceBalance.py | 2 +- devtools/conda-recipe/meta.yaml | 2 +- doc/api_header.tex | 2 +- doc/doxygen.cfg | 2 +- doc/header.tex | 2 +- setup.py | 2 +- src/molecule.py | 15 ++++++++++----- src/tests/test_engine.py | 3 +++ 8 files changed, 19 insertions(+), 11 deletions(-) diff --git a/bin/ForceBalance.py b/bin/ForceBalance.py index cff5b1f93..3ce75498c 100755 --- a/bin/ForceBalance.py +++ b/bin/ForceBalance.py @@ -60,7 +60,7 @@ def process(word, color): return Answer def main(): - printcool("Welcome to ForceBalance version 1.8.0! =D\nForce Field Optimization System\n\nAuthors:\nLee-Ping Wang\nYudong Qiu, Keri A. McKiernan\nJeffrey R. Wagner, Hyesu Jang, Simon Boothroyd\nArthur Vigil, Erik G. Brandt, John Stoppelman\nJohnny Israeli, Matt Thompson", ansi="1", bold=True, minwidth=64) + printcool("Welcome to ForceBalance version 1.8.1! =D\nForce Field Optimization System\n\nAuthors:\nLee-Ping Wang\nYudong Qiu, Keri A. McKiernan\nJeffrey R. Wagner, Hyesu Jang, Simon Boothroyd\nArthur Vigil, Erik G. Brandt, John Stoppelman\nJohnny Israeli, Matt Thompson", ansi="1", bold=True, minwidth=64) logostr = """ ,'+++ ,++++++. .:,,. diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index 69328f4ab..2d9be34a9 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -1,6 +1,6 @@ package: name: forcebalance-dev - version: !!str 1.8.0 + version: !!str 1.8.1 source: path: ../.. diff --git a/doc/api_header.tex b/doc/api_header.tex index c558a426a..f3c98496f 100644 --- a/doc/api_header.tex +++ b/doc/api_header.tex @@ -57,7 +57,7 @@ \vspace*{1cm} \begin{center} -{\Large ForceBalance Developer API Guide version 1.8.0}\\ +{\Large ForceBalance Developer API Guide version 1.8.1}\\ \vspace*{2cm} {\large Generated by Doxygen 1.8.11}\\ \vspace*{2.5 cm} diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg index 41e501944..605e95f8d 100644 --- a/doc/doxygen.cfg +++ b/doc/doxygen.cfg @@ -32,7 +32,7 @@ PROJECT_NAME = ForceBalance # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.8.0 +PROJECT_NUMBER = 1.8.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/doc/header.tex b/doc/header.tex index 109d07ecb..0813018e2 100644 --- a/doc/header.tex +++ b/doc/header.tex @@ -57,7 +57,7 @@ \vspace*{1cm} \begin{center} -{\Large ForceBalance version 1.8.0}\\ +{\Large ForceBalance version 1.8.1}\\ \vspace*{2cm} {\large Generated by Doxygen 1.8.11}\\ \vspace*{2.5 cm} diff --git a/setup.py b/setup.py index d563f3a27..a6c1056e9 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ #| doc/api_header.tex |# #| bin/ForceBalance.py |# #===================================# -__version__ = "v1.8.0" +__version__ = "v1.8.1" try: # use git to find current version git_describe = subprocess.check_output(["git", "describe"]).strip() diff --git a/src/molecule.py b/src/molecule.py index 87169b393..544249ea1 100644 --- a/src/molecule.py +++ b/src/molecule.py @@ -3,7 +3,6 @@ from __future__ import print_function import copy -import imp import itertools import os import re @@ -20,13 +19,19 @@ from numpy.linalg import multi_dot from pkg_resources import parse_version -# For Python 3 compatibility +# For Python 2/3 compatibility try: from itertools import zip_longest as zip_longest except ImportError: from itertools import izip_longest as zip_longest -# For Python 2 backwards-compatibility +try: + import importlib + package_install_dir = os.path.split(importlib.util.find_spec(__name__.split('.')[0]).origin)[0] +except ImportError: # importlib is new in version 3.1 + import imp + package_install_dir = imp.find_module(__name__.split('.')[0])[1] + try: input = raw_input except NameError: @@ -305,8 +310,8 @@ def elem_from_atomname(atomname): # or from the same directory as this module. have_dcdlib = False for fnm in ["_dcdlib.so", - os.path.join(imp.find_module(__name__.split('.')[0])[1],"_dcdlib.so"), - os.path.join(imp.find_module(__name__.split('.')[0])[1],"_dcdlib"+str(sysconfig.get_config_var('EXT_SUFFIX'))), + os.path.join(package_install_dir,"_dcdlib.so"), + os.path.join(package_install_dir,"_dcdlib"+str(sysconfig.get_config_var('EXT_SUFFIX'))), os.path.join(os.path.dirname(__file__),"_dcdlib.so"), os.path.join(os.path.dirname(__file__),"_dcdlib"+str(sysconfig.get_config_var('EXT_SUFFIX')))]: if os.path.exists(fnm): diff --git a/src/tests/test_engine.py b/src/tests/test_engine.py index c6fa68079..7c2943e4f 100644 --- a/src/tests/test_engine.py +++ b/src/tests/test_engine.py @@ -69,6 +69,9 @@ def setup_class(cls): # gmx should be built with config -DGMX_DOUBLE=ON gmxpath = which('mdrun_d') or which('gmx_d') gmxsuffix = '_d' + # Tests will FAIL if use single precision gromacs + # gmxpath = which('mdrun') or which('gmx') + # gmxsuffix = '' # self.logger.debug("\nBuilding options for target...\n") cls.cwd = os.path.dirname(os.path.realpath(__file__)) os.chdir(os.path.join(cls.cwd, "files", "amber_alaglu"))