dahak-metagenomics / dahak-taco

🌮 Taco is an experimental command line interface for dahak workflows. https://dahak-metagenomics.github.io/dahak-taco
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Autodetect JSON or YAML #14

Open charlesreid1 opened 6 years ago

charlesreid1 commented 6 years ago

Use one parameter name and autodetect json vs yaml

(currently, have separate flags for json and yaml)

This will help with the redundancy issue #13

charlesreid1 commented 6 years ago

From issue #9 (improve cli):

style 1

infer file structure and use

% taco workflow1 my-workflow-files

Here we check if one config file and one params file. If so, check if extension is json or yaml. If so, try to load it. If successful, proceed.

style 2

Or be explicit:

% taco workflow1 --config=my-workflow-files/config.yaml --params=my-workflow-files/params.yaml

Check if extension is json or yaml. If so, try to load it. If successful, proceed.

charlesreid1 commented 6 years ago

Do it! style 2 (explicit is better than implicit)

This would eliminate two wordy options and help close #13 (cut down on redundancy) with two "yaml"s or two "json"s gone.

Here: https://github.com/dahak-metagenomics/dahak-taco/blob/master/cli/command.py#L58

charlesreid1 commented 6 years ago

While we're at it. If we're using the model of a repo/URL being passed, instead of a local copy of the workflow, we can implement a default config and params file that would be expected in the repository, so that if the user runs

% taco workflow1 <url-to-workflow>

it will automatically use the default config & params file, whereas if the user wants to use a custom config and params they just pass it in:

% taco workflow1 <url-to-workflow> --config=relative/path/to/config.yaml --params=relative/path/to/params.yaml