Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clears output for restarted jobs #1549

Merged
merged 8 commits into from
Aug 28, 2024
17 changes: 13 additions & 4 deletions pyiron_atomistics/sphinx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,8 @@ def restart(
)
if recreate_guess:
new_job.load_guess_group()

new_job.output.clear_output_for_restart() # temporary fix for clearing output for restarted jobs (restarted jobs copy output of parent job)
return new_job

def relocate_hdf5(self, h5_path=None):
Expand Down Expand Up @@ -1888,10 +1890,10 @@ class Output:

def __init__(self, job):
self._job = job
self.generic = DataContainer(table_name="output/generic")
self.charge_density = SphinxVolumetricData()
self.electrostatic_potential = SphinxVolumetricData()
self.generic.create_group("dft")
self.generic = None
skatnagallu marked this conversation as resolved.
Show resolved Hide resolved
self.charge_density = None
self.electrostatic_potential = None
self.clear_output_for_restart()
skatnagallu marked this conversation as resolved.
Show resolved Hide resolved
self.old_version = False

def collect_spins_dat(self, file_name="spins.dat", cwd=None):
Expand Down Expand Up @@ -2151,6 +2153,13 @@ def from_hdf(self, hdf):
self.old_version = True
pass

def clear_output_for_restart(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you call the same clear_output_for_restart() function in the __init__() function of the Output class? This hopefully prevents us from changing both independent from each other.

"""Clears the output for restarted job. Temporary fix."""
skatnagallu marked this conversation as resolved.
Show resolved Hide resolved
self.generic = DataContainer(table_name="output/generic")
self.charge_density = SphinxVolumetricData()
self.electrostatic_potential = SphinxVolumetricData()
self.generic.create_group("dft")


def _update_datacontainer(job):
job.output.generic.create_group("dft")
Expand Down
Loading