From 73c97fa2838aa63514e7bed9d736132b3c98abf4 Mon Sep 17 00:00:00 2001 From: Timothy Click Date: Sat, 4 Jan 2020 15:36:58 -0600 Subject: [PATCH] Made flake8 compliant Signed-off-by: Timothy Click --- .flake8 | 2 +- .travis.yml | 2 + setup.py | 53 ++++++++++++----- src/fluctmatch/analysis/entropy.py | 7 ++- src/fluctmatch/analysis/fluctsca.py | 2 +- src/fluctmatch/analysis/thermodynamics.py | 2 +- src/fluctmatch/commands/cmd_convert.py | 60 +++++++++---------- src/fluctmatch/commands/cmd_diff.py | 60 +++++++++---------- src/fluctmatch/commands/cmd_entropy.py | 60 +++++++++---------- src/fluctmatch/commands/cmd_framediff.py | 60 +++++++++---------- src/fluctmatch/commands/cmd_normdiff.py | 60 +++++++++---------- src/fluctmatch/commands/cmd_run_fm.py | 61 +++++++++---------- src/fluctmatch/commands/cmd_splittraj.py | 60 +++++++++---------- src/fluctmatch/commands/cmd_stats.py | 60 +++++++++---------- src/fluctmatch/commands/cmd_table.py | 60 +++++++++---------- src/fluctmatch/commands/cmd_table_convert.py | 62 ++++++++++---------- src/fluctmatch/commands/cmd_thermo.py | 60 +++++++++---------- src/fluctmatch/commands/cmd_wordom.py | 60 +++++++++---------- src/fluctmatch/commands/cmd_write_charmm.py | 62 ++++++++++---------- src/fluctmatch/commands/cmd_write_rtf.py | 62 ++++++++++---------- src/fluctmatch/core/base.py | 3 +- src/fluctmatch/core/models/bioions.py | 1 - src/fluctmatch/core/models/calpha.py | 2 +- src/fluctmatch/core/models/enm.py | 2 +- src/fluctmatch/core/models/generic.py | 2 +- src/fluctmatch/core/models/nucleic6.py | 2 +- src/fluctmatch/core/models/polar.py | 5 +- src/fluctmatch/core/models/united.py | 2 +- src/fluctmatch/core/utils.py | 2 +- src/fluctmatch/decomposition/ica.py | 17 +++--- src/fluctmatch/decomposition/svd.py | 15 +++-- src/fluctmatch/fluctmatch/plugins/charmm.py | 3 +- src/fluctmatch/libs/fluctmatch.py | 5 +- src/fluctmatch/libs/intcor.py | 3 +- src/fluctmatch/parsers/parsers/PSF.py | 7 +-- src/fluctmatch/parsers/writers/RTF.py | 2 +- tests/__init__.py | 21 +++---- tests/datafiles.py | 21 +++---- tests/decomposition/__init__.py | 21 +++---- tests/decomposition/test_eigh.py | 21 +++---- tests/decomposition/test_svd.py | 21 +++---- tests/fluctmatch/__init__.py | 21 +++---- tests/fluctmatch/test_utils.py | 21 +++---- tests/libs/__init__.py | 21 +++---- tests/libs/test_intcor.py | 21 +++---- tests/models/test_atomselection.py | 1 + tests/models/test_enm.py | 1 + tests/models/test_generic.py | 1 + tests/models/test_ions.py | 1 + tests/models/test_nucleic.py | 1 + tests/models/test_protein.py | 1 + tests/models/test_solvent.py | 1 + tests/models/test_utils.py | 1 + tests/parsers/__init__.py | 21 +++---- tests/parsers/test_cor.py | 28 +++++---- tests/parsers/test_ic.py | 25 ++++---- tests/parsers/test_prm.py | 25 ++++---- tests/parsers/test_psf.py | 33 ++++++----- tests/parsers/test_rtf.py | 23 ++++---- tests/parsers/test_str.py | 23 ++++---- tests/test_fluctmatch.py | 21 +++---- tox.ini | 6 +- 62 files changed, 725 insertions(+), 665 deletions(-) diff --git a/.flake8 b/.flake8 index 2a8129f..a3c862a 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] ignore = E203, E266, E501, W503, F403, F401 -max-line-length = 88 +max-line-length = 82 max-complexity = 18 select = B,C,E,F,W,T4,B9 diff --git a/.travis.yml b/.travis.yml index 2b0f57e..e0b1028 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: python python: - "3.6" - "3.7" + - "3.8" sudo: false cache: pip env: @@ -17,6 +18,7 @@ branches: only: - master - develop + - start_4.0.0 before_install: - python --version - uname -a diff --git a/setup.py b/setup.py index aa1dbde..c9ff2a0 100644 --- a/setup.py +++ b/setup.py @@ -1,18 +1,42 @@ -#!/usr/bin/env python +# ------------------------------------------------------------------------------ +# python-fluctmatch +# Copyright (c) 2013-2020 Timothy H. Click, Ph.D. # -# fluctmatch --- https://github.com/tclick/python-fluctmatch -# Copyright (c) 2013-2017 The fluctmatch Development Team and contributors -# (see the file AUTHORS for the full list of names) +# All rights reserved. # -# Released under the New BSD license. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: # -# Please cite your use of fluctmatch in published work: +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. # -# Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. -# Calculation of Enzyme Fluctuograms from All-Atom Molecular Dynamics -# Simulation. Meth Enzymology. 578 (2016), 327-342, -# doi:10.1016/bs.mie.2016.05.024. +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. # +# Neither the name of the author nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific +# prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. +# +# Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. +# Simulation. Meth Enzymology. 578 (2016), 327-342, +# Calculation of Enzyme Fluctuograms from All-Atom Molecular Dynamics +# doi:10.1016/bs.mie.2016.05.024. +# +# ------------------------------------------------------------------------------ + import re import sys from glob import glob @@ -24,8 +48,8 @@ from setuptools import setup # NOTE: keep in sync with DNApersist.__version__ in version.py -RELEASE = "4.0.0-dev" -is_release = "dev" not in RELEASE +RELEASE: str = "4.0.0-dev" +is_release: str = "dev" not in RELEASE # Make sure I have the right Python version. major, minor = sys.version_info[:2] @@ -48,7 +72,7 @@ def read(*names, **kwargs): if __name__ == "__main__": setup( name="fluctmatch", - version="3.4.1", + version="4.0.0", license="BSD license", description="Elastic network model using fluctuation matching.", long_description="%s\n%s" @@ -61,7 +85,7 @@ def read(*names, **kwargs): read("CHANGELOG.rst")), ), author="Timothy Click", - author_email="tclick@nctu.edu.tw", + author_email="tclick@tabor.edu", url="https://www.github.com/tclick/python-fluctmatch", packages=find_packages("src"), package_dir={"": "src"}, @@ -85,6 +109,7 @@ def read(*names, **kwargs): install_requires=[ "click", "MDAnalysis", + "matplotlib", "numpy", "pandas", "scipy", diff --git a/src/fluctmatch/analysis/entropy.py b/src/fluctmatch/analysis/entropy.py index c2e5716..f8bd741 100644 --- a/src/fluctmatch/analysis/entropy.py +++ b/src/fluctmatch/analysis/entropy.py @@ -37,10 +37,11 @@ # # ------------------------------------------------------------------------------ +from typing import List + import numpy as np import pandas as pd from scipy import stats -from typing import List from fluctmatch.analysis.paramtable import ParamTable @@ -125,8 +126,8 @@ def windiff_entropy(self, bins: int = 100) -> pd.DataFrame: determined by the highest probability of nonzero force constants within the overall time series. - The required table must be a time series of an internal coordinates table - containing bond force constants. + The required table must be a time series of an internal coordinates + table containing bond force constants. Parameters ---------- diff --git a/src/fluctmatch/analysis/fluctsca.py b/src/fluctmatch/analysis/fluctsca.py index 9b340a0..77b1428 100644 --- a/src/fluctmatch/analysis/fluctsca.py +++ b/src/fluctmatch/analysis/fluctsca.py @@ -238,7 +238,7 @@ def figUnits(v1, v2, v3, units, filename, fig_path=Path.cwd(), marker='o', in the background. :Example: - >>> figUnits(v1, v2, units, marker='o', gradcol=0, dotsize=9, notinunits=1) + >>> figUnits(v1, v2, units, marker='o', gradcol=0, dotsize=9, notinunits=1) ''' import colorsys diff --git a/src/fluctmatch/analysis/thermodynamics.py b/src/fluctmatch/analysis/thermodynamics.py index 8b0f0ec..d89caab 100644 --- a/src/fluctmatch/analysis/thermodynamics.py +++ b/src/fluctmatch/analysis/thermodynamics.py @@ -43,8 +43,8 @@ import multiprocessing as mp from os import path from pathlib import Path -from typing import Union from typing import Tuple +from typing import Union import numpy as np import pandas as pd diff --git a/src/fluctmatch/commands/cmd_convert.py b/src/fluctmatch/commands/cmd_convert.py index b103144..c17e211 100644 --- a/src/fluctmatch/commands/cmd_convert.py +++ b/src/fluctmatch/commands/cmd_convert.py @@ -179,36 +179,36 @@ def cli(topology, trajectory, logfile, outdir, prefix, rmin, rmax, model, charmm_version, com, extended, resid, cmap, cheq, nonbonded, mass, write_traj, model_list): logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_diff.py b/src/fluctmatch/commands/cmd_diff.py index 485c53d..473a631 100644 --- a/src/fluctmatch/commands/cmd_diff.py +++ b/src/fluctmatch/commands/cmd_diff.py @@ -82,36 +82,36 @@ ) def cli(logfile, outdir, ressep, table1, table2): logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_entropy.py b/src/fluctmatch/commands/cmd_entropy.py index d104357..872fa2a 100644 --- a/src/fluctmatch/commands/cmd_entropy.py +++ b/src/fluctmatch/commands/cmd_entropy.py @@ -83,36 +83,36 @@ def cli(logfile, outdir, ressep, table): # Setup logger logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_framediff.py b/src/fluctmatch/commands/cmd_framediff.py index ee38249..906d0c8 100644 --- a/src/fluctmatch/commands/cmd_framediff.py +++ b/src/fluctmatch/commands/cmd_framediff.py @@ -84,36 +84,36 @@ def cli(logfile, outdir, ressep, table): # Setup logger logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_normdiff.py b/src/fluctmatch/commands/cmd_normdiff.py index fe98f7d..a4cc4b5 100644 --- a/src/fluctmatch/commands/cmd_normdiff.py +++ b/src/fluctmatch/commands/cmd_normdiff.py @@ -92,36 +92,36 @@ def cli(logfile, outdir, ressep, kb, b0): # Setup logger logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_run_fm.py b/src/fluctmatch/commands/cmd_run_fm.py index 2bfbc16..acad10e 100644 --- a/src/fluctmatch/commands/cmd_run_fm.py +++ b/src/fluctmatch/commands/cmd_run_fm.py @@ -47,6 +47,7 @@ import click import fluctmatch.fluctmatch.plugins + from .. import iter_namespace @@ -188,36 +189,36 @@ def cli(topology, trajectory, logfile, outdir, nma_exec, temperature, max_cycles, min_cycles, tol, force_tol, prefix, charmm_version, extended, resid, nonbonded, restart): logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_splittraj.py b/src/fluctmatch/commands/cmd_splittraj.py index 71acd77..23bc54f 100644 --- a/src/fluctmatch/commands/cmd_splittraj.py +++ b/src/fluctmatch/commands/cmd_splittraj.py @@ -157,36 +157,36 @@ def cli(program, toppar, topology, trajectory, data, index, outfile, logfile, system, start, stop, window_size): logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": path.join(os.getcwd(), logfile), - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_stats.py b/src/fluctmatch/commands/cmd_stats.py index 0786556..26777ed 100644 --- a/src/fluctmatch/commands/cmd_stats.py +++ b/src/fluctmatch/commands/cmd_stats.py @@ -97,36 +97,36 @@ def cli(logfile, stats, hist, outdir, ressep, tbltype, table): # Setup logger logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_table.py b/src/fluctmatch/commands/cmd_table.py index 8c87478..8f3b92d 100644 --- a/src/fluctmatch/commands/cmd_table.py +++ b/src/fluctmatch/commands/cmd_table.py @@ -113,36 +113,36 @@ def cli(data_dir, logfile, outdir, prefix, tbltype, ressep, verbose): # Setup logger logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_table_convert.py b/src/fluctmatch/commands/cmd_table_convert.py index d196d0b..5fae525 100644 --- a/src/fluctmatch/commands/cmd_table_convert.py +++ b/src/fluctmatch/commands/cmd_table_convert.py @@ -41,8 +41,8 @@ import logging.config from pathlib import Path -import MDAnalysis as mda import click +import MDAnalysis as mda import pandas as pd @@ -98,36 +98,36 @@ def cli(logfile, top1, top2, table, outfile): # Setup logger logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": Path.cwd() / logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_thermo.py b/src/fluctmatch/commands/cmd_thermo.py index aa86175..4606e82 100644 --- a/src/fluctmatch/commands/cmd_thermo.py +++ b/src/fluctmatch/commands/cmd_thermo.py @@ -126,36 +126,36 @@ def cli(datadir, logfile, outdir, topology, trajectory, nma_exec, temperature, charmm_version): logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_wordom.py b/src/fluctmatch/commands/cmd_wordom.py index 3ca80e9..c7b3366 100644 --- a/src/fluctmatch/commands/cmd_wordom.py +++ b/src/fluctmatch/commands/cmd_wordom.py @@ -105,36 +105,36 @@ def cli(topology, trajectory, logfile, outfile, start, stop, step, verbose): # Setup logger logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_write_charmm.py b/src/fluctmatch/commands/cmd_write_charmm.py index a7ab05e..b9ed6a4 100644 --- a/src/fluctmatch/commands/cmd_write_charmm.py +++ b/src/fluctmatch/commands/cmd_write_charmm.py @@ -41,8 +41,8 @@ import logging.config from pathlib import Path -import MDAnalysis as mda import click +import MDAnalysis as mda from fluctmatch.libs import fluctmatch as fmutils @@ -124,36 +124,36 @@ def cli(topology, trajectory, logfile, outdir, prefix, charmm_version, extended, cmap, cheq, nonbonded, write_traj): logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/commands/cmd_write_rtf.py b/src/fluctmatch/commands/cmd_write_rtf.py index 7b6ed58..f05ce58 100644 --- a/src/fluctmatch/commands/cmd_write_rtf.py +++ b/src/fluctmatch/commands/cmd_write_rtf.py @@ -41,8 +41,8 @@ import logging.config from pathlib import Path -import MDAnalysis as mda import click +import MDAnalysis as mda @click.command("write_rtf", @@ -94,36 +94,36 @@ ) def cli(topology, trajectory, logfile, outfile, decl, mass): logging.config.dictConfig( - { - "version": 1, - "disable_existing_loggers": False, # this fixes the problem - "formatters": { - "standard": { - "class": "logging.Formatter", - "format": "%(name)-12s %(levelname)-8s %(message)s", - }, - "detailed": { - "class": "logging.Formatter", - "format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s", - "datefmt": "%m-%d-%y %H:%M", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "level": "INFO", - "formatter": "standard", - }, - "file": { - "class": "logging.FileHandler", - "filename": logfile, - "level": "INFO", - "mode": "w", - "formatter": "detailed", - }, - }, - "root": {"level": "INFO", "handlers": ["console", "file"]}, - } + dict(version=1, + disable_existing_loggers=False, # this fixes the problem + formatters=dict( + standard={ + "class": "logging.Formatter", + "format": "%(name)-12s %(levelname)-8s %(message)s", + }, + detailed={ + "class": "logging.Formatter", + "format": ("%(asctime)s %(name)-15s %(levelname)-8s " + "%(message)s"), + "datefmt": "%m-%d-%y %H:%M", + }, + ), + handlers=dict( + console={ + "class": "logging.StreamHandler", + "level": "INFO", + "formatter": "standard", + }, + file={ + "class": "logging.FileHandler", + "filename": logfile, + "level": "INFO", + "mode": "w", + "formatter": "detailed", + }, + ), + root=dict(level="INFO", handlers=["console", "file"]), + ) ) logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/core/base.py b/src/fluctmatch/core/base.py index 7cedb1a..7119f99 100644 --- a/src/fluctmatch/core/base.py +++ b/src/fluctmatch/core/base.py @@ -461,7 +461,8 @@ def Merge(*args: MDUniverse) -> mda.Universe: if trajectory.ts.has_positions: positions: np.ndarray = np.concatenate(positions, axis=1) if universe.atoms.n_atoms != positions.shape[1]: - msg = "The number of sites does not match the number of " "coordinates." + msg = ("The number of sites does not match the number " + "of coordinates.") logger.error(msg) raise RuntimeError(msg) n_frames, n_beads, _ = positions.shape diff --git a/src/fluctmatch/core/models/bioions.py b/src/fluctmatch/core/models/bioions.py index 285bd13..6768420 100644 --- a/src/fluctmatch/core/models/bioions.py +++ b/src/fluctmatch/core/models/bioions.py @@ -44,7 +44,6 @@ from typing import NoReturn import numpy as np - from MDAnalysis.core.topologyattrs import Atomtypes from MDAnalysis.core.topologyattrs import Bonds diff --git a/src/fluctmatch/core/models/calpha.py b/src/fluctmatch/core/models/calpha.py index 5a8f184..416222a 100644 --- a/src/fluctmatch/core/models/calpha.py +++ b/src/fluctmatch/core/models/calpha.py @@ -44,8 +44,8 @@ from typing import NoReturn from typing import Tuple -import numpy as np import MDAnalysis as mda +import numpy as np from MDAnalysis.core.topologyattrs import Bonds from ..base import ModelBase diff --git a/src/fluctmatch/core/models/enm.py b/src/fluctmatch/core/models/enm.py index ea49c24..0e7755a 100644 --- a/src/fluctmatch/core/models/enm.py +++ b/src/fluctmatch/core/models/enm.py @@ -43,8 +43,8 @@ from typing import NoReturn from typing import Tuple -import numpy as np import MDAnalysis as mda +import numpy as np from MDAnalysis.core.topologyattrs import Angles from MDAnalysis.core.topologyattrs import Atomtypes from MDAnalysis.core.topologyattrs import Bonds diff --git a/src/fluctmatch/core/models/generic.py b/src/fluctmatch/core/models/generic.py index c96ba70..21d80d8 100644 --- a/src/fluctmatch/core/models/generic.py +++ b/src/fluctmatch/core/models/generic.py @@ -43,8 +43,8 @@ from typing import NoReturn from typing import Tuple -import numpy as np import MDAnalysis as mda +import numpy as np from MDAnalysis.coordinates.memory import MemoryReader from MDAnalysis.core.topologyattrs import Bonds from MDAnalysis.topology import guessers diff --git a/src/fluctmatch/core/models/nucleic6.py b/src/fluctmatch/core/models/nucleic6.py index e70215e..b89fe05 100644 --- a/src/fluctmatch/core/models/nucleic6.py +++ b/src/fluctmatch/core/models/nucleic6.py @@ -44,8 +44,8 @@ from typing import NoReturn from typing import Tuple -import numpy as np import MDAnalysis as mda +import numpy as np from MDAnalysis.core.topologyattrs import Bonds from MDAnalysis.core.topologyattrs import Charges diff --git a/src/fluctmatch/core/models/polar.py b/src/fluctmatch/core/models/polar.py index 16ca5b9..e8bb9a6 100644 --- a/src/fluctmatch/core/models/polar.py +++ b/src/fluctmatch/core/models/polar.py @@ -36,13 +36,14 @@ # doi:10.1016/bs.mie.2016.05.024. # # ------------------------------------------------------------------------------ -"""Class definition for beads using N, carboxyl oxygens, and polar sidechains.""" +"""Class definition for beads using N, carboxyl oxygens, and polar sidechains. +""" from typing import ClassVar from typing import Mapping -from . import ncsc from ..selection import * +from . import ncsc class Model(ncsc.Model): diff --git a/src/fluctmatch/core/models/united.py b/src/fluctmatch/core/models/united.py index 8a253df..59739dc 100644 --- a/src/fluctmatch/core/models/united.py +++ b/src/fluctmatch/core/models/united.py @@ -42,8 +42,8 @@ import MDAnalysis as mda -from . import generic from ..selection import * +from . import generic class Model(generic.Model): diff --git a/src/fluctmatch/core/utils.py b/src/fluctmatch/core/utils.py index 63eeb50..fc5d451 100644 --- a/src/fluctmatch/core/utils.py +++ b/src/fluctmatch/core/utils.py @@ -43,9 +43,9 @@ import MDAnalysis as mda +from .. import _MODELS from .base import Merge from .base import ModelBase -from .. import _MODELS logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/decomposition/ica.py b/src/fluctmatch/decomposition/ica.py index b728a9e..6dad1dc 100644 --- a/src/fluctmatch/decomposition/ica.py +++ b/src/fluctmatch/decomposition/ica.py @@ -194,8 +194,7 @@ def _infomax(X, n_components: int = None, l_rate: float = None, else: # X must be casted to floats to avoid typing issues with numpy # 2.0 and the line below - X1: np.ndarray = as_float_array(X, - copy=False) # copy has been taken care of + X1: np.ndarray = as_float_array(X, copy=False) # check input parameters # heuristic default - may need adjustment for large or tiny data sets @@ -226,7 +225,7 @@ def _infomax(X, n_components: int = None, l_rate: float = None, wts_blowup: bool = False blockno: int = 0 signcount: int = 0 - initial_ext_blocks: int = ext_blocks # save the initial value in case of reset + initial_ext_blocks: int = ext_blocks # for extended Infomax if extended: @@ -385,8 +384,9 @@ def _infomax(X, n_components: int = None, l_rate: float = None, return weights.T -def random_permutation(n_samples: int, - random_state: Union[int, RandomState, None] = None) -> np.ndarray: +def random_permutation( + n_samples: int, + random_state: Union[int, RandomState, None] = None) -> np.ndarray: """Emulate the randperm matlab function. It returns a vector containing a random permutation of the @@ -637,10 +637,9 @@ def fit(self, data: np.ndarray) -> "ICA": self.components_: np.ndarray = ica.components_ self.mixing_: np.ndarray = ica.mixing_ elif self.method in ('infomax', 'extended-infomax'): - self.components_: np.ndarray = _infomax(data, - random_state=random_state, - whiten=self.whiten, - **self.fit_params)[:self.n_components] + self.components_: np.ndarray = _infomax( + data, random_state=random_state, whiten=self.whiten, + **self.fit_params)[:self.n_components] self.mixing_: np.ndarray = linalg.pinv(self.components_) return self diff --git a/src/fluctmatch/decomposition/svd.py b/src/fluctmatch/decomposition/svd.py index 04c2780..daa8365 100644 --- a/src/fluctmatch/decomposition/svd.py +++ b/src/fluctmatch/decomposition/svd.py @@ -338,14 +338,16 @@ def _fit_full(self, X: np.ndarray, # Compute noise covariance using Probabilistic PCA model # The sigma2 maximum likelihood (cf. eq. 12.46) if n_components < min(n_features, n_samples): - self.noise_variance_: float = explained_variance_[n_components:].mean() + self.noise_variance_: float = \ + explained_variance_[n_components:].mean() else: self.noise_variance_: float = 0. self.n_samples_, self.n_features_ = n_samples, n_features self.components_: int = components_[:n_components] self.n_components_: int = n_components - self.explained_variance_: np.ndarray = explained_variance_[:n_components] + self.explained_variance_: np.ndarray = \ + explained_variance_[:n_components] self.explained_variance_ratio_: np.ndarray = \ explained_variance_ratio_[:n_components] self.singular_values_: np.ndarray = singular_values_[:n_components] @@ -403,15 +405,18 @@ def _fit_truncated(self, X: np.ndarray, n_components: Union[int, str], # Compute noise covariance using Probabilistic PCA model # The sigma2 maximum likelihood (cf. eq. 12.46) if n_components < min(n_features, n_samples): - self.noise_variance_: float = explained_variance_[n_components:].mean() + self.noise_variance_: float = \ + explained_variance_[n_components:].mean() else: self.noise_variance_: float = 0. self.n_samples_, self.n_features_ = n_samples, n_features self.components_: np.ndarray = components_[:n_components] self.n_components_: int = n_components - self.explained_variance_: np.ndarray = explained_variance_[:n_components] - self.explained_variance_ratio_: np.ndarray = explained_variance_ratio_[:n_components] + self.explained_variance_: np.ndarray = \ + explained_variance_[:n_components] + self.explained_variance_ratio_: np.ndarray = \ + explained_variance_ratio_[:n_components] self.singular_values_: np.ndarray = singular_values_[:n_components] return U, S, V diff --git a/src/fluctmatch/fluctmatch/plugins/charmm.py b/src/fluctmatch/fluctmatch/plugins/charmm.py index b451c15..e574eb1 100644 --- a/src/fluctmatch/fluctmatch/plugins/charmm.py +++ b/src/fluctmatch/fluctmatch/plugins/charmm.py @@ -71,11 +71,12 @@ from MDAnalysis.coordinates.core import reader from scipy import constants +from ...libs import intcor +from ...libs import parameters from ..base import FluctMatchBase from ..data import charmm_init from ..data import charmm_nma from ..data import charmm_thermo -from ...libs import intcor, parameters logger: logging.Logger = logging.getLogger(__name__) diff --git a/src/fluctmatch/libs/fluctmatch.py b/src/fluctmatch/libs/fluctmatch.py index 2194f0e..6d21123 100644 --- a/src/fluctmatch/libs/fluctmatch.py +++ b/src/fluctmatch/libs/fluctmatch.py @@ -247,9 +247,8 @@ def write_charmm_files( # Calculate the average coordinates from the trajectory. logger.info("Determining the average structure of the trajectory. ") - logger.warning( - "Note: This could take a while depending upon the " "size of your trajectory." - ) + logger.warning("Note: This could take a while depending upon the size of " + "your trajectory.") positions = AverageStructure(universe.atoms).run().result positions = positions.reshape((*positions.shape, 1)) diff --git a/src/fluctmatch/libs/intcor.py b/src/fluctmatch/libs/intcor.py index 16e77d9..b58fed0 100644 --- a/src/fluctmatch/libs/intcor.py +++ b/src/fluctmatch/libs/intcor.py @@ -67,7 +67,8 @@ def create_empty_table(universe: Union[mda.Universe, mda.AtomGroup] Returns ------- A :class:`~pandas.DataFrame` compliant with a CHARMM-formatted internal - coordinates (IC) table. The table matches the 'resid' version of an IC table. + coordinates (IC) table. The table matches the 'resid' version of an IC + table. """ table: pd.DataFrame = pd.DataFrame() atomgroup: mda.AtomGroup = universe.atoms diff --git a/src/fluctmatch/parsers/parsers/PSF.py b/src/fluctmatch/parsers/parsers/PSF.py index 784bbfb..ad63660 100644 --- a/src/fluctmatch/parsers/parsers/PSF.py +++ b/src/fluctmatch/parsers/parsers/PSF.py @@ -104,7 +104,7 @@ def parse(self, **kwargs: Mapping) -> Topology: header: str = next(psffile) if not header.startswith("PSF"): err: str = ( - f"{self.filename} is not valid PSF file " f"(header = {header})" + f"{self.filename} is not valid PSF file (header = {header})" ) logger.error(err) raise ValueError(err) @@ -246,10 +246,7 @@ def _parseatoms( "PSF file... continuing with fingers " "crossed!" ) - logger.info( - "First NAMD-type line: {0}: {1}" "".format(i, - line.rstrip()) - ) + logger.info(f"First NAMD-type line: {i}: {line.rstrip()}") except ValueError: atom_parser: FORTRANReader = FORTRANReader( atom_parsers[self._format].replace("A6", "A4") diff --git a/src/fluctmatch/parsers/writers/RTF.py b/src/fluctmatch/parsers/writers/RTF.py index 99cffdd..b5fbd59 100755 --- a/src/fluctmatch/parsers/writers/RTF.py +++ b/src/fluctmatch/parsers/writers/RTF.py @@ -55,8 +55,8 @@ import MDAnalysis as mda import numpy as np import pandas as pd -from MDAnalysis.core.topologyobjects import TopologyObject from MDAnalysis.core import groups +from MDAnalysis.core.topologyobjects import TopologyObject from .. import base as topbase diff --git a/tests/__init__.py b/tests/__init__.py index bfaf27d..d5b46b9 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tests/datafiles.py b/tests/datafiles.py index d34c0dd..08402a1 100644 --- a/tests/datafiles.py +++ b/tests/datafiles.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tests/decomposition/__init__.py b/tests/decomposition/__init__.py index bfaf27d..d5b46b9 100644 --- a/tests/decomposition/__init__.py +++ b/tests/decomposition/__init__.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tests/decomposition/test_eigh.py b/tests/decomposition/test_eigh.py index 809817c..aeab7b4 100644 --- a/tests/decomposition/test_eigh.py +++ b/tests/decomposition/test_eigh.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tests/decomposition/test_svd.py b/tests/decomposition/test_svd.py index 75d5155..95bfd8d 100644 --- a/tests/decomposition/test_svd.py +++ b/tests/decomposition/test_svd.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tests/fluctmatch/__init__.py b/tests/fluctmatch/__init__.py index bfaf27d..d5b46b9 100644 --- a/tests/fluctmatch/__init__.py +++ b/tests/fluctmatch/__init__.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tests/fluctmatch/test_utils.py b/tests/fluctmatch/test_utils.py index cf867cd..a6e59c1 100644 --- a/tests/fluctmatch/test_utils.py +++ b/tests/fluctmatch/test_utils.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tests/libs/__init__.py b/tests/libs/__init__.py index bfaf27d..d5b46b9 100644 --- a/tests/libs/__init__.py +++ b/tests/libs/__init__.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tests/libs/test_intcor.py b/tests/libs/test_intcor.py index c118c62..53ce3a9 100644 --- a/tests/libs/test_intcor.py +++ b/tests/libs/test_intcor.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tests/models/test_atomselection.py b/tests/models/test_atomselection.py index 0621d43..b6f57bf 100644 --- a/tests/models/test_atomselection.py +++ b/tests/models/test_atomselection.py @@ -33,6 +33,7 @@ import MDAnalysis as mda import pytest from numpy import testing + from fluctmatch.core.selection import * from ..datafiles import GRO diff --git a/tests/models/test_enm.py b/tests/models/test_enm.py index d31a21e..cbf58f3 100644 --- a/tests/models/test_enm.py +++ b/tests/models/test_enm.py @@ -39,6 +39,7 @@ from numpy import testing from fluctmatch.core.models import enm + from ..datafiles import DCD from ..datafiles import PSF diff --git a/tests/models/test_generic.py b/tests/models/test_generic.py index 9dd80a3..26afe72 100644 --- a/tests/models/test_generic.py +++ b/tests/models/test_generic.py @@ -40,6 +40,7 @@ from numpy import testing from fluctmatch.core.models import generic + from ..datafiles import DMA diff --git a/tests/models/test_ions.py b/tests/models/test_ions.py index 54903cf..13501ce 100644 --- a/tests/models/test_ions.py +++ b/tests/models/test_ions.py @@ -44,6 +44,7 @@ from numpy import testing from fluctmatch.core.models import solventions + from ..datafiles import IONS diff --git a/tests/models/test_nucleic.py b/tests/models/test_nucleic.py index 2f668ab..a9e21b6 100644 --- a/tests/models/test_nucleic.py +++ b/tests/models/test_nucleic.py @@ -42,6 +42,7 @@ from fluctmatch.core.models import nucleic3 from fluctmatch.core.models import nucleic4 from fluctmatch.core.models import nucleic6 + from ..datafiles import TPR from ..datafiles import XTC diff --git a/tests/models/test_protein.py b/tests/models/test_protein.py index b1930b8..a618f50 100644 --- a/tests/models/test_protein.py +++ b/tests/models/test_protein.py @@ -45,6 +45,7 @@ from fluctmatch.core.models import caside from fluctmatch.core.models import ncsc from fluctmatch.core.models import polar + from ..datafiles import TPR from ..datafiles import XTC diff --git a/tests/models/test_solvent.py b/tests/models/test_solvent.py index 73f2751..7bfedc7 100644 --- a/tests/models/test_solvent.py +++ b/tests/models/test_solvent.py @@ -38,6 +38,7 @@ from fluctmatch.core.models import dma from fluctmatch.core.models import tip3p from fluctmatch.core.models import water + from ..datafiles import DMA from ..datafiles import TIP3P diff --git a/tests/models/test_utils.py b/tests/models/test_utils.py index f424454..89957cc 100644 --- a/tests/models/test_utils.py +++ b/tests/models/test_utils.py @@ -35,6 +35,7 @@ from fluctmatch.core import utils from fluctmatch.core.models import polar + from ..datafiles import TPR from ..datafiles import XTC diff --git a/tests/parsers/__init__.py b/tests/parsers/__init__.py index bfaf27d..d5b46b9 100644 --- a/tests/parsers/__init__.py +++ b/tests/parsers/__init__.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tests/parsers/test_cor.py b/tests/parsers/test_cor.py index 7e6b64c..a85a60d 100644 --- a/tests/parsers/test_cor.py +++ b/tests/parsers/test_cor.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, @@ -47,6 +48,7 @@ from numpy.testing import assert_equal import fluctmatch.parsers.writers.COR + from ..datafiles import COR @@ -59,7 +61,7 @@ def u(self) -> mda.Universe: def test_writer(self, u: mda.Universe, tmp_path: Path): filename: Path = tmp_path / "temp.cor" with patch("fluctmatch.parsers.writers.COR.Writer.write") as writer, \ - mda.Writer(filename, n_atoms=u.atoms.n_atoms) as w: + mda.Writer(filename, n_atoms=u.atoms.n_atoms) as w: w.write(u.atoms) writer.assert_called() @@ -108,7 +110,7 @@ def test_warns(self, missing_attr: OrderedDict, tmp_path: Path): outfile: Path = tmp_path / "out.cor" with pytest.warns(UserWarning), \ - mda.Writer(outfile, n_atoms=u.atoms.n_atoms) as w: + mda.Writer(outfile, n_atoms=u.atoms.n_atoms) as w: w.write(u.atoms) @pytest.mark.parametrize('missing_attr', req_attrs) @@ -119,7 +121,7 @@ def test_write(self, missing_attr: OrderedDict, tmp_path: Path): outfile: Path = tmp_path / "out.cor" with pytest.warns(UserWarning), \ - mda.Writer(outfile, n_atoms=u.atoms.n_atoms) as w: + mda.Writer(outfile, n_atoms=u.atoms.n_atoms) as w: w.write(u.atoms) u2 = mda.Universe(outfile) diff --git a/tests/parsers/test_ic.py b/tests/parsers/test_ic.py index da44d31..9a230db 100644 --- a/tests/parsers/test_ic.py +++ b/tests/parsers/test_ic.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, @@ -43,10 +44,10 @@ import pandas as pd import pytest from numpy.testing import assert_allclose +from tests.datafiles import IC import fluctmatch.parsers.readers.IC as IntCor import fluctmatch.parsers.writers.IC -from tests.datafiles import IC class TestICReader: @@ -71,7 +72,7 @@ def u(self) -> pd.DataFrame: def test_writer(self, u: pd.DataFrame, tmp_path: Path): filename: Path = tmp_path / "temp.ic" with patch("fluctmatch.parsers.writers.IC.Writer.write") as icw, \ - mda.Writer(filename) as ofile: + mda.Writer(filename) as ofile: ofile.write(u) icw.assert_called() diff --git a/tests/parsers/test_prm.py b/tests/parsers/test_prm.py index 6fc3478..47c1c83 100644 --- a/tests/parsers/test_prm.py +++ b/tests/parsers/test_prm.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, @@ -46,10 +47,10 @@ import pandas as pd import pytest from numpy.testing import assert_allclose +from tests.datafiles import PRM import fluctmatch.parsers.readers.PRM as ParamReader import fluctmatch.parsers.writers.PRM -from tests.datafiles import PRM class TestPRMWriter(object): @@ -60,7 +61,7 @@ def u(self) -> Dict[str, pd.DataFrame]: def test_writer(self, u: pd.DataFrame, tmp_path: Path): filename: Path = tmp_path / "temp.prm" with patch("fluctmatch.parsers.writers.PRM.Writer.write") as writer, \ - mda.Writer(filename, nonbonded=True) as ofile: + mda.Writer(filename, nonbonded=True) as ofile: ofile.write(u) writer.assert_called() diff --git a/tests/parsers/test_psf.py b/tests/parsers/test_psf.py index caaedd7..8208ebf 100644 --- a/tests/parsers/test_psf.py +++ b/tests/parsers/test_psf.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, @@ -42,13 +43,13 @@ from unittest.mock import patch import MDAnalysis as mda +import pytest from MDAnalysis.core.topologyobjects import TopologyObject from MDAnalysisTests.topology.base import ParserBase +from numpy.testing import assert_equal import fluctmatch.parsers.parsers.PSF as PSFParser import fluctmatch.parsers.writers.PSF -import pytest -from numpy.testing import assert_equal from ..datafiles import COR from ..datafiles import PSF @@ -62,14 +63,14 @@ def u(self) -> mda.Universe: def test_writer(self, u: mda.Universe, tmp_path: Path): filename: Path = tmp_path / "temp.xplor.psf" with patch("fluctmatch.parsers.writers.PSF.Writer.write") as writer, \ - mda.Writer(filename) as w: + mda.Writer(filename) as w: w.write(u.atoms) writer.assert_called() def test_roundtrip(self, u: mda.Universe, tmp_path: Path): - # Write out a copy of the Universe, and compare this against the original - # This is more rigorous than simply checking the coordinates as it checks - # all formatting + # Write out a copy of the Universe, and compare this against the + # original. This is more rigorous than simply checking the coordinates + # as it checks all formatting filename: Path = tmp_path / "temp.xplor.psf" with mda.Writer(filename) as w: w.write(u.atoms) diff --git a/tests/parsers/test_rtf.py b/tests/parsers/test_rtf.py index 57aed7b..81f4f3e 100644 --- a/tests/parsers/test_rtf.py +++ b/tests/parsers/test_rtf.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, @@ -58,7 +59,7 @@ def u(self) -> mda.Universe: def test_writer(self, u: mda.Universe, tmp_path: Path): filename: Path = tmp_path / "temp.rtf" with patch("fluctmatch.parsers.writers.RTF.Writer.write") as writer, \ - mda.Writer(filename, n_atoms=u.atoms.n_atoms) as w: + mda.Writer(filename, n_atoms=u.atoms.n_atoms) as w: w.write(u.atoms) writer.assert_called() diff --git a/tests/parsers/test_str.py b/tests/parsers/test_str.py index 9ac94d7..9c3d790 100644 --- a/tests/parsers/test_str.py +++ b/tests/parsers/test_str.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, @@ -58,7 +59,7 @@ def u(self) -> mda.Universe: def test_writer(self, u: mda.Universe, tmp_path: Path): filename: Path = tmp_path / "temp.stream" with patch("fluctmatch.parsers.writers.STR.Writer.write") as writer, \ - mda.Writer(filename, n_atoms=u.atoms.n_atoms) as w: + mda.Writer(filename, n_atoms=u.atoms.n_atoms) as w: w.write(u.atoms) writer.assert_called() diff --git a/tests/test_fluctmatch.py b/tests/test_fluctmatch.py index bbc9676..d306733 100644 --- a/tests/test_fluctmatch.py +++ b/tests/test_fluctmatch.py @@ -18,16 +18,17 @@ # to endorse or promote products derived from this software without specific # prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. # # Timothy H. Click, Nixon Raj, and Jhih-Wei Chu. # Simulation. Meth Enzymology. 578 (2016), 327-342, diff --git a/tox.ini b/tox.ini index 1c68725..233ee99 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ envlist = clean, check, - py{36,37} + py{36,37,38} report, docs @@ -12,6 +12,7 @@ envlist = basepython = py36: {env:TOXPYTHON:python3.6} py37: {env:TOXPYTHON:python3.7} + py38: {env:TOXPYTHON:python3.8} {bootstrap,check,report,coveralls,codecov,clean,docs}: {env:TOXPYTHON:python3} setenv = PYTHONPATH={toxinidir}/tests @@ -89,9 +90,10 @@ deps = coverage click MDAnalysis - pandas + matplotlib numpy scipy + pandas skip_install = true commands = coverage run -p src/fluctmatch/cli.py