From 13392b90e09328d9ca3ea7713bb8f3a535d4a7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bouysset?= Date: Sun, 23 Jun 2024 02:20:24 +0100 Subject: [PATCH] fix issues --- prolif/fingerprint.py | 6 +++--- prolif/plotting/network.py | 17 +++++++---------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/prolif/fingerprint.py b/prolif/fingerprint.py index 61758a1..e51c232 100644 --- a/prolif/fingerprint.py +++ b/prolif/fingerprint.py @@ -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", @@ -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 diff --git a/prolif/plotting/network.py b/prolif/plotting/network.py index d5cad1c..c31ebc4 100644 --- a/prolif/plotting/network.py +++ b/prolif/plotting/network.py @@ -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 = ( - '' - ) - return HTML( - iframe.format(width=self.width, height=self.height, doc=escape(html)), + f'' ) + return HTML(iframe) @requires("IPython.display") def show(self, filename, **kwargs): @@ -832,12 +831,10 @@ def show(self, filename, **kwargs): with open(filename, "w") as f: f.write(html) iframe = ( - '' # noqa: RUF027 - ) - return HTML( - iframe.format(width=self.width, height=self.height, filename=filename), + f'' ) + return HTML(iframe) def save(self, fp, **kwargs): """Save the network to an HTML file