Skip to content
Snippets Groups Projects
Commit 02aed5a1 authored by Alán Muñoz's avatar Alán Muñoz
Browse files

pass server info as kwarg

parent 00e7656f
No related branches found
No related tags found
No related merge requests found
......@@ -31,8 +31,8 @@ class Argo:
class Dataset(Argo):
def __init__(self, expt_id):
super().__init__()
def __init__(self, expt_id, **server_info):
super().__init__(**server_info)
self.expt_id = expt_id
self._files = None
......@@ -87,8 +87,8 @@ class Dataset(Argo):
class Image(Argo):
def __init__(self, image_id):
super().__init__()
def __init__(self, image_id, **server_info):
super().__init__(**server_info)
self.image_id = image_id
self._image_wrap = None
......
......@@ -57,7 +57,7 @@ class PipelineParameters(ParametersABC):
"""
expt_id = general.get("expt_id", 19993)
directory = Path(general.get("directory", "../data"))
with Dataset(int(expt_id)) as conn:
with Dataset(int(expt_id), **general.get("server_info")) as conn:
directory = directory / conn.unique_name
if not directory.exists():
directory.mkdir(parents=True)
......@@ -132,7 +132,7 @@ class Pipeline(ProcessABC):
print("Searching OMERO")
# Do all initialis
with Dataset(int(expt_id)) as conn:
with Dataset(int(expt_id), **self.general["server_info"]) as conn:
image_ids = conn.get_images()
directory = root_dir / conn.unique_name
if not directory.exists():
......@@ -165,7 +165,7 @@ class Pipeline(ProcessABC):
earlystop = general_config["earlystop"]
try:
directory = general_config["directory"]
with Image(image_id) as image:
with Image(image_id, **self.general['server_info']) as image:
filename = f"{directory}/{image.name}.h5"
try:
os.remove(filename)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment