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

np.where with "&" arguments messy #665

Closed
andrewkovachik opened this issue Jan 14, 2019 · 0 comments
Closed

np.where with "&" arguments messy #665

andrewkovachik opened this issue Jan 14, 2019 · 0 comments

Comments

@andrewkovachik
Copy link

Running yapf 0.24.0

Given the code:

        include_values = np.where(
            (cdffile['Quality_Flag'][:] >= 5) & (
            cdffile['Day_Night_Flag'][:] == 1) & (
            cdffile['Longitude'][:] >= select_lon - radius) & (
            cdffile['Longitude'][:] <= select_lon + radius) & (
            cdffile['Latitude'][:] >= select_lat - radius) & (
            cdffile['Latitude'][:] <= select_lat + radius))

Yapf formats as:

        include_values = np.where((cdffile['Quality_Flag'][:] >= 5) & (
            cdffile['Day_Night_Flag'][:] == 1) & (
                cdffile['Longitude'][:] >= select_lon - radius) & (
                    cdffile['Longitude'][:] <= select_lon + radius) & (
                        cdffile['Latitude'][:] >= select_lat - radius) & (
                            cdffile['Latitude'][:] <= select_lat + radius))

It seems that the extra level of indentation on this is very messy. Shouldn't this format in the same way as long "+-*/" codes?

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