Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Sep 27, 2024
1 parent c30e13f commit 776929e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nomad_parser_wannier90/parsers/win_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def get_branch_label_and_atom_indices(
atom: Union[str, int],
atomic_cell: AtomicCell,
units: str,
) -> tuple[Optional[str], list[int]]:
) -> tuple[str, list]:
"""
Gets the branch label and the atom indices for the child model system.
Expand All @@ -179,8 +179,8 @@ def get_branch_label_and_atom_indices(
return '', [atom]

# 3 different cases to define in `win`
symbols = ''
indices = []
symbols: list[str] = []
indices: list[int] = []
# If the atom is not a chemical element, we use the `_convert_position` method resolution for it, joining the `symbols` into a long string
if atom.startswith('f='): # fractional coordinates
indices, symbols = self._get_f_information(
Expand Down Expand Up @@ -226,7 +226,7 @@ def populate_orbitals_state(
return '', [atom]

# Initial check for the `atom` and their `indices`
indices = []
indices: list[int] = []
if atom.startswith('f='):
indices, _ = self._get_f_information(
atom=atom, atomic_cell=atomic_cell, units=units
Expand Down
1 change: 1 addition & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def test_minimal_Pt_Vikrant(parser):
assert simulation.model_method[0].m_def.name == 'Wannier'
wannier = simulation.model_method[0]
assert wannier.is_maximally_localized
# 's', 'p', 'd' deg orbitals used for all 4 Pt -> 4 * 3 = 12 orbitals * 3 Pt atoms per unit cell = 36
assert wannier.n_orbitals == 36
assert wannier.n_bloch_bands == 240
assert np.isclose(wannier.energy_window_inner.magnitude, [8.80301, 11.80301]).all()
Expand Down

1 comment on commit 776929e

@github-actions
Copy link

Choose a reason for hiding this comment

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

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/nomad_parser_wannier90
   __init__.py4250%3–4
   _version.py11282%5–6
src/nomad_parser_wannier90/parsers
   __init__.py10280%24–26
   band_parser.py511571%4, 24, 50–51, 73–74, 77–78, 85–89, 98–99, 104–105
   dos_parser.py18194%13
   hr_parser.py48981%4, 28, 46–47, 59–60, 94–96
   parser.py2243883%8–9, 215, 269–270, 310, 367–368, 385, 402, 419, 475–478, 508, 539–587
   win_parser.py1212480%5, 35–36, 65, 145–147, 179, 186, 226, 231, 241–242, 252–253, 283–286, 293, 295–296, 300, 317–321
src/nomad_parser_wannier90/parsers/utils
   utils.py291355%4, 35–37, 56–71
src/nomad_parser_wannier90/schema_packages
   __init__.py8275%9–11
   package.py550%1–11
TOTAL53011379% 

Tests Skipped Failures Errors Time
2 0 💤 0 ❌ 0 🔥 14.066s ⏱️

Please sign in to comment.