Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cbouy committed Jun 23, 2024
1 parent fbeb942 commit 13392b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
6 changes: 3 additions & 3 deletions prolif/fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ def __init__(
count=False,
vicinity_cutoff=6.0,
):
self.count = count
self._set_interactions(interactions, parameters)
self.vicinity_cutoff = vicinity_cutoff
if interactions is None:
interactions = [
"Hydrophobic",
Expand All @@ -206,6 +203,9 @@ def __init__(
"VdWContact",
]
self.interactions = interactions
self.count = count
self._set_interactions(interactions, parameters)
self.vicinity_cutoff = vicinity_cutoff

def _set_interactions(self, interactions, parameters):
# read interactions to compute
Expand Down
17 changes: 7 additions & 10 deletions prolif/plotting/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,13 +817,12 @@ def _get_legend(self, height="90px"):
def display(self, **kwargs):
"""Prepare and display the network"""
html = self._get_html(**kwargs)
doc = escape(html)
iframe = (
'<iframe id="{uuid}" width="{width}" height="{height}" frameborder="0" '
'srcdoc="{doc}"></iframe>'
)
return HTML(
iframe.format(width=self.width, height=self.height, doc=escape(html)),
f'<iframe id="{self.uuid}" width="{self.width}" height="{self.height}"'
f' frameborder="0" srcdoc="{doc}"></iframe>'
)
return HTML(iframe)

@requires("IPython.display")
def show(self, filename, **kwargs):
Expand All @@ -832,12 +831,10 @@ def show(self, filename, **kwargs):
with open(filename, "w") as f:
f.write(html)
iframe = (
'<iframe id="{uuid}" width="{width}" height="{height}" frameborder="0" '
'src="{filename}"></iframe>' # noqa: RUF027
)
return HTML(
iframe.format(width=self.width, height=self.height, filename=filename),
f'<iframe id="{self.uuid}" width="{self.width}" height="{self.height}"'
f' frameborder="0" src="{filename}"></iframe>'
)
return HTML(iframe)

Check warning on line 837 in prolif/plotting/network.py

View check run for this annotation

Codecov / codecov/patch

prolif/plotting/network.py#L837

Added line #L837 was not covered by tests

def save(self, fp, **kwargs):
"""Save the network to an HTML file
Expand Down

0 comments on commit 13392b9

Please sign in to comment.