Skip to content

Improve investigation selection

Wout De Nolf requested to merge 11-modify-investigation-selection into main

Closes #11 (closed)

Get an investigation ID for a proposal, beamline and date by getting all investigations from ICAT for a beamline and proposal (requires icat-plus#508 (closed) to be fixed and deployed) and select a single one based on clear rules defined on the client side (not the backend side). Investigation ID selection is still done by the backend when sending dataset messages to the ingester (see here) and I guess also start investigation messages.

FYI: getting an investigation ID on the client side is needed for checking which datasets have been registered already (done in Bliss and icat-sync-raw).

Manual test to see whether icat-plus#508 (closed) is deployed (Edit: OK):

from pyicat_plus.client.bliss import get_icat_client

client = get_icat_client(timeout=100)

url = client.investigation_client._investigation_url.format(
    beamline="id23-1", proposal="oa14"
)
investigations = client.investigation_client._get_with_response_parsing(url)
assert len(investigations) == 14, len(investigations)

url = client.investigation_client._investigation_url.format(
    beamline="id27", proposal="ihhc3952"
)
investigations = client.investigation_client._get_with_response_parsing(url)
assert len(investigations) == 3, len(investigations)

url = client.investigation_client._investigation_url.format(
    beamline="id27", proposal="es1019"
)
investigations = client.investigation_client._get_with_response_parsing(url)
assert len(investigations) == 5, len(investigations)

URLs:

Edited by Wout De Nolf

Merge request reports