diff --git a/electronicparsers/__init__.py b/electronicparsers/__init__.py index 5be4d83c..c70a7884 100644 --- a/electronicparsers/__init__.py +++ b/electronicparsers/__init__.py @@ -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] diff --git a/electronicparsers/cp2k/parser.py b/electronicparsers/cp2k/parser.py index 6f5b46ef..9d524b21 100644 --- a/electronicparsers/cp2k/parser.py +++ b/electronicparsers/cp2k/parser.py @@ -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 = ( diff --git a/electronicparsers/edmft/parser.py b/electronicparsers/edmft/parser.py index fb1a75f1..490c025d 100644 --- a/electronicparsers/edmft/parser.py +++ b/electronicparsers/edmft/parser.py @@ -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(): diff --git a/electronicparsers/magres/parser.py b/electronicparsers/magres/parser.py index ca913ce4..5426e3fa 100644 --- a/electronicparsers/magres/parser.py +++ b/electronicparsers/magres/parser.py @@ -181,7 +181,6 @@ def init_quantities(self): class MagresParser(BeyondDFTWorkflowsParser): - def __init__(self): self.magres_file_parser = MagresFileParser() diff --git a/electronicparsers/tbstudio/parser.py b/electronicparsers/tbstudio/parser.py index 58b57d78..97ba4f95 100644 --- a/electronicparsers/tbstudio/parser.py +++ b/electronicparsers/tbstudio/parser.py @@ -41,7 +41,6 @@ class TBStudioParser(BeyondDFTWorkflowsParser): - def __init__(self): self._calculation_type = 'tight binding' diff --git a/electronicparsers/w2dynamics/parser.py b/electronicparsers/w2dynamics/parser.py index fc058407..75b54d18 100644 --- a/electronicparsers/w2dynamics/parser.py +++ b/electronicparsers/w2dynamics/parser.py @@ -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() diff --git a/electronicparsers/wannier90/parser.py b/electronicparsers/wannier90/parser.py index a1985c2c..fb185ca4 100644 --- a/electronicparsers/wannier90/parser.py +++ b/electronicparsers/wannier90/parser.py @@ -180,7 +180,6 @@ def init_quantities(self): class Wannier90Parser: - def __init__(self): self.wout_parser = WOutParser() self.win_parser = WInParser() diff --git a/tests/test_cp2kparser.py b/tests/test_cp2kparser.py index 215e415c..6ac4711f 100644 --- a/tests/test_cp2kparser.py +++ b/tests/test_cp2kparser.py @@ -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