Skip to content

Commit

Permalink
Remove python 2 Support in MDPOW (#178)
Browse files Browse the repository at this point in the history
remove python 2

* fix #177
* update setup.py and CHANGES

Co-authored-by: ALescoulie <[email protected]>
Co-authored-by: Oliver Beckstein <[email protected]>
  • Loading branch information
3 people authored Aug 17, 2021
1 parent 9c5b966 commit fcff52a
Show file tree
Hide file tree
Showing 32 changed files with 106 additions and 195 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 9 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)


Expand Down
90 changes: 45 additions & 45 deletions doc/sphinx/source/scripts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Usage of the command:
.. option:: RUNFILE

The runfile :file:`runinput.yml` with all configuration parameters.


Options:

Expand Down Expand Up @@ -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}})
Expand Down Expand Up @@ -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
Expand All @@ -294,80 +294,80 @@ 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
analysis. Statistical inefficiency analysis is
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).




Expand Down Expand Up @@ -409,7 +409,7 @@ Usage of the command:


positional arguments:

.. option:: DIRECTORY [DIRECTORY ...]

One or more directories that contain the state pickle
Expand All @@ -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
Expand All @@ -435,75 +435,75 @@ 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
analysis. Statistical inefficiency analysis is
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:
Expand Down
4 changes: 0 additions & 4 deletions mdpow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
# Copyright (c) 2010 Oliver Beckstein <[email protected]>
# 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
Expand Down
2 changes: 0 additions & 2 deletions mdpow/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions mdpow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'):
Expand Down
7 changes: 2 additions & 5 deletions mdpow/equil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
Loading

0 comments on commit fcff52a

Please sign in to comment.