Skip to content

Commit

Permalink
chore: update init for classes
Browse files Browse the repository at this point in the history
  • Loading branch information
lbarbMITRE committed Jul 20, 2023
1 parent 6098359 commit 62f1698
Showing 1 changed file with 36 additions and 6 deletions.
42 changes: 36 additions & 6 deletions src/dioptra/client/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 62f1698

Please sign in to comment.