From 1c5338703b74f95f6236a824bda997e826e6ea47 Mon Sep 17 00:00:00 2001 From: David Abramov Date: Wed, 14 Jan 2026 14:37:29 -0800 Subject: [PATCH 1/2] adjusting typing to allow dataset_path to be either a Path or list[Path] --- orchestration/flows/scicat/ingest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchestration/flows/scicat/ingest.py b/orchestration/flows/scicat/ingest.py index 38e31413..0918c57b 100644 --- a/orchestration/flows/scicat/ingest.py +++ b/orchestration/flows/scicat/ingest.py @@ -9,7 +9,7 @@ @flow(name="scicat-ingest-flow") def scicat_ingest_flow( - dataset_path: Path, + dataset_path: Path | list[Path], ingester_spec: str | None = None, owner_username: str | None = None, scicat_url: str | None = None, From 21de43372d4874e3148ac81d785195253d64eb0e Mon Sep 17 00:00:00 2001 From: David Abramov Date: Wed, 14 Jan 2026 14:39:33 -0800 Subject: [PATCH 2/2] linting --- orchestration/flows/scicat/ingest.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/orchestration/flows/scicat/ingest.py b/orchestration/flows/scicat/ingest.py index 0918c57b..f482d15f 100644 --- a/orchestration/flows/scicat/ingest.py +++ b/orchestration/flows/scicat/ingest.py @@ -1,9 +1,8 @@ -from typing import Optional, Dict, Any from pathlib import Path +from typing import Dict, Any from prefect import flow, get_run_logger - from scicat_beamline import ingest @@ -19,18 +18,20 @@ def scicat_ingest_flow( """ Runs the SciCat ingestion process implemented for the given spec identifier, on the given folder or file. - Args: - dataset_path: Path of the asset to ingest. May be file or directory depending on the spec. + + :param dataset_path: Path or list of Paths of the asset(s) to ingest. May be file or directory depending on the spec. If SICAT_INGEST_INTERNAL_BASE_FOLDER or SCICAT_INGEST_BASE_FOLDER is set, this path is considered relative to that base folder. - These remaining args are optional; if not provided, environment variables will be used. - ingester_spec: Spec to ingest with. (or set SCICAT_INGEST_INGESTER_SPEC) - owner_username: User doing the ingesting. May be different from the user_name, especially if using a token (or set SCICAT_INGEST_OWNER_USERNAME) - scicat_url: Scicat server base url. If not provided, will try localhost default (or set SCICAT_INGEST_URL) - scicat_username: Scicat server username (or set SCICAT_INGEST_USERNAME) - scicat_password: Scicat server password (or set SCICAT_INGEST_PASSWORD) - Returns: - Dict containing task results or skip message + + These remaining args are optional; if not provided, environment variables will be used: + + :param ingester_spec: Spec to ingest with. (or set SCICAT_INGEST_INGESTER_SPEC) + :param owner_username: User doing the ingesting. May be different from the user_name, especially if using a token + (or set SCICAT_INGEST_OWNER_USERNAME) + :param scicat_url: Scicat server base url. If not provided, will try localhost default (or set SCICAT_INGEST_URL) + :param scicat_username: Scicat server username (or set SCICAT_INGEST_USERNAME) + :param scicat_password: Scicat server password (or set SCICAT_INGEST_PASSWORD) + :returns: Dict containing task results or skip message """ # Get the Prefect logger for the current flow run prefect_adapter = get_run_logger() @@ -47,4 +48,4 @@ def scicat_ingest_flow( if __name__ == "__main__": - pass \ No newline at end of file + pass