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

chore: pass repo review #219

Merged
merged 8 commits into from
Jul 4, 2022

Conversation

Saransh-cpp
Copy link
Member

  • Modifies setup.cfg, .pre-commit-config.yaml, and pyproject.toml to pass the repo review
  • Adds noxfile.py for beginners
  • Other changes are by the newly added pre-commit hooks

Repo review for this branch - https://scikit-hep.org/repo-review/?repo=Saransh-cpp%2Fvector&branch=saransh%2Frepo-review
(The red cross should ideally not appear since the dependabot check was fixed in the repo review repository. All the other green ticks are very satisfying to look at!)

@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2022

Codecov Report

Merging #219 (0cbddd0) into main (dfeead2) will not change coverage.
The diff coverage is 63.63%.

@@           Coverage Diff           @@
##             main     #219   +/-   ##
=======================================
  Coverage   82.56%   82.56%           
=======================================
  Files          96       96           
  Lines       10475    10475           
=======================================
  Hits         8649     8649           
  Misses       1826     1826           
Impacted Files Coverage Δ
src/vector/backends/_numba_object.py 69.17% <ø> (ø)
src/vector/backends/object.py 73.07% <ø> (ø)
src/vector/backends/awkward.py 75.89% <33.33%> (ø)
src/vector/_methods.py 78.67% <100.00%> (ø)
src/vector/backends/numpy.py 77.50% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfeead2...0cbddd0. Read the comment docs.

Copy link
Member Author

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR grew bigger than I thought. Most of the changes are due to the updated pre-commit configuration, but there are a few changes which I think should be reviewed once. I have marked them down below. @henryiii @jpivarski could you please review them once? Thanks!

noxfile.py Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
src/vector/_methods.py Outdated Show resolved Hide resolved
src/vector/_methods.py Outdated Show resolved Hide resolved
src/vector/_methods.py Outdated Show resolved Hide resolved
Comment on lines +577 to +582
if issubclass(cls, Vector2D): # type: ignore[unreachable]
return "Momentum2D" # type: ignore[unreachable]
elif issubclass(cls, Vector3D): # type: ignore[unreachable]
return "Momentum3D" # type: ignore[unreachable]
elif issubclass(cls, Vector4D): # type: ignore[unreachable]
return "Momentum4D" # type: ignore[unreachable]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type: ignore[unreachable]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing it is not understanding that Type[VectorProtocol] can (sometimes) pass a subclass of Momentum check? Might be worth updating that. But not in this PR, these are (all) fine for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exact error -

src\vector\backends\awkward.py:577: error: Subclass of "VectorProtocol", "Momentum", and "Vector2D" cannot exist: would have inconsistent method resolution order  [unreachable]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay to ignore for now, we can try to work on it later. We will probably need to think through why this is happening. Eventually.

src/vector/backends/numpy.py Outdated Show resolved Hide resolved
src/vector/backends/numpy.py Outdated Show resolved Hide resolved
src/vector/backends/numpy.py Outdated Show resolved Hide resolved
MANIFEST.in Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
noxfile.py Show resolved Hide resolved
src/vector/_methods.py Outdated Show resolved Hide resolved
Comment on lines +577 to +582
if issubclass(cls, Vector2D): # type: ignore[unreachable]
return "Momentum2D" # type: ignore[unreachable]
elif issubclass(cls, Vector3D): # type: ignore[unreachable]
return "Momentum3D" # type: ignore[unreachable]
elif issubclass(cls, Vector4D): # type: ignore[unreachable]
return "Momentum4D" # type: ignore[unreachable]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing it is not understanding that Type[VectorProtocol] can (sometimes) pass a subclass of Momentum check? Might be worth updating that. But not in this PR, these are (all) fine for now.

src/vector/backends/numpy.py Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
@Saransh-cpp Saransh-cpp merged commit 02d4655 into scikit-hep:main Jul 4, 2022
@Saransh-cpp Saransh-cpp deleted the saransh/repo-review branch July 4, 2022 15:03
@Saransh-cpp Saransh-cpp added this to the v0.9.0 milestone Feb 17, 2023
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

Successfully merging this pull request may close these issues.

4 participants