Skip to content

Should storing an image in LIMS return an image ID? #1376

Description

@fabcor-maxiv

I am looking at the code related to storing image in LIMS, and I am wondering if it is supposed to return an image ID back?

This returns nothing, according to the type hint:

@abc.abstractmethod
def store_image(self, image_dict: dict) -> None:
"""
Stores (image parameters) <image_dict>
Args:
image_dict: A dictionary with image pramaters.
"""
raise Exception("Abstract class. Not implemented")

...but this expects something:

image_id = HWR.beamline.lims.store_image(lims_image)
return image_id

This returns something, only if all goes well, otherwise nothing:

image_id = self._collection.service.storeOrUpdateImage(image_dict)
logging.getLogger("HWR").debug(
" - storing image in lims ok. id : %s" % image_id
)
return image_id
except WebFault:
logging.getLogger("ispyb_client").exception(
"ISPyBClient: exception in store_image"
)
except URLError as e:
logging.getLogger("ispyb_client").exception(e)
else:
logging.getLogger("ispyb_client").error(
"Error in store_image: "
+ "data_collection_id missing, could not store image in ISPyB"
)
else:
logging.getLogger("ispyb_client").exception(
"Error in store_image: could not connect to server"
)

...but this always returns nothing:

def store_image(self, image_dict):
self.adapter.store_image(image_dict)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions