Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Apr 16, 2024
1 parent 7ccdb0d commit 33a1871
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/nomad_simulations/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,19 @@ class Outputs(ArchiveSection):
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# List of properties
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
electronic_band_gap = SubSection(sub_section=ElectronicBandGap.m_def, repeats=True)

fermi_level = SubSection(sub_section=FermiLevel.m_def, repeats=True)

chemical_potential = SubSection(sub_section=ChemicalPotential.m_def, repeats=True)

electronic_band_gap = SubSection(sub_section=ElectronicBandGap.m_def, repeats=True)

electronic_dos = SubSection(
sub_section=ElectronicDensityOfStates.m_def, repeats=True
)

xas_spectra = SubSection(sub_section=XASSpectra.m_def, repeats=True)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Expand Down
4 changes: 3 additions & 1 deletion src/nomad_simulations/physical_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ def _new_value(self) -> Quantity:
description=quant.description,
)

def __init__(self, m_def: Section = None, m_context: Context = None, **kwargs):
def __init__(
self, m_def: Section = None, m_context: Context = None, **kwargs
) -> None:
super().__init__(m_def, m_context, **kwargs)
if self.iri is None:
logger.warning(
Expand Down
4 changes: 3 additions & 1 deletion src/nomad_simulations/properties/band_gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ class ElectronicBandGap(PhysicalProperty):
""",
)

def __init__(self, m_def: Section = None, m_context: Context = None, **kwargs):
def __init__(
self, m_def: Section = None, m_context: Context = None, **kwargs
) -> None:
super().__init__(m_def, m_context, **kwargs)
self.name = self.m_def.name
self.rank = []
Expand Down
8 changes: 6 additions & 2 deletions src/nomad_simulations/properties/energies.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class FermiLevel(PhysicalProperty):
""",
)

def __init__(self, m_def: Section = None, m_context: Context = None, **kwargs):
def __init__(
self, m_def: Section = None, m_context: Context = None, **kwargs
) -> None:
super().__init__(m_def, m_context, **kwargs)
self.rank = []

Expand All @@ -61,7 +63,9 @@ class ChemicalPotential(PhysicalProperty):
""",
)

def __init__(self, m_def: Section = None, m_context: Context = None, **kwargs):
def __init__(
self, m_def: Section = None, m_context: Context = None, **kwargs
) -> None:
super().__init__(m_def, m_context, **kwargs)
self.rank = []

Expand Down
14 changes: 10 additions & 4 deletions src/nomad_simulations/properties/spectral_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ class SpectralProfile(PhysicalProperty):
# """,
# )

def __init__(self, m_def: Section = None, m_context: Context = None, **kwargs):
def __init__(
self, m_def: Section = None, m_context: Context = None, **kwargs
) -> None:
super().__init__(m_def, m_context, **kwargs)
self.rank = [] # ? Is this here or in the attrs instantiation better?

Expand Down Expand Up @@ -138,7 +140,9 @@ class ElectronicDensityOfStates(SpectralProfile):
""",
)

def __init__(self, m_def: Section = None, m_context: Context = None, **kwargs):
def __init__(
self, m_def: Section = None, m_context: Context = None, **kwargs
) -> None:
super().__init__(m_def, m_context, **kwargs)
self.name = self.m_def.name

Expand All @@ -152,7 +156,7 @@ def resolve_fermi_level(self) -> Optional[np.float64]:
fermi_level = self.fermi_level
# if fermi_level is None:
# fermi_level = resolve_output_value(self, FermiLevel)
# return fermi_level
return fermi_level

def check_spin_polarized(self) -> bool:
"""
Expand Down Expand Up @@ -224,7 +228,9 @@ class XASSpectra(SpectralProfile):
repeats=False,
)

def __init__(self, m_def: Section = None, m_context: Context = None, **kwargs):
def __init__(
self, m_def: Section = None, m_context: Context = None, **kwargs
) -> None:
super().__init__(m_def, m_context, **kwargs)
# Set the name of the section
self.name = self.m_def.name
Expand Down

0 comments on commit 33a1871

Please sign in to comment.