Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

Add native support for output directories in optparse #250

@josenavas

Description

@josenavas

Currently, if a command has multiple outcomes and all of them should be stored in a single output directory there is not an elegant way of doing this: the directory is passed using the option_value parameter of the output handler and the actual file name can be extracted from the result_key parameter, so the final output path is constructed joining these two parameters. However, this implies that each of the output handlers that are going to write on such directory such check the existence of the directory and create it if it does not exist.

This check can be removed by creating the output directory when the optparse framework checks for the existence of such directory during CLI parameter parsing and checking.

On the other hand, this also means that we should have two versions of each of the output handlers that write files: one that expects the file name in option_value and another one that expects a directory in option_value, creates the path with the result_key parameter and simply calls the first output handler.

Examples of these issues and how they are addresses are implemented in the QIIME-Scaling project.

I think we should make this process easier, since this is a functionality that is widely used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions