Skip to content

Commit

Permalink
Linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ladinesa committed Sep 9, 2024
1 parent 9978392 commit 11bfc1c
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
5 changes: 3 additions & 2 deletions electronicparsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ class EntryPoint(ParserEntryPoint):
"""
)
level: int = Field(
0, description='''
0,
description="""
Order of execution of parser with respect to other parsers.
'''
""",
)
code_name: Optional[str]
code_homepage: Optional[str]
Expand Down
8 changes: 6 additions & 2 deletions electronicparsers/cp2k/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1486,10 +1486,14 @@ def parse_settings(self):
sec_startinformation.x_cp2k_start_id = val[0]
sec_endinformation.x_cp2k_end_id = val[1]
elif isinstance(val, int):
self.logger.warning('Calculation may not have properly terminated: did not encounter end "PROCESS ID".')
self.logger.warning(
'Calculation may not have properly terminated: did not encounter end "PROCESS ID".'
)
sec_startinformation.x_cp2k_start_id = val
else:
self.logger.warning('Encountered "PROCESS ID" of unexpected format.')
self.logger.warning(
'Encountered "PROCESS ID" of unexpected format.'
)
pass
continue
section = (
Expand Down
12 changes: 6 additions & 6 deletions electronicparsers/edmft/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,25 +487,25 @@ def create_calculation_section():
# Energies
sec_energy = Energy()
sec_scf_iteration.energy = sec_energy
sec_energy.chemical_potential = data_scf[i_dmft][3] * ureg.eV
sec_energy.chemical_potential = data[3] * ureg.eV
sec_energy.double_counting = EnergyEntry(
value=data_scf[i_dmft][4] * ureg.eV
value=data[4] * ureg.eV
)
sec_energy.total = EnergyEntry(value=data_scf[i_dmft][5] * ureg.rydberg)
sec_energy.free = EnergyEntry(value=data_scf[i_dmft][7] * ureg.rydberg)
sec_energy.total = EnergyEntry(value=data[5] * ureg.rydberg)
sec_energy.free = EnergyEntry(value=data[7] * ureg.rydberg)
# Lattice and impurity occupations
sec_charges_latt = Charges()
sec_scf_iteration.charges.append(sec_charges_latt)
sec_charges_latt.kind = 'lattice'
sec_charges_latt.n_atoms = sec_scc.method_ref.dmft.n_impurities
sec_charges_latt.n_orbitals = n_orbitals
sec_charges_latt.n_electrons = [data_scf[i_dmft][8]]
sec_charges_latt.n_electrons = [data[8]]
sec_charges_imp = Charges()
sec_scf_iteration.charges.append(sec_charges_imp)
sec_charges_imp.kind = 'impurity'
sec_charges_imp.n_atoms = sec_scc.method_ref.dmft.n_impurities
sec_charges_imp.n_orbitals = n_orbitals
sec_charges_imp.n_electrons = [data_scf[i_dmft][9]]
sec_charges_imp.n_electrons = [data[9]]

# Impurity Green's function, self-energy, hybridization function parsing for each calculation step
for imp_path in self._gf_files_map.keys():
Expand Down
1 change: 0 additions & 1 deletion electronicparsers/magres/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def init_quantities(self):


class MagresParser(BeyondDFTWorkflowsParser):

def __init__(self):
self.magres_file_parser = MagresFileParser()

Expand Down
1 change: 0 additions & 1 deletion electronicparsers/tbstudio/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@


class TBStudioParser(BeyondDFTWorkflowsParser):

def __init__(self):
self._calculation_type = 'tight binding'

Expand Down
1 change: 0 additions & 1 deletion electronicparsers/w2dynamics/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def init_quantities(self):


class W2DynamicsParser(BeyondDFTWorkflowsParser):

def __init__(self):
self._re_namesafe = re.compile(r'[^\w]')
self.log_parser = LogParser()
Expand Down
1 change: 0 additions & 1 deletion electronicparsers/wannier90/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def init_quantities(self):


class Wannier90Parser:

def __init__(self):
self.wout_parser = WOutParser()
self.win_parser = WInParser()
Expand Down
4 changes: 3 additions & 1 deletion tests/test_cp2kparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ def test_single_point(parser):
def test_unterminated_section(parser):
"""Test the proper extraction of process ID"""
archive = EntryArchive()
parser.parse('tests/data/cp2k/single_point/si_bulk8_unterminated.out', archive, None)
parser.parse(
'tests/data/cp2k/single_point/si_bulk8_unterminated.out', archive, None
)
assert archive.run[0].x_cp2k_section_startinformation[0].x_cp2k_start_id == 8212


Expand Down

0 comments on commit 11bfc1c

Please sign in to comment.