diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 69b00ce6..72cf6e8b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,7 +27,7 @@ jobs: # macos runners (latest GROMACS, oldes and latest Python) os: [ubuntu-latest] - python-version: [2.7, 3.9] + python-version: [3.9] gromacs-version: ["4.6.5", "2018.6", "2020.6", "2021.1"] include: - os: ubuntu-latest @@ -39,9 +39,6 @@ jobs: - os: ubuntu-latest python-version: 3.8 gromacs-version: 2021.1 - - os: macos-latest - python-version: 2.7 - gromacs-version: 2021.1 - os: macos-latest python-version: 3.9 gromacs-version: 2021.1 diff --git a/CHANGES b/CHANGES index 6e24f024..142c1136 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,14 @@ CHANGES for MDPOW Add summary of changes for each release. Use ISO dates. Reference GitHub issues numbers and PR numbers. +2021-??-?? 0.8.0 +ALescoulie + +Changes + +* dropped support for Python 2 and <3.6: only Python 3.7--3.9 + are supported (#177) + 2021-08-04 0.7.1 orbeckst, iorga @@ -18,7 +26,7 @@ Fixes * fix fep.p_transfer() only analyzing the second input Gsolv (would lead to an error like "results.DeltaA does not contain 'Gibbs'") (PR #185) * ensure that pickle files created under Python 2 are also readable under - Python 3 + Python 3 * documentation fixes (PR #176) diff --git a/doc/sphinx/source/scripts.txt b/doc/sphinx/source/scripts.txt index 630ee9d4..998327e5 100644 --- a/doc/sphinx/source/scripts.txt +++ b/doc/sphinx/source/scripts.txt @@ -136,7 +136,7 @@ Usage of the command: .. option:: RUNFILE The runfile :file:`runinput.yml` with all configuration parameters. - + Options: @@ -242,7 +242,7 @@ Usage of the command: "auto" option (or "none"). The total solvation free energy is calculated as - + .. math:: \Delta G^{*} = -(\Delta G_{\text{coul}} + \Delta G_{\text{vdw}}) @@ -275,14 +275,14 @@ Usage of the command: positional arguments: - + .. option:: DIRECTORY [DIRECTORY ...] directory or directories which contain all the files resulting from running :meth:`mdpow.fep.Ghyd.setup` optional arguments: - + .. option:: -h, --help show this help message and exit @@ -294,43 +294,43 @@ Usage of the command: *none* disables it The plot function is only available for mdpow estimator,and is disabled when using alchemlyb estimators. (default: none) - + .. option:: --solvent NAME, -S NAME solvent `NAME` for compound, 'water', 'octanol', or 'cyclohexane' (default: water) - + .. option:: -o FILE, --outfile FILE append one-line results summary to `FILE` (default: :file:`gsolv.txt`) - + .. option:: -e FILE, --energies FILE append solvation free energies to FILE (default: :file:`energies.txt`) - + .. option:: --estimator {mdpow,alchemlyb} - + choose the estimator to be used, *alchemlyb* or *mdpow* estimators (default: *alchemlyb*) - + .. option:: --method {TI,MBAR,BAR} - + choose the method to calculate free energy (default: *MBAR*) - + .. option:: --force force rereading all data (default: False) - + .. option:: --SI enable statistical inefficiency (SI) analysis. Statistical inefficiency analysis is performed by default when usingalchemlyb estimators and is always disabled when using mdpow estimator. (default: True) - + .. option:: --no-SI disable statistical inefficiency @@ -338,36 +338,36 @@ Usage of the command: performed by default when usingalchemlyb estimators and is disabled when using mdpow estimator. (default: False) - + .. option:: -s N, --stride N use every `N`-th datapoint from the original dV/dlambda data. (default: 1) - + .. option:: --start START - + start point for the data used from the original dV/dlambda data. (default: 0) - + .. option:: --stop STOP stop point for the data used from the original dV/dlambda data. (default: None) - + .. option:: --ignore-corrupted skip lines in the md.xvg files that cannot be parsed. (default: False) - + .. warning:: - + Other lines in the file might have been corrupted in such a way that they appear correct but are in fact wrong. WRONG RESULTS CAN OCCUR! USE AT YOUR - OWN RISK + OWN RISK It is recommended to simply rerun the affected simulation(s). - + @@ -409,7 +409,7 @@ Usage of the command: positional arguments: - + .. option:: DIRECTORY [DIRECTORY ...] One or more directories that contain the state pickle @@ -420,13 +420,13 @@ Usage of the command: resulting from running :meth:`mdpow.fep.Ghyd.setup` and :meth:`mdpow.fep.Goct.setup` and the results of the MD FEP simulations. - + optional arguments: - + .. option:: -h, --help show this help message and exit - + .. option:: --plotfile FILE plot dV/dlambda to FILE; use png or pdf suffix to @@ -435,38 +435,38 @@ Usage of the command: *none* disables it The plot function is only available for mdpow estimator,and is disabled when using alchemlyb estimators. (default: none) - + .. option:: -o FILE, --outfile FILE append one-line results summary to `FILE` (default: :file:`pow.txt`) - + .. option:: -e FILE, --energies FILE append solvation free energies to FILE (default: :file:`energies.txt`) - + .. option:: --estimator {mdpow,alchemlyb} - + choose the estimator to be used, *alchemlyb* or *mdpow* estimators (default: *alchemlyb*) - + .. option:: --method {TI,MBAR,BAR} - + choose the method to calculate free energy (default: *MBAR*) - + .. option:: --force force rereading all data (default: False) - + .. option:: --SI enable statistical inefficiency (SI) analysis. Statistical inefficiency analysis is performed by default when usingalchemlyb estimators and is always disabled when using mdpow estimator. (default: True) - + .. option:: --no-SI disable statistical inefficiency @@ -474,36 +474,36 @@ Usage of the command: performed by default when usingalchemlyb estimators and is disabled when using mdpow estimator. (default: False) - + .. option:: -s N, --stride N use every `N`-th datapoint from the original dV/dlambda data. (default: 1) - + .. option:: --start START - + start point for the data used from the original dV/dlambda data. (default: 0) - + .. option:: --stop STOP stop point for the data used from the original dV/dlambda data. (default: None) - + .. option:: --ignore-corrupted skip lines in the md.xvg files that cannot be parsed. (default: False) - + .. warning:: - + Other lines in the file might have been corrupted in such a way that they appear correct but are in fact wrong. WRONG RESULTS CAN OCCUR! USE AT YOUR - OWN RISK + OWN RISK It is recommended to simply rerun the affected simulation(s). - + .. _mdpow-pow-outputformat-label: diff --git a/mdpow/__init__.py b/mdpow/__init__.py index 41dcb61c..2fb2484e 100644 --- a/mdpow/__init__.py +++ b/mdpow/__init__.py @@ -2,10 +2,6 @@ # Copyright (c) 2010 Oliver Beckstein # Released under the GNU Public License 3 (or higher, your choice) # See the file COPYING for details. - - -from __future__ import absolute_import - from . import log from ._version import get_versions diff --git a/mdpow/_version.py b/mdpow/_version.py index c0829035..2484e7bd 100644 --- a/mdpow/_version.py +++ b/mdpow/_version.py @@ -9,8 +9,6 @@ # versioneer-0.18 (https://github.com/warner/python-versioneer) """Git implementation of _version.py.""" -from __future__ import absolute_import, print_function - import errno import os import re diff --git a/mdpow/config.py b/mdpow/config.py index 382c42eb..f46471dc 100644 --- a/mdpow/config.py +++ b/mdpow/config.py @@ -89,11 +89,6 @@ .. autofunction:: _generate_template_dict """ - -from __future__ import absolute_import, division - -import six - import os, errno from pkg_resources import resource_filename, resource_listdir import yaml @@ -346,7 +341,7 @@ def _get_template(t): def iterable(obj): """Returns ``True`` if *obj* can be iterated over and is *not* a string.""" - if isinstance(obj, six.string_types): + if isinstance(obj, str): return False # avoid iterating over characters of a string if hasattr(obj, 'next'): diff --git a/mdpow/equil.py b/mdpow/equil.py index 259aa357..2d39a11d 100644 --- a/mdpow/equil.py +++ b/mdpow/equil.py @@ -28,10 +28,7 @@ .. autodata:: DIST """ - -from __future__ import absolute_import, division - -from six.moves import cPickle as pickle +import pickle import os, errno import shutil @@ -229,7 +226,7 @@ def save(self, filename=None): else: self.filename = filename with open(filename, 'wb') as f: - pickle.dump(self, f, protocol=pickle.HIGHEST_PROTOCOL) + pickle.dump(self, f) logger.debug("Instance pickled to %(filename)r" % vars()) def load(self, filename=None): diff --git a/mdpow/fep.py b/mdpow/fep.py index e82dbe55..edc9b7c6 100644 --- a/mdpow/fep.py +++ b/mdpow/fep.py @@ -73,21 +73,22 @@ .. autoclass:: Gsolv :members: - :inherited-members: - + :inherited-members: + .. autoclass:: Ghyd :members: :inherited-members: - + .. autoclass:: Goct :members: :inherited-members: - + .. autoclass:: Gcyclo :members: :inherited-members: - + .. autofunction:: pOW + .. autofunction:: pCW @@ -131,11 +132,6 @@ See `Free Energy Tutorial`_. """ -from __future__ import absolute_import, division - -import six -from six.moves import zip -from six.moves.configparser import NoOptionError import os import errno @@ -143,6 +139,7 @@ from subprocess import call import warnings from glob import glob +from configparser import NoOptionError import numpy import pandas as pd @@ -267,7 +264,7 @@ def getter(type, section, key): def __deepcopy__(self, memo): x = FEPschedule() - for k, v in six.iteritems(self): + for k, v in self.items(): x[k] = copy.deepcopy(v) return x @@ -281,7 +278,7 @@ class Gsolv(Journalled): .. math:: - \Delta A = -(\Delta A_{\mathrm{coul}} + \Delta A_{\mathrm{vdw}}) + \Delta A = -(\Delta A_{\mathrm{coul}} + \Delta A_{\mathrm{vdw}}) With this protocol, the concentration in the liquid and in the gas phase is the same. (Under the assumption of ideal solution/ideal @@ -900,7 +897,6 @@ def analyze(self, force=False, stride=None, autosave=True, ncorrel=25000): interaction switched on and ``lambda=1`` as switched off. .. math:: - \Delta A^{*} = -(\Delta A_{\mathrm{coul}} + \Delta A_{\mathrm{vdw}}) Data are stored in :attr:`Gsolv.results`. @@ -953,22 +949,21 @@ def analyze(self, force=False, stride=None, autosave=True, ncorrel=25000): The error on the mean of the data :math:`\epsilon_y`, taking the correlation time into account, is calculated according to [FrenkelSmit2002]_ `p526`_: - + .. math:: - + \epsilon_y = \sqrt{2 \tau_c \mathrm{acf}(0)/T} - + where :math:`\mathrm{acf}()` is the autocorrelation function of the fluctuations around the mean, :math:`y - \langle y \rangle`, :math:`\tau_c` is the correlation time, and :math:`T` - the total length of the simulation. + the total length of the simulation .. [FrenkelSmit2002] D. Frenkel and B. Smit, Understanding Molecular Simulation. Academic Press, San Diego 2002 .. _p526: http://books.google.co.uk/books?id=XmyO2oRUg0cC&pg=PA526 - """ stride = stride or self.stride logger.info("Analysis stride is %s.",stride) diff --git a/mdpow/filelock.py b/mdpow/filelock.py index 07228a07..f01dc0fc 100644 --- a/mdpow/filelock.py +++ b/mdpow/filelock.py @@ -26,8 +26,6 @@ """ -from __future__ import absolute_import, print_function - import os import time import errno diff --git a/mdpow/forcefields.py b/mdpow/forcefields.py index 7d5678ee..a9aed7c4 100644 --- a/mdpow/forcefields.py +++ b/mdpow/forcefields.py @@ -54,9 +54,6 @@ .. autofunction:: get_solvent_model """ - -from __future__ import absolute_import - import os from collections import defaultdict @@ -228,12 +225,12 @@ def get_solvent_identifier(solvent_type, model=None, forcefield='OPLS-AA'): model. For other solvents and forcefields, "model" is not required. :Returns: Either an identifier or ``None`` - """ + if solvent_type == "water": identifier = model if not model in (None, 'water') else DEFAULT_WATER_MODEL return identifier if identifier in GROMACS_WATER_MODELS else None - if not model in GROMACS_SOLVENT_MODELS[forcefield]: + if model not in GROMACS_SOLVENT_MODELS[forcefield]: if solvent_type in GROMACS_SOLVENT_MODELS[forcefield]: model = solvent_type else: @@ -264,6 +261,7 @@ def get_ff_paths(forcefield='OPLS-AA'): """Return a :list: containing the forcefield directory, paths of ions and default watermodel itp files. """ + settings = { 'OPLS-AA': ['oplsaa.ff/', 'oplsaa.ff/ions_opls.itp', 'oplsaa.ff/tip4p.itp'], @@ -282,6 +280,7 @@ def get_ff_paths(forcefield='OPLS-AA'): def get_top_template(identifier): """Return the topology file template suitable for the solvent model.""" + templates = {'water': 'system.top', 'octanol': 'system.top', 'cyclohexane': 'system.top', 'wetoctanol': 'system_octwet.top'} try: diff --git a/mdpow/log.py b/mdpow/log.py index f40bdb5c..f2727293 100644 --- a/mdpow/log.py +++ b/mdpow/log.py @@ -18,9 +18,6 @@ import logging logger = logging.getLogger(logname) """ - -from __future__ import absolute_import - # log is the only package that is imported in __init__ so it MAY NOT # HAVE ANY DEPENDENCIES except standard library; in particular, DO NOT # 'from . import config' or similar because it will break pip install diff --git a/mdpow/restart.py b/mdpow/restart.py index e78cd25b..02d55f6e 100644 --- a/mdpow/restart.py +++ b/mdpow/restart.py @@ -21,12 +21,9 @@ .. autofunction:: checkpoint """ -from __future__ import absolute_import, print_function - -from six.moves import cPickle as pickle +import pickle import os -import errno import logging logger = logging.getLogger('mdpow.checkpoint') diff --git a/mdpow/run.py b/mdpow/run.py index 7b2282b5..061232d9 100644 --- a/mdpow/run.py +++ b/mdpow/run.py @@ -36,10 +36,7 @@ .. autofunction:: runMD_or_exit """ - -from __future__ import absolute_import - -from six.moves import configparser +import configparser import sys import os diff --git a/mdpow/tests/test_Gsolv.py b/mdpow/tests/test_Gsolv.py index 6f60f722..034fe8f2 100644 --- a/mdpow/tests/test_Gsolv.py +++ b/mdpow/tests/test_Gsolv.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from . import tempdir as td import os @@ -7,8 +5,7 @@ import numpy as np from gromacs.utilities import in_dir -import mdpow.fep -import mdpow.equil +from mdpow import fep, equil class Test_Gsolv_manual(object): @@ -21,7 +18,7 @@ def setup(self): self.m.assemble('md_npt',self.tmpdir.name) simulation_filename = os.path.join(self.tmpdir.name,'benzene', 'water.simulation') - self.S = mdpow.equil.Simulation(filename = simulation_filename) + self.S = equil.Simulation(filename = simulation_filename) self.S.make_paths_relative(prefix=os.path.join( self.tmpdir.name,'benzene', 'Equilibrium', 'water')) @@ -33,7 +30,7 @@ def teardown(self): def _setup(self, **kwargs): with in_dir(self.tmpdir.name, create=False): - self.Gsolv = mdpow.fep.Gsolv(simulation=self.S, molecule='BNZ', + self.Gsolv = fep.Gsolv(simulation=self.S, molecule='BNZ', mdp=os.path.join(self.old_path, 'mdpow', 'templates', 'bar_opls.mdp') ,**kwargs) self.Gsolv.setup(maxwarn=1) diff --git a/mdpow/tests/test_analysis.py b/mdpow/tests/test_analysis.py index ddda8eff..70464b62 100644 --- a/mdpow/tests/test_analysis.py +++ b/mdpow/tests/test_analysis.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - import os.path import pytest @@ -9,13 +7,14 @@ from numpy.testing import assert_array_almost_equal -from six.moves import cPickle as pickle +import pickle import numkit -import mdpow.fep from . import RESOURCES +import mdpow.fep + MANIFEST = RESOURCES.join("manifest.yml") def fix_manifest(topdir): @@ -111,4 +110,3 @@ def test_TI(self, fep_benzene_directory): raise AssertionError("Failed to convert edr to xvg: {0}: {1}".format( err.strerror, err.filename)) self.assert_DeltaA(G) - diff --git a/mdpow/tests/test_analysis_alchemlyb.py b/mdpow/tests/test_analysis_alchemlyb.py index b8b272bf..2452b6bc 100644 --- a/mdpow/tests/test_analysis_alchemlyb.py +++ b/mdpow/tests/test_analysis_alchemlyb.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - import os.path import pytest @@ -10,10 +8,9 @@ from numpy.testing import assert_array_almost_equal import pandas -from six.moves import cPickle as pickle +import pickle import mdpow.fep - from . import RESOURCES MANIFEST = RESOURCES.join("manifest.yml") diff --git a/mdpow/tests/test_emin.py b/mdpow/tests/test_emin.py deleted file mode 100644 index f0b550a8..00000000 --- a/mdpow/tests/test_emin.py +++ /dev/null @@ -1,27 +0,0 @@ -from __future__ import absolute_import - -from . import tempdir as td - -import mdpow.equil -import os - -class TestEnergyMinimization(object): - - def setup(self): - self.tmpdir = td.TempDir() - self.old_path = os.getcwd() - self.resources = os.path.join(self.old_path, 'mdpow', 'tests', 'testing_resources') - # TODO Instantiate Simulation object from existing files in resources - - def _run_emin(self): - """To be used as a helper function in tests.""" - pass - - def test_new_struct_exists(self): - """Tests if the new structure exists where it is expected to.""" - pass - - def test_new_struct_diff(self): - """Tests if the new structure differs from the initial structure.""" - pass - diff --git a/mdpow/tests/test_equilibration_script.py b/mdpow/tests/test_equilibration_script.py index 34be0d06..23a7414f 100644 --- a/mdpow/tests/test_equilibration_script.py +++ b/mdpow/tests/test_equilibration_script.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from . import tempdir as td import os.path @@ -45,4 +43,3 @@ def _new_structures(self): assert os.path.exists( os.path.join(self.tmpdir.name, 'benzene', 'Equilibrium', 'water', 'MD_NPT', 'md.gro')) - diff --git a/mdpow/tests/test_fep.py b/mdpow/tests/test_fep.py index d630f49c..332da868 100644 --- a/mdpow/tests/test_fep.py +++ b/mdpow/tests/test_fep.py @@ -1,7 +1,3 @@ -from __future__ import absolute_import - -import sys - import pytest import numpy as np @@ -9,9 +5,10 @@ from scipy import constants from copy import deepcopy +import gromacs + import mdpow.config import mdpow.fep -import gromacs def test_molar_to_nm3(): assert_almost_equal(mdpow.fep.molar_to_nm3(1.5), 0.9033212684) @@ -117,5 +114,3 @@ def _test_schedule(self, component): else: assert schedule[k] == reference[k], \ "mismatch between loaded FEP schedule entry {0} and reference".format(k) - - diff --git a/mdpow/tests/test_fep_analysis.py b/mdpow/tests/test_fep_analysis.py index b5242863..dff2a72d 100644 --- a/mdpow/tests/test_fep_analysis.py +++ b/mdpow/tests/test_fep_analysis.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - import pytest import os.path @@ -78,4 +76,3 @@ def test_pOW_error(Ghyd, Ghyd_other): def test_pCW_error(Ghyd, Ghyd_other): with pytest.raises(ValueError): mdpow.fep.pCW(Ghyd, Ghyd_other) - diff --git a/mdpow/tests/test_fep_script.py b/mdpow/tests/test_fep_script.py index 4961cdbf..3f01a3ee 100644 --- a/mdpow/tests/test_fep_script.py +++ b/mdpow/tests/test_fep_script.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from . import tempdir as td import os diff --git a/mdpow/tests/test_filelock.py b/mdpow/tests/test_filelock.py index dec0b1cb..a6c4d4ed 100644 --- a/mdpow/tests/test_filelock.py +++ b/mdpow/tests/test_filelock.py @@ -1,20 +1,18 @@ -from __future__ import absolute_import - import os.path import pytest -import mdpow.filelock +from .. import filelock def test_FileLock_acquire(tmpdir, filename="test.txt"): with tmpdir.as_cwd(): - with mdpow.filelock.FileLock(filename, timeout=2) as lock: + with filelock.FileLock(filename, timeout=2) as lock: with open(filename, "w") as f: f.write("Humpty Dumpty sat on a wall") assert os.path.exists(filename) def test_FileLock_lock(filename="test.txt"): - with mdpow.filelock.FileLock(filename, timeout=2) as lock: - with pytest.raises(mdpow.filelock.FileLockException): - with mdpow.filelock.FileLock(filename, timeout=0.1) as lock2: + with filelock.FileLock(filename, timeout=2) as lock: + with pytest.raises(filelock.FileLockException): + with filelock.FileLock(filename, timeout=0.1) as lock2: pass diff --git a/mdpow/tests/test_forcefields.py b/mdpow/tests/test_forcefields.py index ad7d26f3..db556f80 100644 --- a/mdpow/tests/test_forcefields.py +++ b/mdpow/tests/test_forcefields.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - import os.path import pytest diff --git a/mdpow/tests/test_runinput.py b/mdpow/tests/test_runinput.py index 07662175..ef7986d0 100644 --- a/mdpow/tests/test_runinput.py +++ b/mdpow/tests/test_runinput.py @@ -1,11 +1,9 @@ -from __future__ import absolute_import - import os.path import numpy as np from numpy.testing import assert_array_almost_equal -import mdpow.config +from mdpow import config class TestAlteredConfig(object): params_altered = { @@ -87,7 +85,7 @@ class TestAlteredConfig(object): def setup(self): # load default bundled configuration - self.cfg = mdpow.config.get_configuration( + self.cfg = config.get_configuration( os.path.join('mdpow', 'tests', 'testing_resources', 'test_configurations', 'altered_runinput.yml')) @@ -128,4 +126,3 @@ def test_FEP_schedule_VDW(self): def test_mdrun(self): return self._test_section("mdrun") - diff --git a/mdpow/tests/test_solvation.py b/mdpow/tests/test_solvation.py index 5f3a7ec9..9e605bd1 100644 --- a/mdpow/tests/test_solvation.py +++ b/mdpow/tests/test_solvation.py @@ -1,18 +1,17 @@ -from __future__ import absolute_import - import os import shutil -import mdpow.equil from gromacs.utilities import in_dir import gromacs import pytest -sims = {"water" : mdpow.equil.WaterSimulation, - "octanol" : mdpow.equil.OctanolSimulation, - "cyclohexane" : mdpow.equil.CyclohexaneSimulation, - "wetoctanol" : mdpow.equil.WetOctanolSimulation, +from mdpow import equil + +sims = {"water" : equil.WaterSimulation, + "octanol" : equil.OctanolSimulation, + "cyclohexane" : equil.CyclohexaneSimulation, + "wetoctanol" : equil.WetOctanolSimulation, } test_file = {"OPLS-AA": 'benzene.itp', diff --git a/mdpow/tests/test_version.py b/mdpow/tests/test_version.py index 54677783..187f27d4 100644 --- a/mdpow/tests/test_version.py +++ b/mdpow/tests/test_version.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import - -import six import pytest import mdpow @@ -10,7 +7,7 @@ def version(): return mdpow.__version__ def test_version_string(version): - assert isinstance(version, six.string_types) + assert isinstance(version, str) def test_version(version): # generic non-empty check because versioneer can provide different diff --git a/scripts/mdpow-cfg2yaml.py b/scripts/mdpow-cfg2yaml.py index 7bcba217..a46f7c4c 100755 --- a/scripts/mdpow-cfg2yaml.py +++ b/scripts/mdpow-cfg2yaml.py @@ -1,5 +1,4 @@ #! /bin/python -from __future__ import absolute_import, print_function, division import sys import yaml diff --git a/scripts/mdpow-equilibrium b/scripts/mdpow-equilibrium index 529f6692..f8523e97 100755 --- a/scripts/mdpow-equilibrium +++ b/scripts/mdpow-equilibrium @@ -21,7 +21,6 @@ You will require: # TODO: # # 2) Default config file in user's home dir. -from __future__ import absolute_import, print_function, division from mdpow.run import equilibrium_simulation from mdpow.config import get_configuration diff --git a/scripts/mdpow-ghyd b/scripts/mdpow-ghyd index 51bf4466..cf0f76ad 100755 --- a/scripts/mdpow-ghyd +++ b/scripts/mdpow-ghyd @@ -230,9 +230,9 @@ if __name__ == "__main__": run_ghyd(directory, plotfile=opts.plotfile, energyfile=realpath_or_none(opts.energyfile), force=opts.force, stride=opts.stride, permissive=opts.permissive) - except (OSError, IOError), err: + except (OSError, IOError) as err: logger.error("Running analysis in directory %r failed: %s", directory, str(err)) - except Exception, err: + except Exception as err: logger.fatal("Running analysis in directory %r failed", directory) logger.exception("Catastrophic problem occurred, see the stack trace for hints.") raise diff --git a/scripts/mdpow-rebuild-fep b/scripts/mdpow-rebuild-fep index cd454492..8f475e0b 100755 --- a/scripts/mdpow-rebuild-fep +++ b/scripts/mdpow-rebuild-fep @@ -109,13 +109,13 @@ if __name__ == "__main__": try: G = fixFEP(solvent, fepfile, simfile, os.path.realpath(os.path.curdir)) - except Exception,err: + except Exception as err: logger.warning(str(err)) if qscript: logger.info("[%(solvent)8s] Setting up FEP jobs for %(qscript)r...", vars()) try: G.setup(qscript=qscript) - except Exception,err: + except Exception as err: logger.error(str(err)) diff --git a/scripts/mdpow-rebuild-simulation b/scripts/mdpow-rebuild-simulation index 1649aa3c..b8a018f3 100755 --- a/scripts/mdpow-rebuild-simulation +++ b/scripts/mdpow-rebuild-simulation @@ -69,7 +69,7 @@ if __name__ == "__main__": try: S = fixSimulation(solvent, simfile, os.path.realpath(os.path.curdir)) - except Exception,err: + except Exception as err: logger.error("[%(solvent)8s] Failed to fix %(simfile)r", vars()) logger.error(str(err)) diff --git a/setup.py b/setup.py index 89aa3a77..63a7680a 100644 --- a/setup.py +++ b/setup.py @@ -25,8 +25,6 @@ "Operating System :: POSIX", 'Operating System :: MacOS :: MacOS X', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", @@ -58,7 +56,7 @@ 'numkit', 'six', 'mdanalysis', - 'alchemlyb' if sys.version_info.major > 2 else 'alchemlyb<0.5.0', + 'alchemlyb', 'pandas', 'pymbar', ],