-
Notifications
You must be signed in to change notification settings - Fork 14
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
DOC: add section on how to write plugin #463
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #463 +/- ##
=======================================
Coverage 79.07% 79.07%
=======================================
Files 47 47
Lines 3211 3211
=======================================
Hits 2539 2539
Misses 672 672
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
docs/source/development/plugin.rst
Outdated
workchain_and_builder = { | ||
"workchain": HelloWorldWorkChain, | ||
"get_builder": get_builder, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite an essential specification of the workchain definition. If I understand correctly, the key name and the value type can not be changed. So I would recommend to add a validator to the function who use this value and raise proper exception if the user passes an invalid dictionary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I opened issue #503 for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @superstar54. Here is first go, I add some comments. I think there are more need to change can you first try to add a line break to every sentence so it is easy to review?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the description of the plugin the line "A aiidalab-qe plugin to print hello world" indent properly. I know it is the description, but seems like an isolated line. Maybe put a border on the widget?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this description line from the plugin.
Wizards UI | ||
========== | ||
|
||
Quantum ESPRESSO app (QeApp) uses the Wizards UI, which divides one calculation into four steps. Each step may contain several sections (panels), as shown below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quantum ESPRESSO app (QeApp) uses the Wizards UI, which divides one calculation into four steps. Each step may contain several sections (panels), as shown below. | |
Quantum ESPRESSO app uses the `WizardAppWidget` to divide one calculation into four steps. | |
Each step can contain several sections (panels), as shown below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to use the Wizards UI
instead of the class name WizardAppWidget
. Here we give the overview of the architecture instead of detailed code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @superstar54, the reading experience is smooth. I have quite some nitpick changes please have a look. I'd ask @mikibonacci to have a look as well because he is the real user of this new feature.
Two points require discussion:
- Using the name "Hello world" or "Structure Render" for the demo plugin?
- Using a gif to show the tabs displayed or two static figures?
I'd just wait for you two to vote and then Xing can start to change, no need to involve more people from the team I guess, better if @AndresOrtegaGuerrero also want to have a look and vote? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is not very clear, in the text it says "when the user selects to run the properties." but here the properties are not shown. Could you include the properties list and maybe using two figures to show the differents before and after selecting a new property?
Only if you agree with my suggestion, I think PS and replot the figures are tedious and may not make things better, I'll pining @mikibonacci for comments to see which way is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will vote for Hello world (if we do not use MultiplyAdd instead) and for the gif, as it will be more dynamic and less tedious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late, I am pro Hello world since this is more a feature for developers, though i would be more incline to specify something like "Plugin: Custom Property" or "Plugin: Your New Feature" (or property) i think is more related to the idea that each plugin is linked to a new property
docs/source/development/plugin.rst
Outdated
from aiidalab_qe.common.panel import ResultPanel | ||
|
||
class Result(ResultPanel): | ||
title = "Hello world" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, "hello world" example is used very specifically for programming language, I guess even aiida plugin didn't use a "hello world" example. Here more specific name could be better. Please consider to change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use the "MultiplyAddWorkChain" from AiiDA tutorial? https://aiida.readthedocs.io/projects/aiida-core/en/latest/intro/tutorial.html . This is just a detail, but maybe we can make the very same example.
Hi @unkcpz @mikibonacci @AndresOrtegaGuerrero , thanks all for reviewing the PR and suggestions. I replaced the
I also add examples of the latest features:
Please give it another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super cool!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the work, Xing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! Some tiny requests, ready to ship then. @superstar54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks all good to me. thanks and nice work! @superstar54
This PR adds the doc for the plugin.