Could it be that you all are just not used to reading them? I find a lot of
code tremendously unreadable but I have to get used to it because I am part
of a team. For instance, things that are on multiple lines (i.e. for loops)
are far less comprehensible to me than things on a single line.

Now, if your argument is "we do a lot more code than you do @wdwvt1, so our
opinions are more important on this question" thats fine. Be explicit about
that and I will back down.

I think that we are excluding a valuable tool because of a risk that is
solvable, e.g. you tell me that line XYZ is inscrutable and I change it. In
the future I will try to make less, and more precise use of this tool.
The python
docs<http://docs.python.org/2/tutorial/datastructures.html#list-comprehensions>
show
some neat usage examples and I think I have also isolated some good ones.
The ones you pointed out as bad I am changing.


On Wed, Dec 4, 2013 at 10:59 AM, Daniel McDonald
<notifications@github.com>wrote:

> In qiime/otu_significance.py:
>
> > +    taxonomy_md = biom_taxonomy_formatter(bt, md_key)
> > +    if taxonomy_md is not None:
> > +        for i in range(num_lines):
> > +            lines[i+1]=lines[i+1]+'\t'+taxonomy_md[i] #skip header line in lines
> > +    return lines
> > +
> > +# Functions for gradient correlation testing
> > +
> > +def grouped_correlation_row_generator(bt, pmf, category, gc_to_samples):
> > +    '''Create generator for grouped correlation tests.
> > +
> > +    '''
> > +    data = array([bt.observationData(i) for i in bt.ObservationIds])
> > +    category_values = gc_to_samples.keys()
> > +    samples = gc_to_samples.values()
> > +    sample_inds = [[bt.getSampleIndex(i) for i in group] for group in samples]
>
> It is very easy for nested list comprehensions to become unreadable.
> Allowing them at all will make it easier for nasty ones slip through.
> Disallowing them is an explicit point that I will like to see included in
> the to-be-refreshed guidelines. It is much more important to err on the
> side of readability; code maintenance is hard enough as is.
> … <#142bec360df609a2_>
> On Wed, Dec 4, 2013 at 10:57 AM, Yoshiki Vázquez Baeza <
> notifications@github.com> wrote: In qiime/otu_significance.py: > +
> taxonomy_md = biom_taxonomy_formatter(bt, md_key) > + if taxonomy_md is not
> None: > + for i in range(num_lines): > +
> lines[i+1]=lines[i+1]+'\t'+taxonomy_md[i] #skip header line in lines > +
> return lines > + > +# Functions for gradient correlation testing > + > +def
> grouped_correlation_row_generator(bt, pmf, category, gc_to_samples): > +
> '''Create generator for grouped correlation tests. > + > + ''' > + data =
> array([bt.observationData(i) for i in bt.ObservationIds]) > +
> category_values = gc_to_samples.keys() > + samples = gc_to_samples.values()
> > + sample_inds = [[bt.getSampleIndex(i) for i in group] for group in
> samples] This is one of those things where IMHO you either allow them all
> or not. You cannot only allow "the ones that are clear" because then this
> becomes very ambiguous very quickly. Given that we don't have coding
> guidelines and that disallow this as it is, it seems hard to just say no to
> this particular line. — Reply to this email directly or view it on GitHub<
> https://github.com/qiime/qiime/pull/1091/files#r8103445> .
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/qiime/qiime/pull/1091/files#r8103497>
> .
>