Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run_if_interactive(self):
if self.structure.calc is None:
kpoints = self.input["kpoints"]
if isinstance(kpoints, str):
kpoints = (
self.input["kpoints"].replace("[", "").replace("]", "").split()
)
self._create_working_directory()
calc = GPAW(
mode=PW(float(self.input["encut"])),
xc=self.input["potential"],
occupations=MethfesselPaxton(width=float(self.input["sigma"])),
kpts=kpoints,
txt=self.working_directory + "/" + self.job_name + ".txt",
)
self.structure.set_calculator(calc)
self.status.running = True
self.structure.calc.calculate(self.structure)
self.interactive_collect()