Skip to content

Commit 6da05e2

Browse files
Fix ruff 0.16.0 errors (#42)
1 parent d77bf10 commit 6da05e2

18 files changed

Lines changed: 61 additions & 55 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ about: Create a report to help us improve
1919
import mdadash
2020

2121
...
22-
2322
```
2423

2524
## Current environment

docs/source/_static/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ so a file named "default.css" will overwrite the builtin "default.css".
88
The path to this folder is set in the Sphinx `conf.py` file in the line:
99

1010
```python
11-
html_static_path = ['_static']
11+
html_static_path = ["_static"]
1212
```
1313

1414
## Examples of file to add to this directory

docs/source/_templates/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ so a file named "page.html" will overwrite the builtin "page.html".
88
The path to this folder is set in the Sphinx `conf.py` file in the line:
99

1010
```python
11-
templates_path = ['_templates']
11+
templates_path = ["_templates"]
1212
```
1313

1414
## Examples of file to add to this directory

docs/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# Configuration file for the Sphinx documentation builder.
43
#

mdadash/backend/analyses/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
from . import acf, com_distance, dssp, energies, janin, msd, ramachandran, rog
66

77
__all__ = [
8-
"energies",
8+
"acf",
99
"com_distance",
10-
"rog",
1110
"dssp",
12-
"ramachandran",
11+
"energies",
1312
"janin",
1413
"msd",
15-
"acf",
14+
"ramachandran",
15+
"rog",
1616
]

mdadash/backend/analyses/acf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
from typing import ClassVar
23

34
import matplotlib.pyplot as plt
45
import MDAnalysis as mda
@@ -25,7 +26,7 @@ class ACFAnalysis(WidgetBase):
2526
"Universe Configuration section in the Settings page."
2627
)
2728

28-
_inputs = [
29+
_inputs: ClassVar = [
2930
{
3031
"attribute": "_run_mode",
3132
"name": "Run mode",

mdadash/backend/analyses/com_distance.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import logging
66
from collections import deque
7+
from typing import ClassVar
78

89
import matplotlib.pyplot as plt
910
from IPython.display import display
@@ -25,7 +26,7 @@ class COMDistance(WidgetBase):
2526
name = "COMDistance"
2627
description = "Distance between two COMs"
2728

28-
_inputs = [
29+
_inputs: ClassVar = [
2930
{
3031
"attribute": "selection1",
3132
"name": "Selection 1",
@@ -171,10 +172,7 @@ def on_input_change(self, attribute, _old_value, new_value):
171172
self._set_x_values()
172173
elif attribute == "custom_title":
173174
self._set_title()
174-
elif attribute == "selection1":
175-
self._update_selections()
176-
reset_plot = True
177-
elif attribute == "selection2":
175+
elif attribute in ("selection1", "selection2"):
178176
self._update_selections()
179177
reset_plot = True
180178
elif attribute in ("periodic", "updating"):

mdadash/backend/analyses/dssp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
from collections import deque
3+
from typing import ClassVar
34

45
import matplotlib.pyplot as plt
56
import numpy as np
@@ -18,7 +19,7 @@ class DSSPAnalysis(WidgetBase):
1819
name = "DSSP Analysis"
1920
description = "Secondary structure assignment of protein"
2021

21-
_inputs = [
22+
_inputs: ClassVar = [
2223
{
2324
"attribute": "_run_frequency",
2425
"name": "Run frequency",

mdadash/backend/analyses/energies.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import logging
66
from collections import deque
7+
from typing import ClassVar
78

89
import matplotlib.pyplot as plt
910
from IPython.display import display
@@ -20,7 +21,7 @@ class EnergyWidgetBase:
2021
data_key = ""
2122
y_label = "Energy ( kJ / mol )"
2223

23-
_inputs = [
24+
_inputs: ClassVar = [
2425
{
2526
"attribute": "maxlen",
2627
"name": "Max values",
@@ -101,7 +102,7 @@ def on_input_change(self, attribute, _old_value, new_value):
101102

102103
def run_every_frame(self):
103104
"""every-frame run handler"""
104-
ts = getattr(self, "u").trajectory.ts
105+
ts = self.u.trajectory.ts # pylint: disable=no-member
105106
if self.data_key not in ts.data:
106107
return # pragma: no cover
107108
self.steps.append(ts.data["step"])

mdadash/backend/analyses/janin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import logging
6+
from typing import ClassVar
67

78
import matplotlib.pyplot as plt
89
from IPython.display import display
@@ -23,7 +24,7 @@ class JaninPlot(WidgetBase):
2324
name = "Janin Plot"
2425
description = "Dihedral angles analysis using Janin plot"
2526

26-
_inputs = [
27+
_inputs: ClassVar = [
2728
{
2829
"attribute": "selection",
2930
"name": "Selection",

0 commit comments

Comments
 (0)