From 9a0b0619a77ec37c634f99da8baba6cbbdf8724a Mon Sep 17 00:00:00 2001 From: Thomas Heavey Date: Tue, 27 Nov 2018 17:59:58 -0500 Subject: [PATCH] =?UTF-8?q?#35=20GromacsWrapper=20=E2=89=A5=200.7=20suppor?= =?UTF-8?q?ts=20Python=203.4+?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove Python type check in __init__; Update a few old lines in energy_histo; Fix a few unescaped backslashes in strings --- paratemp/__init__.py | 8 -------- paratemp/coordinate_analysis.py | 8 ++++---- paratemp/energy_histo.py | 7 +------ paratemp/plotting.py | 2 +- requirements.txt | 2 +- setup.py | 2 +- 6 files changed, 8 insertions(+), 21 deletions(-) diff --git a/paratemp/__init__.py b/paratemp/__init__.py index 9bac367..6dbaa9c 100644 --- a/paratemp/__init__.py +++ b/paratemp/__init__.py @@ -24,8 +24,6 @@ from __future__ import absolute_import -import sys - from . import para_temp_setup from .tools import copy_no_overwrite, cd, get_temperatures from . import coordinate_analysis @@ -37,12 +35,6 @@ del absolute_import -if sys.version_info.major == 2: - # These (at this point) require python 2 because of gromacs (gromacswrapper) - from . import energy_histo - from . import energy_bin_analysis -del sys - __version__ = get_versions()['version'] del get_versions diff --git a/paratemp/coordinate_analysis.py b/paratemp/coordinate_analysis.py index 968037e..302bc52 100644 --- a/paratemp/coordinate_analysis.py +++ b/paratemp/coordinate_analysis.py @@ -410,7 +410,7 @@ def fes_1d(self, data, bins=None, temp=None, :param bins: Default: None. The bins argument to be passed to np.histogram - :param str xlabel: Default: 'distance / $\mathrm{\AA}$'. The label for + :param str xlabel: Default: 'distance / $\\mathrm{\\AA}$'. The label for the x axis. :type ax: matplotlib.axes.Axes @@ -935,7 +935,7 @@ def plot_ox_dists(self, save=False, save_format='png', **kwargs) ax.legend() ax.set_xlabel('time / ps') - ax.set_ylabel('distance / $\mathrm{\AA}$') + ax.set_ylabel(r'distance / $\mathrm{\AA}$') if save: fig.savefig(save_base_name + save_format) if display: @@ -1194,7 +1194,7 @@ def make_plot_taddol_ox_dists(data, save=False, save_format='pdf', axes.plot(data[:, 0], data[:, 3], label='O(r)-Cy') axes.legend() axes.set_xlabel('time / ps') - axes.set_ylabel('distance / $\mathrm{\AA}$') + axes.set_ylabel(r'distance / $\mathrm{\AA}$') if save: fig.savefig(save_base_name+save_format) if display: @@ -1279,7 +1279,7 @@ def make_taddol_pi_dist_array(dists, save=False, save_format='pdf', """Plot array of pi distances in TADDOL trajectory""" fig = plot_dist_array(dists) [ax.get_xaxis().set_ticks([]) for ax in fig.axes] - fig.text(0.05, 0.585, 'distance / $\mathrm{\AA}$', ha='center', + fig.text(0.05, 0.585, r'distance / $\mathrm{\AA}$', ha='center', rotation='vertical') fig.text(0.513, 0.08, 'time', ha='center') if save: diff --git a/paratemp/energy_histo.py b/paratemp/energy_histo.py index 00b584c..eb59c27 100644 --- a/paratemp/energy_histo.py +++ b/paratemp/energy_histo.py @@ -36,12 +36,7 @@ import pandas as pd from .tools import all_elements_same - -__version__ = '0.0.2' - -# todo define a set of run data as a class -# possibly as a class of mdanalysis universes, but not sure how to work with -# replicas vs. walkers there. +from . import __version__ # TODO update docstrings to PEP specs # (one brief description line, blank line, longer description/guidelines) diff --git a/paratemp/plotting.py b/paratemp/plotting.py index 5aa8cd4..a20729a 100644 --- a/paratemp/plotting.py +++ b/paratemp/plotting.py @@ -59,7 +59,7 @@ def fes_1d(x, temp, ax=None, bins=None, :param bins: Default: None. The bins argument to be passed to np.histogram - :param str xlabel: Default: 'distance / $\mathrm{\AA}$'. The label for + :param str xlabel: Default: 'distance / $\\mathrm{\\AA}$'. The label for the x axis. :type ax: matplotlib.axes.Axes diff --git a/requirements.txt b/requirements.txt index 6719eeb..e338ee5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ numpy matplotlib panedr py -gromacswrapper +gromacswrapper>=0.7 tables typing scipy diff --git a/setup.py b/setup.py index 6806f76..ba12876 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ 'numpy', 'matplotlib', 'panedr', - 'gromacswrapper', + 'gromacswrapper>=0.7', 'tables', 'typing', 'scipy',