Skip to content

Commit b00f004

Browse files
Merge pull request #66 from wolberlab/update-python-support
Support Python 3.12 only
2 parents 8a64fd7 + 52b57b8 commit b00f004

File tree

11 files changed

+45
-54
lines changed

11 files changed

+45
-54
lines changed

.github/workflows/CI.yaml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,11 @@ jobs:
2626
matrix:
2727
cfg:
2828
- os: ubuntu-latest
29-
python-version: "3.8"
30-
- os: ubuntu-latest
31-
python-version: "3.9"
32-
- os: ubuntu-latest
33-
python-version: "3.10"
29+
python-version: "3.12"
3430
- os: macos-latest
35-
python-version: "3.8"
31+
python-version: "3.12"
3632
- os: windows-latest
37-
python-version: "3.8"
33+
python-version: "3.12"
3834

3935
steps:
4036
- uses: actions/checkout@v3
@@ -86,7 +82,7 @@ jobs:
8682
strategy:
8783
matrix:
8884
os: [ubuntu-latest]
89-
python-version: [3.8]
85+
python-version: [3.12]
9086

9187
steps:
9288
- uses: actions/checkout@v3
@@ -115,25 +111,13 @@ jobs:
115111
run: |
116112
flake8 --config setup.cfg dynophores
117113
118-
- name: Run black-nb check
119-
shell: bash -l {0}
120-
run: |
121-
black-nb --check -l 99 docs/tutorials/*.ipynb
122-
black-nb --check -l 99 dynophores/notebooks/*.ipynb
123-
124-
- name: Run flake8-nb
125-
shell: bash -l {0}
126-
run: |
127-
flake8-nb --config setup.cfg docs/tutorials/*.ipynb
128-
flake8-nb --config setup.cfg dynophores/notebooks/*.ipynb
129-
130114
docs:
131115
name: Docs test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
132116
runs-on: ${{ matrix.os }}
133117
strategy:
134118
matrix:
135119
os: [ubuntu-latest]
136-
python-version: [3.8]
120+
python-version: [3.12]
137121

138122
steps:
139123
- uses: actions/checkout@v3

devtools/conda-envs/test_env.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- defaults
55
dependencies:
66
# Base depends
7-
- python>=3.8
7+
- python>=3.12
88
- pip
99
- numpy
1010
- pandas
@@ -32,6 +32,3 @@ dependencies:
3232
# Developement
3333
- black
3434
- flake8
35-
- pip:
36-
- black-nb
37-
- flake8-nb

dynophores/cli.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _greet():
102102
with open(logo_path, "r", encoding="ascii") as f:
103103
print(f.read())
104104
title_str = f"Dynophores CLI {_version.get_versions()['version']}"
105-
print(f"\n{title_str:^64}")
105+
print(f"\n{title_str: ^64}")
106106

107107

108108
def _create_viz(args):
@@ -114,16 +114,16 @@ def _create_viz(args):
114114

115115
dyno_path = Path(args.dyno)
116116
if not dyno_path.is_dir():
117-
raise RuntimeError(f"Input is no file or file does not exist: `{dyno_path.absolute()}`")
117+
raise RuntimeError(f"Input is no file or file does not exist: {dyno_path.absolute()}")
118118

119119
pdb_path = Path(args.pdb)
120120
if not pdb_path.is_file():
121-
raise RuntimeError(f"Input is no file or file does not exist: `{pdb_path.absolute()}`")
121+
raise RuntimeError(f"Input is no file or file does not exist: {pdb_path.absolute()}")
122122

123123
if args.dcd is not None:
124124
dcd_path = Path(args.dcd)
125125
if not dcd_path.is_file():
126-
raise RuntimeError(f"Input is no file or file does not exist: `{dcd_path.absolute()}`")
126+
raise RuntimeError(f"Input is no file or file does not exist: {dcd_path.absolute()}")
127127
else:
128128
dcd_path = None
129129

@@ -168,8 +168,8 @@ def _copy_notebook(new_notebook_path):
168168
new_notebook_path = Path(new_notebook_path)
169169
if new_notebook_path.suffix != ".ipynb":
170170
raise RuntimeError(
171-
f"Input file path must have suffix `.ipynb`. "
172-
f"Your input: `{new_notebook_path.absolute()}`"
171+
f"Input file path must have suffix .ipynb. "
172+
f"Your input: {new_notebook_path.absolute()}"
173173
)
174174
if not new_notebook_path.exists():
175175
new_notebook_path.parent.mkdir(parents=True, exist_ok=True)
@@ -179,16 +179,16 @@ def _copy_notebook(new_notebook_path):
179179
print("\nCopy dynophore notebook to user workspace...")
180180
copyfile(template_notebook_path, new_notebook_path)
181181
if new_notebook_path.exists():
182-
print(f"Dynophore notebook location: `{new_notebook_path.absolute()}`")
182+
print(f"Dynophore notebook location: {new_notebook_path.absolute()}")
183183
else:
184184
raise RuntimeError(
185185
f"Could not create dynophore notebook at selected location "
186-
f"`{new_notebook_path.absolute()}`"
186+
f"{new_notebook_path.absolute()}"
187187
)
188188
else:
189189
raise RuntimeError(
190190
f"Could not find dynophore notebook at expected location "
191-
f"`{template_notebook_path.absolute()}`."
191+
f"{template_notebook_path.absolute()}."
192192
)
193193

194194

@@ -200,20 +200,20 @@ def _update_paths_in_notebook(notebook_path, dyno_path, pdb_path, dcd_path=None)
200200

201201
notebook_path = Path(notebook_path)
202202
if not notebook_path.is_file():
203-
raise RuntimeError(f"Input is no file or does not exist: `{notebook_path.absolute()}`")
203+
raise RuntimeError(f"Input is no file or does not exist: {notebook_path.absolute()}")
204204

205205
dyno_path = Path(dyno_path)
206206
if not dyno_path.is_dir():
207-
raise RuntimeError(f"Input is no file or file does not exist: `{dyno_path.absolute()}`")
207+
raise RuntimeError(f"Input is no file or file does not exist: {dyno_path.absolute()}")
208208

209209
pdb_path = Path(pdb_path)
210210
if not pdb_path.is_file():
211-
raise RuntimeError(f"Input is no file or file does not exist: `{pdb_path.absolute()}`")
211+
raise RuntimeError(f"Input is no file or file does not exist: {pdb_path.absolute()}")
212212

213213
if dcd_path is not None:
214214
dcd_path = Path(dcd_path)
215215
if not dcd_path.is_file():
216-
raise RuntimeError(f"Input is no file or file does not exist: `{dcd_path.absolute()}`")
216+
raise RuntimeError(f"Input is no file or file does not exist: {dcd_path.absolute()}")
217217

218218
# Replace template filepaths in notebook with user-defined filepaths
219219
print("\nUpdate filepaths in notebook to user filepaths...")
@@ -260,12 +260,12 @@ def _open_notebook(notebook_path):
260260
notebook_path = Path(notebook_path)
261261

262262
if not notebook_path.exists():
263-
raise RuntimeError(f"Input path does not exist: `{notebook_path.absolute()}`")
263+
raise RuntimeError(f"Input path does not exist: {notebook_path.absolute()}")
264264
if not notebook_path.is_file():
265-
raise RuntimeError(f"Input path is not a file: `{notebook_path.absolute()}`")
265+
raise RuntimeError(f"Input path is not a file: {notebook_path.absolute()}")
266266
if notebook_path.suffix != ".ipynb":
267267
raise RuntimeError(
268-
f"Input file path must have suffix `.ipynb`. Your input: `{notebook_path.absolute()}`"
268+
f"Input file path must have suffix .ipynb. Your input: {notebook_path.absolute()}"
269269
)
270270

271271
print("Open dynophore notebook with Jupyter Lab...")

dynophores/core/chemicalfeaturecloud3d.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ class ChemicalFeatureCloud3D:
2222
def __init__(self, center, points, **kwargs):
2323
self.center = center
2424
self.points = [
25-
point
26-
if isinstance(point, ChemicalFeatureCloud3DPoint)
27-
else ChemicalFeatureCloud3DPoint(**point)
25+
(
26+
point
27+
if isinstance(point, ChemicalFeatureCloud3DPoint)
28+
else ChemicalFeatureCloud3DPoint(**point)
29+
)
2830
for point in points
2931
]
3032

dynophores/core/dynophore.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ def __init__(
4040
self.id = id
4141
self.ligand = ligand if isinstance(ligand, Ligand) else Ligand(**ligand)
4242
self.superfeatures = {
43-
superfeature_id: superfeature
44-
if isinstance(superfeature, SuperFeature)
45-
else SuperFeature(**superfeature)
43+
superfeature_id: (
44+
superfeature
45+
if isinstance(superfeature, SuperFeature)
46+
else SuperFeature(**superfeature)
47+
)
4648
for superfeature_id, superfeature in superfeatures.items()
4749
}
4850

dynophores/core/superfeature.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ def __init__(self, id, feature_type, atom_numbers, occurrences, envpartners, col
3939
self.atom_numbers = atom_numbers
4040
self.occurrences = occurrences
4141
self.envpartners = {
42-
envpartner_id: envpartner
43-
if isinstance(envpartner, EnvPartner)
44-
else EnvPartner(**envpartner)
42+
envpartner_id: (
43+
envpartner if isinstance(envpartner, EnvPartner) else EnvPartner(**envpartner)
44+
)
4545
for envpartner_id, envpartner in envpartners.items()
4646
}
4747
self.color = color

dynophores/tests/core/test_ligand.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Uses fixture tests.conftest.envpartner.
55
"""
66

7-
87
from pathlib import Path
98

109
from dynophores import parsers

dynophores/viz/plot/static.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
from matplotlib import ticker
1111
import seaborn as sns
1212

13-
plt.style.use("seaborn")
13+
try:
14+
plt.style.use("seaborn")
15+
except OSError:
16+
# Needed for matplotlib>=3.8.0
17+
plt.style.use("seaborn-v0_8")
1418

1519

1620
def superfeatures_vs_envpartners(dynophore, superfeature_ids="all", annotate_heatmap=False):

dynophores/viz/view2d/static.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Contains RDKit ligand 2D visualizations (static).
33
"""
4+
45
from collections import defaultdict
56

67
from rdkit import Geometry

dynophores/viz/view3d/interactive.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Contains NGLview 3D visualizations.
33
"""
44

5+
# flake8: noqa
6+
57
import warnings
68

79
import numpy as np

0 commit comments

Comments
 (0)