-
Notifications
You must be signed in to change notification settings - Fork 871
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
Docstring tweaks for io.vasp.inputs
and format tweaks for some other parts
#3996
Docstring tweaks for io.vasp.inputs
and format tweaks for some other parts
#3996
Conversation
@@ -2610,12 +2604,6 @@ def __init__( | |||
def __str__(self) -> str: | |||
return "\n".join(str(potcar).strip("\n") for potcar in self) + "\n" | |||
|
|||
def __iter__(self) -> Iterator[PotcarSingle]: |
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.
I believe it should be safe to remove this now.
The following script seems to give the right type without __iter__
:
from pymatgen.io.vasp.inputs import Potcar
potcar = Potcar.from_file("tests/files/io/vasp/inputs/POTCAR_C2.gz")
for psingle in potcar:
print(type(psingle)) >>> <class 'pymatgen.io.vasp.inputs.PotcarSingle'>
dct["unit_cell_formula"] = comp.as_dict() | ||
dct["reduced_cell_formula"] = Composition(comp.reduced_formula).as_dict() | ||
dct["pretty_formula"] = comp.reduced_formula | ||
symbols = [s.split()[1] for s in self.potcar_symbols] |
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.
symbols
is unused, wondering why it's not automatically marked by any linter
io.vasp.inputs
io.vasp.inputs
and format tweaks for some other parts
Summary
Separated from #3994 to avoid PR pollution
io.vasp.inputs
mypy
errors by putting propertygetter
andsetter
together, Property setter not accepted if not next to getter python/mypy#1465use-named-expression
withsourcery
, and some other tweakslogger
TODOs:
InitVar
python/mypy#16816):pymatgen/src/pymatgen/io/vasp/sets.py
Lines 373 to 376 in b28c937