def _reload(self):
     pr = Project(path=self._job_project_path)
     self._job = pr.load(self._job_name)
     self._job.interactive_open()
     self._job.interactive_initialize_interface()
     self._job.calc_static()
     self._job.run(run_again=True)
    def _initialize(self, ref_job_full_path, structure):
        loc = self.get_graph_location()
        name = loc + '_job'
        project_path, ref_job_path = split(ref_job_full_path)
        pr = Project(path=project_path)
        ref_job = pr.load(ref_job_path)
        job = ref_job.copy_to(project=pr,
                              new_job_name=name,
                              input_only=True,
                              new_database_entry=True)

        if structure is not None:
            job.structure = structure

        if isinstance(job, GenericInteractive):
            job.interactive_open()

            if isinstance(job, LammpsInteractive) and self._fast_lammps_mode:
                # Note: This might be done by default at some point in LammpsInteractive, and could then be removed here
                job.interactive_flush_frequency = 10**10
                job.interactive_write_frequency = 10**10
                self._disable_lmp_output = True

            job.calc_static()
            job.run(run_again=True)
            # TODO: Running is fine for Lammps, but wasteful for DFT codes! Get the much cheaper interface
            #  initialization working -- right now it throws a (passive) TypeError due to database issues
        else:
            raise TypeError('Job of class {} is not compatible.'.format(
                ref_job.__class__))
        self._job = job
        self._job_name = name
        self._job_project_path = project_path