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

Replace ampersand (&) with and #23

Open
atteggiani opened this issue Aug 1, 2024 · 0 comments · May be fixed by #55
Open

Replace ampersand (&) with and #23

atteggiani opened this issue Aug 1, 2024 · 0 comments · May be fixed by #55
Assignees

Comments

@atteggiani
Copy link
Collaborator

There are a few lines in which the ampersand (&) operator is used.
For example:

lonmin_index = np.argwhere( (lons > lonmin - adj) & (lons < lonmin + adj))[0][0]
lonmax_index = np.argwhere( (lons > lonmax - adj) & (lons < lonmax + adj))[0][0]

From the code above, it looks like the intention for the ampersand is to connect two conditions with an AND operator.
However, in Python the AND operator is and, while the ampersand (&) is the bitwise AND operator.
More information on the difference between & and and in Python.

Even though in the case above even the ampersand would work, for clarity and preciseness, consider replacing the & with and when they are in place of an AND operator.

@atteggiani atteggiani moved this to Todo ⏳ in ACCESS-RAM3 Aug 1, 2024
@atteggiani atteggiani self-assigned this Aug 2, 2024
@atteggiani atteggiani linked a pull request Feb 24, 2025 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo ⏳
Development

Successfully merging a pull request may close this issue.

1 participant