Skip to content

Multiline generator/ array comprehension proposal #27

@xtalax

Description

@xtalax

There are a lot of huge multiline comprehensions in MethodOfLines, as I can't seem to get @rule to work within maps.

For clarity I propose the following:

reduce(vcat,
                    [reduce(vcat,
                            [[@rule *(~~a, $(Differential(x)^d)(u), ~~b) =>
                                    upwind_difference(*(~a..., ~b...), d, Idx(II, s, u, indexmap), s,
                                                      pmap.map[operation(u)][x], depvars, derivweights,
                                                      (x2i(s, u, x), x), u, wind_ufunc, indexmap)
                              for d in (let orders = derivweights.orders[x]
                                            orders[isodd.(orders)]
                                        end)]
                             for x in params(u, s)])
                      for u in depvars])

That the for expression which closes the comprehension be on a newline, aligned with the first character inside the square bracket that begins the comprehension.

Thoughts?

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