From 483cc64d53b45706ff3204d22592d025687f9f71 Mon Sep 17 00:00:00 2001 From: Milton Camacho Date: Wed, 31 Jan 2024 20:58:41 +0000 Subject: [PATCH] corrected creation of ci-env.yml and more use of pathlib --- docker/dicom_indexer/indexer/index_dicom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/dicom_indexer/indexer/index_dicom.py b/docker/dicom_indexer/indexer/index_dicom.py index 859e72f..5243abf 100644 --- a/docker/dicom_indexer/indexer/index_dicom.py +++ b/docker/dicom_indexer/indexer/index_dicom.py @@ -313,18 +313,18 @@ def init_bids( def init_dicom_study( dicom_study_ds: dlad.Dataset, - gitlab_group_path: str, + gitlab_group_path: pathlib.Path, ) -> None: shutil.copytree( "repo_templates/dicom_study", dicom_study_ds.path, dirs_exist_ok=True ) env = { "variables": { - "STUDY_PATH": gitlab_group_path, - "BIDS_PATH": f"{gitlab_group_path}/bids", + "STUDY_PATH": str(gitlab_group_path), + "BIDS_PATH": str(gitlab_group_path / "bids"), } } - with open(os.path.join(dicom_study_ds.path, "ci-env.yml"), "w") as outfile: + with (pathlib.Path(dicom_study_ds.path) / "ci-env.yml").open("w") as outfile: yaml.dump(env, outfile, default_flow_style=False) dicom_study_ds.save(path=".", message="init structure and pipelines") dicom_study_ds.push(to="origin")