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

Clean up io.vasp.outputs.Outcar docstring #4160

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

DanielYang59
Copy link
Contributor

@DanielYang59 DanielYang59 commented Nov 9, 2024

Clean up io.vasp.outputs.Outcar docstring/comment

  • Clarify docstring: Renders accessible from self.data (the internal self.data dictionary) vs Renders accessible from attributes (instance attributes)
  • Finish a lot of TODOs in docstring (mostly missing/incomplete type/description)
  • Add NBANDS reading in another PR, need to generate some reference OUTCAR/vasprun.xml files

Clean up util.io_util.micro_pyawk

Warning

The debug/postdebug is likely debug args, no usage across the entire code bass, schedule them for removal after one-year grace period in case someone really need them.

@DanielYang59 DanielYang59 changed the title Clean up io.vasp.Outcar docstring Clean up io.vasp.outputs.Outcar docstring Nov 9, 2024
@@ -2323,7 +2326,7 @@ def read_table_pattern(
attribute_name: str | None = None,
last_one_only: bool = True,
first_one_only: bool = False,
) -> list:
) -> list: # TODO: clarify table-like data type
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tag: important: clarify type of table-like data

@DanielYang59 DanielYang59 force-pushed the outcar-parse-nbands branch 2 times, most recently from dfb33f7 to 404ed50 Compare November 9, 2024 10:27


umask = os.umask(0)
os.umask(umask)
Copy link
Contributor Author

@DanielYang59 DanielYang59 Nov 9, 2024

Choose a reason for hiding this comment

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

I believe this is doing nothing (set umask to 0, but reset it back the original umask immediately)

@@ -2605,7 +2703,7 @@ def read_nmr_efg_tensor(self) -> list[NDArray]:
"""Parses the NMR Electric Field Gradient Raw Tensors.

Returns:
A list of Electric Field Gradient Tensors in the order of Atoms from OUTCAR.
list[NDArray]: Electric Field Gradient Tensors in the order of atoms.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

double check type

@@ -2046,7 +2071,8 @@ def __init__(self, filename: PathLike) -> None:
e_wo_entrp = float(match[1])
if e0 is None and (match := e0_pattern.search(clean)):
e0 = float(match[1])
if all([nelect, total_mag is not None, efermi is not None, run_stats]):

if nelect is not None and total_mag is not None and efermi is not None and run_stats:
Copy link
Contributor Author

@DanielYang59 DanielYang59 Nov 12, 2024

Choose a reason for hiding this comment

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

Tag: use truthy to check run_stats (dict[str, float | None]) might yield unexpected results as None as dict value ({"a": None}) is also truthy

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.

1 participant