Skip to content

Commit

Permalink
fix: typing
Browse files Browse the repository at this point in the history
  • Loading branch information
cbouy committed Dec 26, 2024
1 parent 4e34243 commit cb88965
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions prolif/interactions/water_bridge.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Module for the WaterBridge interaction implementation."""

from collections import defaultdict
from typing import Any, Callable, Iterator
from typing import Any, Callable, Iterator, Optional

from prolif.fingerprint import Fingerprint
from prolif.ifp import IFP, InteractionData
Expand All @@ -27,9 +27,9 @@ class WaterBridge:

def __init__(
self,
parameters: dict | None = None,
parameters: Optional[dict] = None,
count: bool = False,
ifp_store: dict[int, IFP] | None = None,
ifp_store: Optional[dict[int, IFP]] = None,
**kwargs: Any,
):
kwargs.pop("n_jobs", None)
Expand Down Expand Up @@ -69,7 +69,7 @@ def run(self, traj, lig, prot, water, order=1) -> dict[int, IFP]:

# Run water-water interaction analysis if order is 2 or above
if order >= 2:
water_ifp: dict[int, IFP] | None = self.water_fp._run_serial(
water_ifp: Optional[dict[int, IFP]] = self.water_fp._run_serial(

Check warning on line 72 in prolif/interactions/water_bridge.py

View check run for this annotation

Codecov / codecov/patch

prolif/interactions/water_bridge.py#L72

Added line #L72 was not covered by tests
traj, water, water, residues=None, **self.kwargs
)
else:
Expand All @@ -87,7 +87,7 @@ def run(self, traj, lig, prot, water, order=1) -> dict[int, IFP]:
def _merge_metadata(
self,
lig_water_ifp: dict[int, IFP],
water_ifp: dict[int, IFP] | None,
water_ifp: Optional[dict[int, IFP]],
water_prot_ifp: dict[int, IFP],
) -> None:
"""Merge results from all fingerprints on matching water residues"""
Expand Down Expand Up @@ -195,9 +195,9 @@ def _merge_metadata(

@staticmethod
def _filter_interactions(
ifp: IFP | None,
ifp: Optional[IFP],
predicate: Callable[[InteractionData], bool],
default: InteractionData | None = None,
default: Optional[InteractionData] = None,
) -> Iterator[InteractionData]:
"""Filters interactions to those that satisfy the predicate. If ``ifp==None``,
simply yields the ``default`` value.
Expand Down

0 comments on commit cb88965

Please sign in to comment.