Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pylint #55

Merged
merged 18 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ permissions:
jobs:
ubuntu:
runs-on: ubuntu-latest
env:
FI_PROVIDER: "^psm3,psm3;ofi_rxd"
OMPI_MCA_mtl_ofi_provider_exclude: psm3
steps:
- name: Setup EESSI
uses: eessi/github-action-eessi@v3
Expand All @@ -20,16 +23,17 @@ jobs:
- name: Install dependencies
run: |
module load ESPResSo/4.2.1-foss-2023a
python3 -m venv --system-site-packages pymbe
source pymbe/bin/activate
python3 -m venv --system-site-packages venv
source venv/bin/activate
python3 maintainer/configure_venv.py
python3 -m pip install -r requirements.txt
python3 -m pip install "pdoc==14.3"
python3 -m pip install "pdoc==14.3" "pylint==3.0.3"
deactivate
- name: Run testsuite
run: |
module load ESPResSo/4.2.1-foss-2023a
source pymbe/bin/activate
source venv/bin/activate
make pylint
make tests
make docs
deactivate
Expand Down
45 changes: 45 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[MESSAGES CONTROL]

# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
confidence=

# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once). You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=all

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable=dangerous-default-value, # W0102
duplicate-key, # W0109
eval-used, # W0123
assert-on-tuple, # W0199
bad-indentation, # W0311
wildcard-import, # W0401
unused-import, # W0611
unused-variable, # W0612
unused-argument, # W0613
unused-wildcard-import, # W0614
f-string-without-interpolation, # W1309
anomalous-backslash-in-string, # W1401
deprecated-method, # W1505
comparison-with-itself, # R0124
cyclic-import, # R0401
trailing-comma-tuple, # R1707
consider-using-in, # R1714
consider-using-sys-exit, # R1722
singleton-comparison, # C0121
unidiomatic-typecheck, # C0123
bad-classmethod-argument, # C0202
superfluous-parens, # C0325
undefined-variable, # E0602
no-value-for-parameter, # E1120
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ tests:
python3 testsuite/gcmc_tests.py
python3 testsuite/weak_polyelectrolyte_dialysis_test.py
python3 testsuite/globular_protein_tests.py

sample:
python3 sample_scripts/peptide_simulation_example.py
python3 samples/peptide.py

visual:
python3 handy_scripts/vmd-traj.py
jngrad marked this conversation as resolved.
Show resolved Hide resolved
python3 visualization/vmd-traj.py
vmd -e visualization.tcl

tutorial:
jupyter-lab tutorials/pyMBE_tutorial.ipynb

pylint:
pylint pyMBE.py lib/ testsuite/ samples/ maintainer/ visualization/
4 changes: 2 additions & 2 deletions lib/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ def get_dt(data):
warn_lines = []
for i in range(1,imax):
dt = time[i] - time[i-1]
if(np.abs((dt_init - dt)/dt) > 0.01 ):
if np.abs((dt_init - dt)/dt) > 0.01:
warn_lines.append("Row {} dt = {} = {} - {} not equal to dt_init = {}")
if(len(warn_lines) > 20):
if len(warn_lines) > 20:
print("\n")
for line in warn_lines:
print(line)
Expand Down
Loading