From 096c6da934e6dcec6d780a2e1d0e37ce5346f338 Mon Sep 17 00:00:00 2001 From: Chris Mayes Date: Sun, 13 Sep 2015 16:11:18 -0500 Subject: [PATCH] Changed to cmayes and modified test files to read from a base dir based on the test file's location. --- AUTHORS.rst | 4 ++-- CONTRIBUTING.rst | 7 ++++--- LICENSE | 2 +- README.rst | 4 ++-- docs/conf.py | 8 ++++---- md_utils/__init__.py | 4 ++-- setup.py | 6 +++--- tests/test_calc_pka.py | 2 +- tests/test_calc_split_avg.py | 2 +- tests/test_common.py | 2 +- tests/test_fes_combo.py | 7 ++++++- tests/test_wham.py | 2 +- tests/test_wham_rad.py | 2 +- 13 files changed, 29 insertions(+), 23 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 85a1a82..4859fd3 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -5,9 +5,9 @@ Credits Development Lead ---------------- -* Heather Mayes +* Chris Mayes Contributors ------------ -* Chris Mayes +* Heather Mayes diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index f5678fb..d6e2844 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -13,7 +13,7 @@ Types of Contributions Report Bugs ~~~~~~~~~~~ -Report bugs at https://github.com/hmayes/md_utils/issues. +Report bugs at https://github.com/cmayes/md_utils/issues. If you are reporting a bug, please include: @@ -43,7 +43,7 @@ articles, and such. Submit Feedback ~~~~~~~~~~~~~~~ -The best way to send feedback is to file an issue at https://github.com/hmayes/md_utils/issues. +The best way to send feedback is to file an issue at https://github.com/cmayes/md_utils/issues. If you are proposing a feature: @@ -100,7 +100,7 @@ Before you submit a pull request, check that it meets these guidelines: your new functionality into a function with a docstring, and add the feature to the list in README.rst. 3. The pull request should work for Python 2.6, 2.7, 3.3, and 3.4, and for PyPy. Check - https://travis-ci.org/hmayes/md_utils/pull_requests + https://travis-ci.org/cmayes/md_utils/pull_requests and make sure that the tests pass for all supported Python versions. Tips @@ -109,3 +109,4 @@ Tips To run a subset of tests:: $ python -m unittest tests.test_md_utils + diff --git a/LICENSE b/LICENSE index 3d51635..fb0e4da 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015, Heather Mayes +Copyright (c) 2015, Chris Mayes All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.rst b/README.rst index 0685636..1b3a03e 100644 --- a/README.rst +++ b/README.rst @@ -2,8 +2,8 @@ MD Utilities ============ -.. image:: https://img.shields.io/travis/hmayes/md_utils.svg - :target: https://travis-ci.org/hmayes/md_utils +.. image:: https://img.shields.io/travis/cmayes/md_utils.svg + :target: https://travis-ci.org/cmayes/md_utils .. image:: https://img.shields.io/pypi/v/md_utils.svg :target: https://pypi.python.org/pypi/md_utils diff --git a/docs/conf.py b/docs/conf.py index f48e82e..fa713ba 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -56,7 +56,7 @@ # General information about the project. project = u'MD Utilities' -copyright = u'2015, Heather Mayes' +copyright = u'2015, Chris Mayes' # The version info for the project you're documenting, acts as replacement # for |version| and |release|, also used in various other places throughout @@ -210,7 +210,7 @@ latex_documents = [ ('index', 'md_utils.tex', u'MD Utilities Documentation', - u'Heather Mayes', 'manual'), + u'Chris Mayes', 'manual'), ] # The name of an image file (relative to this directory) to place at @@ -241,7 +241,7 @@ man_pages = [ ('index', 'md_utils', u'MD Utilities Documentation', - [u'Heather Mayes'], 1) + [u'Chris Mayes'], 1) ] # If true, show URL addresses after external links. @@ -256,7 +256,7 @@ texinfo_documents = [ ('index', 'md_utils', u'MD Utilities Documentation', - u'Heather Mayes', + u'Chris Mayes', 'md_utils', 'One line description of project.', 'Miscellaneous'), diff --git a/md_utils/__init__.py b/md_utils/__init__.py index feaaf4b..b54ad41 100755 --- a/md_utils/__init__.py +++ b/md_utils/__init__.py @@ -3,6 +3,6 @@ Molecular dynamics utilities. """ -__author__ = 'Heather Mayes' -__email__ = 'hmayes@hmayes.com' +__author__ = 'Chris Mayes' +__email__ = 'cmayes@cmay.es' __version__ = '0.3.0' diff --git a/setup.py b/setup.py index ad662d7..1e68fcf 100755 --- a/setup.py +++ b/setup.py @@ -27,9 +27,9 @@ version=md_utils.__version__, description="Utility scripts for MD data", long_description=readme + '\n\n' + history, - author="Heather Mayes", - author_email='hmayes@hmayes.com', - url='https://github.com/hmayes/md_utils', + author="Chris Mayes", + author_email='cmayes@cmayes.com', + url='https://github.com/cmayes/md_utils', packages=[ 'md_utils', ], diff --git a/tests/test_calc_pka.py b/tests/test_calc_pka.py index cc8f4dc..4ba2c0e 100644 --- a/tests/test_calc_pka.py +++ b/tests/test_calc_pka.py @@ -22,7 +22,7 @@ logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger('test_calc_pka') -DATA_DIR = 'test_data' +DATA_DIR = os.path.join(os.path.dirname(__file__), 'test_data') PKA_DATA_DIR = os.path.join(DATA_DIR, 'calc_pka') GOOD_RAD_PATH = os.path.join(PKA_DATA_DIR, 'rad_PMFlast2ns3_1.txt') NO_MAX_RAD_PATH = os.path.join(PKA_DATA_DIR, 'rad_no_max.txt') diff --git a/tests/test_calc_split_avg.py b/tests/test_calc_split_avg.py index 403400b..c0b6e8c 100644 --- a/tests/test_calc_split_avg.py +++ b/tests/test_calc_split_avg.py @@ -15,7 +15,7 @@ BINNED_FILES = {'02': ['rad_PMF.02_01', 'rad_PMF.02_02', 'rad_PMF.02_03'], '01': ['rad_PMF.01_02', 'rad_PMF.01_01']} -DATA_DIR = os.path.join('test_data', 'post_rad_wham') +DATA_DIR = os.path.join(os.path.dirname(__file__), 'test_data', 'post_rad_wham') INFILES = [os.path.join(DATA_DIR, radf) for radf in ['rad_PMF.02_01', 'rad_PMF.02_02', 'rad_PMF.02_03']] diff --git a/tests/test_common.py b/tests/test_common.py index 7be3fba..4729885 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -22,7 +22,7 @@ # Constants # -DATA_DIR = 'test_data' +DATA_DIR = os.path.join(os.path.dirname(__file__), 'test_data') FES_OUT_DIR = 'fes_out' CALC_PKA_DIR = 'calc_pka' CSV_FILE = os.path.join(DATA_DIR, CALC_PKA_DIR, 'rad_PMFlast2ns3_1.txt') diff --git a/tests/test_fes_combo.py b/tests/test_fes_combo.py index ea9b420..3a58a15 100644 --- a/tests/test_fes_combo.py +++ b/tests/test_fes_combo.py @@ -1,3 +1,5 @@ +# coding=utf-8 + import logging import os import unittest @@ -12,7 +14,7 @@ logger = logging.getLogger('test_fes_combo') logger.setLevel(logging.INFO) -DATA_DIR = 'test_data' +DATA_DIR = os.path.join(os.path.dirname(__file__), 'test_data') FES_OUT_DIR = 'fes_out' FES_ALL_DIR = 'fes_all' FES_MULTI_DIR = 'multi' @@ -33,6 +35,7 @@ # Target writers # FES_ALL_MULTI_FILE = os.path.join(FES_OUT_BASE, FES_MULTI_DIR, DEF_TGT) + def header_lines(tgt_file): """ Extracts and returns a list of the header lines from the given file location. @@ -53,11 +56,13 @@ def header_lines(tgt_file): hlines.append(tline) return hlines + # Tests # class TestFesCombo(unittest.TestCase): """ Tests for the functions in fes_combo. """ + def test_single(self): test_dict = find_files_by_dir(FES_OUT_SINGLE, DEF_FILE_PAT) self.assertEqual(1, len(test_dict)) diff --git a/tests/test_wham.py b/tests/test_wham.py index 0242157..8b76c81 100644 --- a/tests/test_wham.py +++ b/tests/test_wham.py @@ -31,7 +31,7 @@ SUB_WHAM_BASE_TPL = os.path.join(TPL_LOC, DEF_BASE_SUBMIT_TPL) SUB_WHAM_LINE_TPL = os.path.join(TPL_LOC, DEF_LINE_SUBMIT_TPL) -DATA_DIR = os.path.join('test_data', 'wham_test_data') +DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), 'test_data', 'wham_test_data')) META_00_FNAME = 'meta.00' META_PATH = os.path.join(DATA_DIR, META_00_FNAME) SUBMIT_05_PATH = os.path.join(DATA_DIR, 'submit_wham_05.sh') diff --git a/tests/test_wham_rad.py b/tests/test_wham_rad.py index 09d174c..dcf424a 100644 --- a/tests/test_wham_rad.py +++ b/tests/test_wham_rad.py @@ -25,7 +25,7 @@ logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger('test_wham_rad') -DATA_DIR = 'test_data' +DATA_DIR = os.path.join(os.path.dirname(__file__), 'test_data') ORIG_WHAM_FNAME = "PMFlast2ns3_1.txt" ORIG_WHAM_PATH = os.path.join(DATA_DIR, ORIG_WHAM_FNAME)