From 62f1698f648f7895ef8c13ffaf728518d5d3497a Mon Sep 17 00:00:00 2001 From: lbarber Date: Thu, 20 Jul 2023 16:25:02 -0400 Subject: [PATCH] chore: update init for classes --- src/dioptra/client/_client.py | 42 ++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/dioptra/client/_client.py b/src/dioptra/client/_client.py index d3d246df7..3fd3306fd 100644 --- a/src/dioptra/client/_client.py +++ b/src/dioptra/client/_client.py @@ -132,7 +132,12 @@ def refresh_session(self): class ExperimentClient(object): def __init__(self, session: requests.Session, address: str | None = None): - (self._scheme, self._netloc, self._path, _, _, _) = urlparse(address) + parsed = urlparse(address) + self._scheme, self._netloc, self._path = ( + parsed.scheme, + parsed.netloc, + parsed.path, + ) self._session = session @property @@ -282,7 +287,12 @@ def register(self, name: str) -> dict[str, Any]: class JobClient(object): def __init__(self, session: requests.Session, address: str | None = None): - (self._scheme, self._netloc, self._path, _, _, _) = urlparse(address) + parsed = urlparse(address) + self._scheme, self._netloc, self._path = ( + parsed.scheme, + parsed.netloc, + parsed.path, + ) self._session = session @property @@ -463,7 +473,12 @@ class TaskPluginClient(object): """ # noqa B950 def __init__(self, session: requests.Session, address: str | None = None): - (self._scheme, self._netloc, self._path, _, _, _) = urlparse(address) + parsed = urlparse(address) + self._scheme, self._netloc, self._path = ( + parsed.scheme, + parsed.netloc, + parsed.path, + ) self._session = session @property @@ -529,7 +544,12 @@ class BuiltinTaskPluginClient(object): """ # noqa B950 def __init__(self, session: requests.Session, address: str | None = None): - (self._scheme, self._netloc, self._path, _, _, _) = urlparse(address) + parsed = urlparse(address) + self._scheme, self._netloc, self._path = ( + parsed.scheme, + parsed.netloc, + parsed.path, + ) self._session = session @property @@ -629,7 +649,12 @@ class CustomTaskPluginClient(object): """ # noqa B950 def __init__(self, session: requests.Session, address: str | None = None): - (self._scheme, self._netloc, self._path, _, _, _) = urlparse(address) + parsed = urlparse(address) + self._scheme, self._netloc, self._path = ( + parsed.scheme, + parsed.netloc, + parsed.path, + ) self._session = session @property @@ -827,7 +852,12 @@ def __init__( session: requests.Session, address: str | None = None, ) -> None: - (self._scheme, self._netloc, self._path, _, _, _) = urlparse(address) + parsed = urlparse(address) + self._scheme, self._netloc, self._path = ( + parsed.scheme, + parsed.netloc, + parsed.path, + ) self._session = session @property