Skip to content

Commit

Permalink
Made flake8 compliant
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Click <tclick@alumni.ou.edu>
  • Loading branch information
Timothy Click authored and tclick committed Jan 4, 2020
1 parent 2651e6f commit 73c97fa
Show file tree
Hide file tree
Showing 62 changed files with 725 additions and 665 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: python
python:
- "3.6"
- "3.7"
- "3.8"
sudo: false
cache: pip
env:
Expand All @@ -17,6 +18,7 @@ branches:
only:
- master
- develop
- start_4.0.0
before_install:
- python --version
- uname -a
Expand Down
53 changes: 39 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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]
Expand All @@ -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"
Expand All @@ -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"},
Expand All @@ -85,6 +109,7 @@ def read(*names, **kwargs):
install_requires=[
"click",
"MDAnalysis",
"matplotlib",
"numpy",
"pandas",
"scipy",
Expand Down
7 changes: 4 additions & 3 deletions src/fluctmatch/analysis/entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
----------
Expand Down
2 changes: 1 addition & 1 deletion src/fluctmatch/analysis/fluctsca.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/fluctmatch/analysis/thermodynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
60 changes: 30 additions & 30 deletions src/fluctmatch/commands/cmd_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down
60 changes: 30 additions & 30 deletions src/fluctmatch/commands/cmd_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down
60 changes: 30 additions & 30 deletions src/fluctmatch/commands/cmd_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down

0 comments on commit 73c97fa

Please sign in to comment.