Skip to content

Implement new clone_dataset command / method to serve the public space of the HIP #89

@sebastientourbier

Description

@sebastientourbier

To serve the HIP public space, the public.dataset.clone command and the clone_dataset(input_data, output_file)method need to be implemented.

Input(s)

  • input_data: Path to the input data file in JSON format with the following specified parameters:
    • "source_dataset": absolute path of the source dataset of the public space.
    • "target_dataset": absolute path of the directory of the private space where we want to clone the source dataset.
    • "target_version": version tag at which we want to checkout the cloned dataset

Output(s)

  • output_file: Path to the output file in JSON format generated by the command that contains the dataset summary or an error message.

Description

Clone a public a BIDS dataset to the private space of the user.

This should perform the following steps depicted in the diagram below:

  • Check if the target directory where the public dataset will be cloned already exists. If yes, return an error message.
  • Install / clone the public dataset with datalad install ....
  • Checkout the cloned dataset at the version tag specified by the parameter "target_version" specified in the input_data file
  • Get a summary of the cloned dataset in JSON format
  • Return the dataset summary in the output_file.

Process diagram for the clone_dataset(input_data, output_file) method

flowchart LR
    in0(["input_data"])
    c1{"Target dataset exists?"}
    p2["Install/clone dataset with Datalad"]
    p3["Checkout version tag on cloned dataset"]
    p4["Get JSON dataset summary"]
    out0(["output_file"])
    err0(["error"])
    subgraph "input"
    in0
    end
    in0-->c1
    subgraph "`clone_dataset()`"
    c1-->|YES|p2-->p3-->p4
    end
    subgraph "output"
    p4-->out0
    c1-->|NO|err0
    end
Loading

Metadata

Metadata

Labels

featureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions