Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline generator/ array comprehension proposal #27

Open
xtalax opened this issue Aug 23, 2022 · 0 comments
Open

Multiline generator/ array comprehension proposal #27

xtalax opened this issue Aug 23, 2022 · 0 comments

Comments

@xtalax
Copy link
Member

xtalax commented Aug 23, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant