-
Notifications
You must be signed in to change notification settings - Fork 868
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
Use Self
type in Method Signatures
#3705
Conversation
i added |
Thanks for your help! And don't worry about the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (4)
- pymatgen/core/lattice.py (2 hunks)
- pymatgen/io/vasp/inputs.py (25 hunks)
- pymatgen/io/xyz.py (5 hunks)
- pymatgen/io/zeopp.py (6 hunks)
Files skipped from review as they are similar to previous changes (4)
- pymatgen/core/lattice.py
- pymatgen/io/vasp/inputs.py
- pymatgen/io/xyz.py
- pymatgen/io/zeopp.py
Additional Context Used
very strange. did not notice this before in other PRs. if i see it a 2nd time I'll do some digging |
Cheers! |
with all the type fixes in this PR, we can probably consider unskipping pymatgen/.pre-commit-config.yaml Line 5 in 3a49dd9
|
Ahh... Frankly I don't know how would this potentially alter (impact) CI. I thought |
it has but not in |
Speaking of this. I might continue to add type annotations across the code base in the near future. But I guess it's better to start from the most used parts ( |
Thanks for clarifying. This makes sense to me, but I guess it's better to run locally with the same args, instead of risk breaking everyone's PR workflow? I'm having a try now. |
instead of risk breaking everyone's CI workflow? oh don't worry,
that would be very welcome! |
I think I don't understand the difference between CI and On the other hand, running
................................ OMG |
that's correct. you can still run it on all files with
😆 yep, lots of legacy issues to clean up. can't be done all at once. but some type errors could also go away with a smarter type checker in the future. hoping |
I'm hoping the same, but there are actually quite some issues can be discovered by type checking (mostly On the other hand,
I wouldn't worry about this too much, we fixed like 120? in 5 days, I just want to duplicate myself... |
Hi! Thanks for your work on
|
Great, thanks @janosh! |
Hi! Sorry to be bugging again 😅 but just flagging something that was causing a few test failures for us. |
6a06f3c#r140937732 (Linking to the comments I added for specific code locations as examples) |
Summary
Use
Self
for return type in Method Signatures, see reference here.Major changes:
Self
type in Method Signaturessourcery
fixesMinor changes:
Summary by CodeRabbit
Summary by CodeRabbit
Self
for better type hinting and future maintainability.None
values in data processing methods.