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

Bug report: Application crashed with NotExistentAttributeError #202

Closed
unkcpz opened this issue Feb 15, 2022 · 8 comments · Fixed by #206
Closed

Bug report: Application crashed with NotExistentAttributeError #202

unkcpz opened this issue Feb 15, 2022 · 8 comments · Fixed by #206
Assignees
Labels
automated-report bug Something isn't working
Milestone

Comments

@unkcpz
Copy link
Member

unkcpz commented Feb 15, 2022

magnetism metal bandstructure calculation

The input structure is O.cif with bandstructure on and pdos on.

#======================================================================

# CRYSTAL DATA

#----------------------------------------------------------------------

data_VESTA_phase_1


_pd_phase_name                         'O                                     '
_cell_length_a                         4.27163
_cell_length_b                         4.27682
_cell_length_c                         4.57148
_cell_angle_alpha                      90
_cell_angle_beta                       66.72128
_cell_angle_gamma                      90
_symmetry_space_group_name_H-M         'P 1'
_symmetry_Int_Tables_number            1

loop_
_symmetry_equiv_pos_as_xyz
   'x, y, z'

loop_
   _atom_site_label
   _atom_site_occupancy
   _atom_site_fract_x
   _atom_site_fract_y
   _atom_site_fract_z
   _atom_site_thermal_displace_type
   _atom_site_B_iso_or_equiv
   _atom_site_type_symbol
   O1       1.0    0.93782      0            0.14667     Biso  1.000  O
   O2       1.0    0.06218      0            0.85333     Biso  1.000  O
   O3       1.0    0.43782      0.50000      0.14667     Biso  1.000  O
   O4       1.0    0.56218      0.50000      0.85333     Biso  1.000  O

Automated report

This issue was created with the app's automated bug reporting feature.
Attached to this issue is the full traceback as well as an environment
fingerprint that contains information about the operating system as well as all
installed libraries.

Additional comments (optional):

Example: I submitted a band structure calculation for Silica.

Attachments

Traceback
~/apps/quantum-espresso/aiidalab_qe/node_view.py in __init__(self, node, **kwargs)
    460 
    461         self.result_tabs.observe(on_selected_index_change, "selected_index")
--> 462         self._update_view()
    463 
    464         super().__init__(

~/apps/quantum-espresso/aiidalab_qe/node_view.py in _update_view(self)
    488                 and "band_structure" in self.node.outputs
    489             ):
--> 490                 self._show_band_structure()
    491                 self._results_shown.add("band_structure")
    492 

~/apps/quantum-espresso/aiidalab_qe/node_view.py in _show_band_structure(self)
    499 
    500     def _show_band_structure(self):
--> 501         data = export_data(self.node)
    502         bands_data = data.get("bands", None)
    503         dos_data = data.get("dos", None)

~/apps/quantum-espresso/aiidalab_qe/node_view.py in export_data(work_chain_node)
    170 def export_data(work_chain_node):
    171     return dict(
--> 172         bands=export_bands_data(work_chain_node), dos=export_pdos_data(work_chain_node)
    173     )
    174 

~/apps/quantum-espresso/aiidalab_qe/node_view.py in export_pdos_data(work_chain_node)
    130         pdos_orbitals = []
    131 
--> 132         for orbital, pdos, energy in work_chain_node.outputs.projections.get_pdos():
    133             orbital_data = orbital.get_orbital_dict()
    134             kind_name = orbital_data["kind_name"]

/opt/conda/lib/python3.7/site-packages/aiida/orm/utils/managers.py in __getattr__(self, name)
    147             raise NotExistentAttributeError(
    148                 f"Node<{self._node.pk}> does not have an {prefix} with link label '{name}'"
--> 149             ) from exception
    150 
    151     def __contains__(self, key):

NotExistentAttributeError: Node<429> does not have an output with link label 'projections'
Environment fingerprint
eNpdWFtv47gV_iuB-7oSbPkSO2-LFH0oZtppM9OiKIoFJdE2bYpkSCqOspj_3nOTrCySF30kD8_1O4f-ffGmYzLeLZ5WvyyCVfno
Y7d4-n2hYnM2WTe5j3rx9N_FblObvPhlsfgf7Bvy2bvfpqOLdflYHmDxjvxptaqKH3Xvcv_w8vXbw_dz__AXXT-
sH1brp-3yabt9-PH9-aFaVtXiJ0hUzVWddKKbjWlV0Xi8d7Eqd-UWJDPoQzad-
cCFZbkpl9NCSLpvPcG7cj3Br70CBTqdQtQpedJ0W1bTekopFDcfr0frb3S6Kpf1alrP3ttE-Pou1aoaoGpVruB_BhbaOtr7B_gV1
a0qFP0ZppubszKODP20ejPtSedU1CqxG9Yi1BfBXBVAu3IvRyBir2Sa7LHtRXcDqXIQRH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9SUHvDrP_cVG7OrT-NpmKAbw1MTtP7GMN60zAIWC8NT34lAFA78KW8f5fyArmdtbZjTtAVN
IbBu9-1aXp1ilxeCjoaj6OHNGN8Z9yXk6sn58x-77jB7J5HfRCA9800Pq7kmTZA7s0eZR8mBBKBBPPz5_8B5x0blA==

By submitting this issue I confirm that I am aware that this information can
potentially be used to determine what kind of calculation was performed at the
time of error.

@unkcpz unkcpz added bug Something isn't working automated-report labels Feb 15, 2022
@mbercx
Copy link
Member

mbercx commented Feb 15, 2022

Indeed, the current approach for obtaining the PDOS data does not consider spin-polarised calculations. In this case the output port is not just projections, but there are two (projections_up, and projections_down):

https://github.com/aiidateam/aiida-quantumespresso/blob/e3268c573dd543f63b3770bf9902a5c43dd2bec0/aiida_quantumespresso/calculations/projwfc.py#L53-L54

I don't think @dou-du's widget can currently elegantly plot up and down states (also related to #104). I think the best approach for fixing this issue for now is to add the up and down PDOS together.

@unkcpz
Copy link
Member Author

unkcpz commented Feb 15, 2022

Thanks @mbercx.

I don't think @dou-du's widget can currently elegantly plot up and down states (also related to #104).

Yes, I was checking this one. So this issue is caused by qe-app. But I find the QeWorkChain also failed. Let me check the error message and paste it here.

@unkcpz
Copy link
Member Author

unkcpz commented Feb 15, 2022

  File "/opt/conda/lib/python3.7/site-packages/plumpy/process_states.py", line 231, in execute
    result = self.run_fn(*self.args, **self.kwargs)
  File "/opt/conda/lib/python3.7/site-packages/aiida/engine/processes/workchains/workchain.py", line 214, in _do_step
    finished, stepper_result = self._stepper.step()
  File "/opt/conda/lib/python3.7/site-packages/plumpy/workchains.py", line 299, in step
    finished, result = self._child_stepper.step()
  File "/opt/conda/lib/python3.7/site-packages/plumpy/workchains.py", line 250, in step
    return True, self._fn(self._workchain)
  File "/home/aiida/.local/lib/python3.7/site-packages/aiidalab_qe_workchain/__init__.py", line 329, in results
    "projections", self.ctx.workchain_pdos.outputs.projwfc__projections
  File "/opt/conda/lib/python3.7/site-packages/aiida/engine/processes/process.py", line 355, in out
    return super().out(output_port, value)
  File "/opt/conda/lib/python3.7/site-packages/plumpy/processes.py", line 81, in func_wrapper
    return func(self, *args, **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/plumpy/processes.py", line 1276, in out
    raise ValueError(msg)
ValueError: Error validating output 'projections' for port 'outputs': Unexpected ports {'result': 'projections'}, for a non dynamic namespace

@mbercx
Copy link
Member

mbercx commented Feb 21, 2022

@unkcpz indeed, that's the same error I encounter.

Working on a fix now. Seems the energy arrays for projections_up and projections_down are _slightly different:

np.all(np.isclose(proj_down.get_pdos()[0][1], proj_up.get_pdos()[0][1], rtol=0, atol=1e-4))

returns False, but:

np.all(np.isclose(proj_down.get_pdos()[0][1], proj_up.get_pdos()[0][1], rtol=0, atol=1e-3))

returns True. I think for now this isn't a massive issue, but I'm slightly surprised they aren't the same.

@mbercx
Copy link
Member

mbercx commented Feb 21, 2022

Note that the DOS will also be split up in dos_spin_up and dos_spin_down arrays, both stored in a single XyData. Again I would suggest just adding the two together, until @dou-du's widget is able to plot up vs down states.

@mbercx
Copy link
Member

mbercx commented Feb 21, 2022

Another thing to note here: If we really want to represent the results properly, perhaps we should check if the end result is actually magnetic. If not, we should have a non-magnetic representation.

@mbercx mbercx added this to the 2022.03.0 milestone Feb 22, 2022
@mbercx
Copy link
Member

mbercx commented Feb 22, 2022

So, I can't plot both the up and down states with the current widget-bandsplot, since it adds the PDOS together by orbital type (s, p, d, f), which is based on the first character in the value corresponding to the "orbital" key, which represents the orbital name:

https://github.com/osscar-org/widget-bandsplot/blob/8cece372479063de3e7a63877a823d2cfb784fc7/widget_bandsplot/bandsplot.py#L78-L89

So for now we can't distinguish up and down states in the widget.

@unkcpz
Copy link
Member Author

unkcpz commented Feb 22, 2022

@mbercx Thanks for checking this.

Another thing to note here: If we really want to represent the results properly, perhaps we should check if the end result is actually magnetic. If not, we should have a non-magnetic representation.

I personally will not like this feature. It is too much intelligent to guess and 'correct' what the user wants to do. Maybe they explicitly gonna check the input structure is no magnetism. This is quite normal I guess even if the structure contains the magnetic elements they still reveal the difference between spin up and spin down.

@unkcpz unkcpz modified the milestones: 2022.03.0, 2022.04.0 Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated-report bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants