aiidalab / aiidalab-qe

AiiDAlab App for Quantum ESPRESSO
https://aiidalab-qe.readthedocs.io/
MIT License
11 stars 14 forks source link

Facilitate checking the input structure details (and raw input files) #352

Open giovannipizzi opened 1 year ago

giovannipizzi commented 1 year ago

Is your feature request related to a problem? Please describe. I run a calculation without relaxation. I want now to check the input structure (in particular, the lattice parameter and the input cell. However:

Analogously, there is (at least after running) no way in the tree view to see the actual SCF calculation, nor to see the raw input and output files (see screenshot): Screenshot from 2023-02-15 12-05-52

Describe the solution you'd like It should be easy to

Describe alternatives you've considered The only way I see is to open a terminal now, load the workflow by PK, load the input structure, and print the coordinates and cell from the cmdline (similarly, check the process status of the workflow and do a calcjob inputcat/outputcat for each QE calc), but we of course need to avoid that people go to the terminal for common tasks.

giovannipizzi commented 1 year ago

PS - I now see that probably I could see the inputs by navigating deep into the PwBandsWorkChain. I cannot provide more feedback because of the crash described in #353, but I will open a new issue to describe some improvements: #354

unkcpz commented 1 year ago

I now see that probably I could see the inputs by navigating deep into the PwBandsWorkChain.

Sadly, you can't. Even we use the generic WorkChain viewer, the inputs are not accessible, since the inputs not defined and show for it. But sure, this is very important feature and I'll see how to add it.

I cannot provide more feedback because of the crash described in https://github.com/aiidalab/aiidalab-qe/issues/353, but I will open a new issue to describe some improvements: https://github.com/aiidalab/aiidalab-qe/issues/354

I fix it at https://github.com/aiidalab/aiidalab-qe/pull/348

danielhollas commented 1 year ago

in the tree view there are only outputs but no inputs

I agree that this would be a useful feature to be able to inspect input nodes. We could add the corresponding inputs directory with all the input nodes. I've opened the corresponding issue on AWB https://github.com/aiidalab/aiidalab-widgets-base/issues/432 A possible disadvantage is performence, I noticed that for large workchains the tree is loading very slowly so this might add extra overhead since all those nodes would need to be fetched from DB.

This would allow us to inspect input geometries and other parameters. However, it wouldn't allow to inspect the QE input since that is generated by the CalcJob and stored in the remote_folder and not fetched back.

giovannipizzi commented 1 year ago

Thanks! Two comments.

Performance-wise, maybe it's possible to just load the name, label, and PK/UUID of the various nodes, and get their contents only if/when they are clicked?

For the raw QE input - it's not correct that the raw input is not stored in AiiDA. It is stored as files directly inside the CalcJob node itself. Therefore, one could either think to add a special "raw input" leaf under "inputs", that actually shows the raw files stored in the CalcJob node, or even have a different directory "Raw inputs" parallel to "inputs". I'm not sure if this is more or less intuitive for a (non-AiiDA) user. If we put a directory "Raw inputs", maybe we should name the other inputs as something else, e.g. "AiiDA inputs" or "node inputs" or some other name?

unkcpz commented 1 year ago

I think we have all ingredients widgets for showing everything related to process, implemented in aiidalab-widgets-base already. The process_list.ipynb of AWB have all such followers. I'll take a look at this and see how far we can reach with the current widgets.

unkcpz commented 1 year ago

(In case I forget in the future) Working on adding test for node tree widgets, some thoughts about how to improve the performance of the widget. As mentioned by @danielhollas, for a large workchain with lots of nested process, the widget when initialize it will traverse all the nested nodes to the end leaf nodes.
Every tree node has a bool attribute named opened, we can only traverse for opened=true nodes. For opened=Falsenodes, it at most unfolded two more levels.

When looking at this code, I make some mistakes to mess up the name for variables between the node of tree widget and node of aiida, the variable name needs to be clean up to avoid ambiguity.

unkcpz commented 11 months ago

We didn't manage to address this issue for the up-coming release, so I'll move it to the next milestone. But I think this is a good feature for the MARVEL review on January, so I will try to work on it in the coming months. It will still be kept in the MARVEL REVIEW roadmap.