Skip to content

Discussion thread on key use cases, interface rearrangement #4

@stschiff

Description

@stschiff

We currently have this very nice and flexible module-based approach, where I can say ./sidora.R -m progress_table and it creates a progress table. However, it's a bit funny that - for example - the project filter is a global option. I think that design will create problems later.

For example, here is an exploratory workflow that I can imagine might be useful:

  1. query Pandora quickly for all available projects (because you don't know by heart how you've named your favourite project again)
  2. quickly list how many sites/samples/individuals or so there are per project (perhaps you have two projects with relatively similar names and you want to quickly double check the raw numbers of sites in each)
  3. Then select a specific project and output the full progress table for it.
  4. Print the progress table again with selected columns
  5. Create a pdf or html report from that customised progress table to send to your team, say.

here, 1-3 would not allow for a project selection (because you are printing all), while 4-6 involve selecting a project.

I would therefore suggest we aim for a more controlled, less free, approach to the interface, where we have subcommands of the sort

./sidora.R list --projects -> listing all projects
./sidora.R list --projects --withStats -> as above, but with some key numbers summarised (nr of sites, individuals, ...)
./sidora.R list --tags -> listing all tags, with optional --withStats
./sidora.R list --sites -> listing all sites, with optional --withStats
./sidora.R view --project=XX -> list progress table
./sidora.R view --tag=XX -> similar
./sidora.R view --project=XX --columns=X,Y,Z -> show only the selected columns
./sidora.R view --project=XX --columns=X,Y,Z --output=html -> create report

So here I can see we already need list and view subcommands, but I'm sure we'll have a lot more in the future. But this would go away from the very flexible module-based approach, but make a more restrictive set of sub-commands.

In terms of internal design, I think we should design this repo as a proper R package. So all functionality shown above from the command line should be also available as simple R functions (called for example sidora_list(...) and sidora_view(...)). Then, the CLI script would simply call those functions. Thereby we have covered both the interactive, programmatic use-case within R, and also the more immediate bash-based approach.

Destroy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions