pyiron / pyiron_atomistics

pyiron_atomistics - an integrated development environment (IDE) for atomistic simulation in computational materials science.
https://pyiron-atomistics.readthedocs.io
BSD 3-Clause "New" or "Revised" License
42 stars 15 forks source link

get_structure() for sphinx jobs gives error #1378

Open skatnagallu opened 4 months ago

skatnagallu commented 4 months ago

Summary

running get_structure() for sphinx job gives error (IndexError: ('cell at step ', 25, ' not found')). Sphinx Job is a DFT relaxation job. and cell typically doesn't change for each step.

job = pr.load('sphinx_job')
job.get_structure(i) # i>0 gives the error.
samwaseda commented 4 months ago

I should open a PR or are you going to work on it?

skatnagallu commented 4 months ago

@samwaseda I wanted to confirm before I made any changes. The only part in sphinx base, where cells are written to output is here

        if "cells" not in self.generic.list_nodes():
            self.generic.cells = np.array([self._job.structure.cell.tolist()])

So as you said changing this line to

        if "cells" not in self.generic.list_nodes():
            self.generic.cells = np.tile(np.array([self._job.structure.cell.tolist()]),(len(self.generic.energy_tot),1,1))

should work?

samwaseda commented 4 months ago

Yeah I guess this would work. But this has to be implemented in SPHInX base

skatnagallu commented 4 months ago

But sphinx base output class has no property of cells. should I then create it?

samwaseda commented 4 months ago

Yes

skatnagallu commented 4 months ago

The issue still exists. As @freyso and I discussed today, the get_structure() method tries to get the cell information from the output level, where as the modifications we did work on output.generic level. So I guess we could debate at which level the methods should access the data? And how do we fix this?