pepkit / eido

Validator for PEP objects
http://eido.databio.org
BSD 2-Clause "Simplified" License
4 stars 6 forks source link

list of available output formats #31

Closed nsheff closed 2 years ago

nsheff commented 3 years ago

How can I get the list of availlable output formats?

nsheff@zither:~/code/bedshift_paper$ eido convert --help
usage: eido convert [-h] [--st-index ST_INDEX] -f FORMAT [-n SAMPLE_NAME [SAMPLE_NAME ...]]
                    [-a ARGS [ARGS ...]]
                    PEP

Convert a PEP using an available filter

positional arguments:
  PEP                   Path to a PEP configuration file in yaml format.

optional arguments:
  -h, --help            show this help message and exit
  --st-index ST_INDEX   Sample table index to use, samples are identified by 'sample_name' by default.
  -f FORMAT, --format FORMAT
                        Path to a PEP schema file in yaml format.
  -n SAMPLE_NAME [SAMPLE_NAME ...], --sample-name SAMPLE_NAME [SAMPLE_NAME ...]
                        Name of the samples to inspect.
  -a ARGS [ARGS ...], --args ARGS [ARGS ...]
                        Provide arguments to the filter function (e.g. arg1=val1 arg2=val2).

Also, is the -f command docs here correct? I think that's the wrong help string.

stolarczyk commented 3 years ago

I wanted to make it list the filters with eido filters command, but then added an extra feature: displaying filter docs so that you can see what parameters filters take

~ eido filters csv  

    CSV PEP filter, that returns Sample object representations

    This filter can save the CSVs to files, if kwargs include
    `sample_table_path` and/or `subsample_table_path`.

    :param peppy.Project p: a Project to run filter on

but made the filter argument required. That's a bug

stolarczyk commented 3 years ago

ok, fixed

~ eido filters 

Available filters:
 - basic
 - csv
 - yaml
 - yaml-samples
~ eido filters -f basic

    Basic PEP filter, that does not convert the Project object.

    This filter can save the PEP representation to file, if kwargs include `path`.

    :param peppy.Project p: a Project to run filter on
nsheff commented 3 years ago

ok that makes sense! from my perspective I was expecting something under convert, rather than a separate command -- I was naturally looking for eido convert --list or something. I didn't think to look at a different command namespace, since that would have seemed out-of-scope to me. that's why I missed the eido filters command

stolarczyk commented 3 years ago

do you think it makes sense to move the filters functionality to convert? It is split like this already in the released version: http://eido.databio.org/en/latest/filters/

nsheff commented 2 years ago

Yes, I think filters and convert are synonyms and we should move them into one command. I'm working on this.