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

Possibly used before assignment pylint warning #512

Open
henryiii opened this issue Oct 2, 2024 · 0 comments
Open

Possibly used before assignment pylint warning #512

henryiii opened this issue Oct 2, 2024 · 0 comments
Labels
bug The problem described is something that must be fixed hacktoberfest

Comments

@henryiii
Copy link
Member

henryiii commented Oct 2, 2024

Vector Version

main

Python Version

Pylint

OS / Environment

Any

Describe the bug

This report is showing potentially problematic code:

************* Module vector.backends._numba_object
src/vector/backends/_numba_object.py:1502:12: E0606: Possibly using variable 'signature' before assignment (possibly-used-before-assignment)
src/vector/backends/_numba_object.py:1510:31: E0606: Possibly using variable 'coord11' before assignment (possibly-used-before-assignment)
src/vector/backends/_numba_object.py:1510:44: E0606: Possibly using variable 'coord12' before assignment (possibly-used-before-assignment)
src/vector/backends/_numba_object.py:1510:57: E0606: Possibly using variable 'coord21' before assignment (possibly-used-before-assignment)
src/vector/backends/_numba_object.py:1510:70: E0606: Possibly using variable 'coord22' before assignment (possibly-used-before-assignment)
src/vector/backends/_numba_object.py:1520:24: E0601: Using variable 'coord13' before assignment (used-before-assignment)
src/vector/backends/_numba_object.py:1523:24: E0601: Using variable 'coord23' before assignment (used-before-assignment)
src/vector/backends/_numba_object.py:1534:24: E0601: Using variable 'coord14' before assignment (used-before-assignment)
src/vector/backends/_numba_object.py:1538:24: E0601: Using variable 'coord24' before assignment (used-before-assignment)
src/vector/backends/_numba_object.py:1663:12: E0606: Possibly using variable 'groupname' before assignment (possibly-used-before-assignment)
src/vector/backends/_numba_object.py:1665:12: E0606: Possibly using variable 'signature' before assignment (possibly-used-before-assignment)
************* Module vector.backends.numpy
src/vector/backends/numpy.py:190:19: E0606: Possibly using variable 'generic' before assignment (possibly-used-before-assignment)
src/vector/backends/numpy.py:369:28: E0606: Possibly using variable 'thisshape' before assignment (possibly-used-before-assignment)
************* Module vector._compute.lorentz.equal
src/vector/_compute/lorentz/equal.py:128:16: E0601: Using variable 'to_t1' before assignment (used-before-assignment)
src/vector/_compute/lorentz/equal.py:129:19: E0601: Using variable 'to_t2' before assignment (used-before-assignment)
************* Module vector._compute.lorentz.add
src/vector/_compute/lorentz/add.py:121:17: E0601: Using variable 'to_t1' before assignment (used-before-assignment)
src/vector/_compute/lorentz/add.py:122:17: E0601: Using variable 'to_t2' before assignment (used-before-assignment)
src/vector/_compute/lorentz/add.py:157:16: E0601: Using variable 'to_tau' before assignment (used-before-assignment)
************* Module vector._compute.lorentz.subtract
src/vector/_compute/lorentz/subtract.py:121:17: E0601: Using variable 'to_t1' before assignment (used-before-assignment)
src/vector/_compute/lorentz/subtract.py:122:17: E0601: Using variable 'to_t2' before assignment (used-before-assignment)
src/vector/_compute/lorentz/subtract.py:157:16: E0601: Using variable 'to_tau' before assignment (used-before-assignment)
************* Module vector._compute.lorentz.isclose
src/vector/_compute/lorentz/isclose.py:161:16: E0601: Using variable 'to_t1' before assignment (used-before-assignment)
src/vector/_compute/lorentz/isclose.py:162:16: E0601: Using variable 'to_t2' before assignment (used-before-assignment)
************* Module vector._compute.lorentz.boost_p4
src/vector/_compute/lorentz/boost_p4.py:735:16: E0606: Possibly using variable 'to_x' before assignment (possibly-used-before-assignment)
src/vector/_compute/lorentz/boost_p4.py:736:16: E0606: Possibly using variable 'to_y' before assignment (possibly-used-before-assignment)
src/vector/_compute/lorentz/boost_p4.py:737:16: E0601: Using variable 'to_z' before assignment (used-before-assignment)
************* Module vector._compute.lorentz.boost_beta3
src/vector/_compute/lorentz/boost_beta3.py:349:16: E0606: Possibly using variable 'to_x' before assignment (possibly-used-before-assignment)
src/vector/_compute/lorentz/boost_beta3.py:350:16: E0606: Possibly using variable 'to_y' before assignment (possibly-used-before-assignment)
src/vector/_compute/lorentz/boost_beta3.py:351:16: E0601: Using variable 'to_z' before assignment (used-before-assignment)
************* Module vector._compute.lorentz.dot
src/vector/_compute/lorentz/dot.py:115:12: E0601: Using variable 'to_t1' before assignment (used-before-assignment)
src/vector/_compute/lorentz/dot.py:116:14: E0601: Using variable 'to_t2' before assignment (used-before-assignment)
************* Module vector._compute.lorentz.transform4D
src/vector/_compute/lorentz/transform4D.py:158:16: E0606: Possibly using variable 'to_x' before assignment (possibly-used-before-assignment)
src/vector/_compute/lorentz/transform4D.py:159:16: E0606: Possibly using variable 'to_y' before assignment (possibly-used-before-assignment)
src/vector/_compute/lorentz/transform4D.py:160:16: E0601: Using variable 'to_z' before assignment (used-before-assignment)
src/vector/_compute/lorentz/transform4D.py:161:16: E0601: Using variable 'to_t' before assignment (used-before-assignment)
************* Module vector._compute.lorentz.not_equal
src/vector/_compute/lorentz/not_equal.py:128:16: E0601: Using variable 'to_t1' before assignment (used-before-assignment)
src/vector/_compute/lorentz/not_equal.py:129:19: E0601: Using variable 'to_t2' before assignment (used-before-assignment)
************* Module vector._compute.spatial.cross
src/vector/_compute/spatial/cross.py:104:16: E0606: Possibly using variable 'to_x1' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/cross.py:105:16: E0606: Possibly using variable 'to_y1' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/cross.py:106:16: E0601: Using variable 'to_z1' before assignment (used-before-assignment)
src/vector/_compute/spatial/cross.py:107:16: E0606: Possibly using variable 'to_x2' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/cross.py:108:16: E0606: Possibly using variable 'to_y2' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/cross.py:109:16: E0601: Using variable 'to_z2' before assignment (used-before-assignment)
************* Module vector._compute.spatial.rotate_axis
src/vector/_compute/spatial/rotate_axis.py:123:16: E0606: Possibly using variable 'to_x1' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/rotate_axis.py:124:16: E0606: Possibly using variable 'to_y1' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/rotate_axis.py:125:16: E0601: Using variable 'to_z1' before assignment (used-before-assignment)
src/vector/_compute/spatial/rotate_axis.py:126:16: E0606: Possibly using variable 'to_x2' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/rotate_axis.py:127:16: E0606: Possibly using variable 'to_y2' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/rotate_axis.py:128:16: E0601: Using variable 'to_z2' before assignment (used-before-assignment)
************* Module vector._compute.spatial.rotate_euler
src/vector/_compute/spatial/rotate_euler.py:248:16: E0606: Possibly using variable 'to_x' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/rotate_euler.py:249:16: E0606: Possibly using variable 'to_y' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/rotate_euler.py:250:16: E0601: Using variable 'to_z' before assignment (used-before-assignment)
************* Module vector._compute.spatial.rotate_quaternion
src/vector/_compute/spatial/rotate_quaternion.py:95:16: E0606: Possibly using variable 'to_x' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/rotate_quaternion.py:96:16: E0606: Possibly using variable 'to_y' before assignment (possibly-used-before-assignment)
src/vector/_compute/spatial/rotate_quaternion.py:97:16: E0601: Using variable 'to_z' before assignment (used-before-assignment)

We should add assert statements at least to give nice errors on the branches where used-later variables are unset.

I've ignored the new check for now in #511.

Any additional but relevant log output

No response

@henryiii henryiii added the bug (unverified) The problem described would be a bug, but needs to be triaged label Oct 2, 2024
@Saransh-cpp Saransh-cpp added bug The problem described is something that must be fixed hacktoberfest and removed bug (unverified) The problem described would be a bug, but needs to be triaged labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The problem described is something that must be fixed hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants