Skip to content

Commit

Permalink
style: fix linting errors
Browse files Browse the repository at this point in the history
I double checked that the dicts are identical to what they were before this change
  • Loading branch information
DaniBodor committed Jul 9, 2024
1 parent 7842250 commit 5c3a192
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
5 changes: 1 addition & 4 deletions deeprank2/tools/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@ def add_target( # noqa: C901
1ATN_xxx-3 0
1ATN_xxx-4 0
"""
target_dict = {}

labels = np.loadtxt(target_list, delimiter=sep, usecols=[0], dtype=str)
values = np.loadtxt(target_list, delimiter=sep, usecols=[1])
for label, value in zip(labels, values, strict=True):
target_dict[label] = value
target_dict = dict(zip(labels, values, strict=False))

if os.path.isdir(graph_path):
graphs = glob.glob(f"{graph_path}/*.hdf5")
Expand Down
8 changes: 1 addition & 7 deletions deeprank2/utils/parsing/residue.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ def __init__(
absent_atom_names: list[str],
):
self.class_name = class_name

self.amino_acid_names = amino_acid_names

self.present_atom_names = present_atom_names
self.absent_atom_names = absent_atom_names

Expand All @@ -26,11 +24,7 @@ def matches(self, amino_acid_name: str, atom_names: list[str]) -> bool:
return False

# check the atom names that should be present
if not all(atom_name in atom_names for atom_name in self.present_atom_names):
return False

# all checks passed
return True
return all(atom_name in atom_names for atom_name in self.present_atom_names)


class ResidueClassParser: # noqa: D101
Expand Down
8 changes: 2 additions & 6 deletions tests/test_querycollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,11 @@ def test_querycollection_process_combine_output_true() -> None:
_, output_directory_f, output_paths_f = _querycollection_tester(query_type, feature_modules=modules, combine_output=False, cpu_count=2)
assert len(output_paths_t) == 1

keys_t = {}
with h5py.File(output_paths_t[0], "r") as file_t:
for key, value in file_t.items():
keys_t[key] = value
keys_f = {}
keys_t = dict(file_t.items())
for output_path in output_paths_f:
with h5py.File(output_path, "r") as file_f:
for key, value in file_f.items():
keys_f[key] = value
keys_f = dict(file_f.items())
assert keys_t == keys_f

rmtree(output_directory_t)
Expand Down

0 comments on commit 5c3a192

Please sign in to comment.