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

plot_kkr fails with kkr_imp_wc, combine_imps_wc workchains #131

Open
Irratzo opened this issue May 25, 2023 · 0 comments
Open

plot_kkr fails with kkr_imp_wc, combine_imps_wc workchains #131

Irratzo opened this issue May 25, 2023 · 0 comments
Assignees

Comments

@Irratzo
Copy link
Member

Irratzo commented May 25, 2023

Description

plot_kkr fails with kkr_imp_wc, combine_imps_wc workchains. It works with kkr_scf_wc workchains (plots convergence plot and structure plot). The used workchains were plotted successfully before with kkr_plot. Now the Python environment changed, and the reported error occurs.

Here is the command. This was called in a JupyterLab cell.

node=wc # structure, wc
plot_kkr(node)

Here is plot_kkr's node info output, here for a kkr_imp_wc workchain.

pk, uuid: 1967 04af6117-7876-463b-9d33-b50d06baeca1
type: <class 'aiida.orm.nodes.process.workflow.workchain.WorkChainNode'>
label: Mg:Mg
description: Impurity embeddings for machine learning: impurity workchain host-in-host
process type: aiida.workflows:kkr.imp
state: ProcessState.FINISHED

inputs:
[<Code: Remote code 'kkrhost' on claix18 pk: 1251, uuid: 4dfd4d2c-ccae-481c-a500-65dbfd9afd65>,
 <Dict: uuid: 763877cd-a740-4058-9c10-620617bce9f0 (pk: 2450)>,
 <Dict: uuid: 566ff0e2-58ea-4310-a44a-096a5de9c5aa (pk: 1290)>,
 <Code: Remote code 'voronoi' on localhost pk: 1502, uuid: 8cf8b857-db8b-46dd-893d-bbc351143128>,
 <RemoteData: uuid: e3c22a78-6e32-4db8-a19c-e3dfe13729c7 (pk: 2828)>,
 <Code: Remote code 'kkrimp' on claix18 pk: 1583, uuid: a0aa3ab7-d00d-463f-bf23-979856ba99f1>,
 <Dict: uuid: 41314c47-a2c1-4d77-86fe-79bc769c4591 (pk: 2242)>]

outputs:
[<SinglefileData: uuid: ceff90d7-8852-4b01-99fe-549efe0f0507 (pk: 3757)>,
 <Dict: uuid: 54b332f0-1aff-4229-8870-f967a3229772 (pk: 3295)>,
 <RemoteData: uuid: 2e6bc7f1-4ad1-4c22-8dd4-ec45f3b72abb (pk: 2148)>,
 <Dict: uuid: fc0707bd-4b23-4a04-9c27-989ff227aa87 (pk: 3928)>,
 <Dict: uuid: 82ebd0c5-d034-4600-bb6e-d8078bba9677 (pk: 3463)>,
 <CalcFunctionNode: uuid: 1875ca53-20db-4bb2-98fa-dba106c280a3 (pk: 3032) (aiida_kkr.tools.common_workfunctions.neworder_potential_wf)>,
 <CalcFunctionNode: uuid: ce80e8a0-791d-44ad-aca5-cd2f5c2e5baa (pk: 3756) (aiida_kkr.tools.common_workfunctions.update_params_wf)>,
 <CalcFunctionNode: uuid: f2896224-730f-4069-902b-856decb78bfe (pk: 3889) (aiida_kkr.workflows.kkr_imp.change_struc_imp_aux_wf)>,
 <CalcFunctionNode: uuid: 53fce5bd-2863-4434-a3b5-6d659ae5c7ba (pk: 3291) (aiida_kkr.tools.common_workfunctions.update_params_wf)>,
 <CalcFunctionNode: uuid: e5dd92e3-8102-4dd0-abb2-cd68b19c5d5e (pk: 3848) (aiida_kkr.tools.save_output_nodes.create_out_dict_node)>,
 <WorkChainNode: uuid: f9cc5762-08b7-4a5c-9871-ebbaf24df095 (pk: 3918) (aiida.workflows:kkr.startpot)>,
 <WorkChainNode: uuid: 21e35c48-fea1-4788-9bfc-d950fdfd1313 (pk: 2101) (aiida.workflows:kkr.gf_writeout)>,
 <WorkChainNode: uuid: f850ead0-2463-4a4b-a1a8-6fcc8ce98ffa (pk: 3911) (aiida.workflows:kkr.imp_sub)>]

exit status: 0 (None)

Here is the error message that followed, instead of the convergence plot.

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[36], line 2
      1 node=wc # structure, wc
----> 2 plot_kkr(node)

File /opt/aiida-kkr/aiida_kkr/tools/plot_kkr.py:391, in plot_kkr.__init__(self, nodes, **kwargs)
    389     show()
    390 elif nodes is not None:
--> 391     self.plot_kkr_single_node(nodes, **kwargs)
    393     display = kwargs.get('display', True)
    394     if display and self.sview is not None:  #self.classify_and_plot_node(nodes, return_name_only=True)=='struc':

File /opt/aiida-kkr/aiida_kkr/tools/plot_kkr.py:465, in plot_kkr.plot_kkr_single_node(self, node, **kwargs)
    462     self.print_clean_inouts(node)
    464 # classify node and call plotting function
--> 465 self.classify_and_plot_node(node, silent=silent, **kwargs)
    467 if not noshow:
    468     from matplotlib.pyplot import show

File /opt/aiida-kkr/aiida_kkr/tools/plot_kkr.py:530, in plot_kkr.classify_and_plot_node(self, node, return_name_only, **kwargs)
    528     if return_name_only:
    529         return 'imp'
--> 530     self.plot_kkrimp_wc(node, **kwargs)
    531 elif node.process_label == u'kkr_imp_sub_wc':
    532     if return_name_only:

File /opt/aiida-kkr/aiida_kkr/tools/plot_kkr.py:1071, in plot_kkr.plot_kkrimp_wc(self, node, **kwargs)
   1069 sub_wf = [i.node for i in node.get_outgoing(node_class=kkr_imp_sub_wc).all()]
   1070 if len(sub_wf) > 0:
-> 1071     self.plot_kkrimp_sub_wc(sub_wf[0], **kwargs)

File /opt/aiida-kkr/aiida_kkr/tools/plot_kkr.py:1111, in plot_kkr.plot_kkrimp_sub_wc(self, node, **kwargs)
   1108 else:
   1109     ptitle = f'pk= {node.pk}'
-> 1111 self.make_kkrimp_rmsplot(rms_all, stot_all, pks_all, rms_goal, ptitle, **kwargs)

File /opt/aiida-kkr/aiida_kkr/tools/plot_kkr.py:1146, in plot_kkr.make_kkrimp_rmsplot(self, rms_all, stot_all, pks_all, rms_goal, ptitle, **kwargs)
   1144 reorder_rms = array(pks_all).argsort()
   1145 rms, niter_calcs, stot = [], [0], []
-> 1146 for i in array(rms_all)[reorder_rms]:
   1147     rms += list(i)
   1148     niter_calcs.append(len(i) - 0.5)

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

System & version info.

"iffaiida" is a JupyterHub service. Jupyter and the Python env run inside an Ubuntu Docker container. The used Python environment complete version info is here.

# system info
$ cat /etc/iffaiida-release

BRANCH=master
HOST=iffaiida
IMAGE=iffaiida/aiida-v2
VERSION=2023.05.25

# version info
$ which python
$ python --version
$ pip list | grep -e "aiida-core" -e "masci-tools" -e "aiida-kkr"

/opt/aiida-kernel/bin/python
Python 3.8.10
aiida-core                        2.3.0       /opt/aiida-core
aiida-kkr                         2.0.0       /opt/aiida-kkr
masci-tools                       0.15.0      /opt/masci-tools

JuperLab Version 3.6.0rc0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant