Skip to content

Commit

Permalink
Add to return ion_files and retrived folder in the BandGapWorkChain
Browse files Browse the repository at this point in the history
  • Loading branch information
bosonie committed May 19, 2021
1 parent 2618e28 commit c1772fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions aiida_siesta/workflows/bandgap.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,25 @@ def run_last(self):
return ToContext(final_run=running)

def run_results(self):

from aiida.common import LinkType

if self.ctx.need_fin_step:
if not self.ctx.final_run.is_finished_ok:
return self.exit_codes.ERROR_FINAL_WC
outps = self.ctx.final_run.outputs
outps = self.ctx.final_run.get_outgoing(link_type=LinkType.RETURN).nested()
self.out('output_structure', self.ctx.final_run.inputs.structure)
else:
outps = self.ctx.workchain_base.outputs
outps = self.ctx.workchain_base.get_outgoing(link_type=LinkType.RETURN).nested()

if 'forces_and_stress' in outps:
self.out('forces_and_stress', outps['forces_and_stress'])
self.out('bands', outps['bands'])
self.out('output_parameters', outps['output_parameters'])
self.out('remote_folder', outps['remote_folder'])
self.out('retrieved', outps['retrieved'])
if 'ion_files' in outps:
self.out('ion_files', outps['ion_files'])

self.report("Obtaining the band gap")
out_par = outps['output_parameters']
Expand Down
3 changes: 3 additions & 0 deletions tests/workflows/test_bandgap.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ def test_final_run(aiida_profile, fixture_localhost, generate_workchain_bandgap,
out_bands = bands
out_bands.store()
out_bands.add_incoming(fin_basewc, link_type=LinkType.RETURN, link_label='bands')

retrieved = orm.FolderData().store()
retrieved.add_incoming(fin_basewc, link_type=LinkType.RETURN, link_label='retrieved')

process.ctx.workchain_base = fin_basewc
process.run_results()
Expand Down

0 comments on commit c1772fc

Please sign in to comment.