-
Notifications
You must be signed in to change notification settings - Fork 216
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
Add data plugin command entry point #993
Conversation
@DropD very much looking forward to this one! |
@ltalirz Tests are passing now, it was only a missing requirement. |
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 fine to me, I'm just struggling to get it to work. How do I need to decorate my cli function now such that it is recognised?
I tried a few things in the aiida-plugin-template, but I didn't manage to get it to work (data plugin didn't show up in verdi data
).
Please provide a brief example or documentation.
I will add documentation with links to |
908c925
to
34f9eb5
Compare
@ltalirz please check this out, build the documentation and try to use Developers guide > Developer commandline plugin tutorial. |
|
||
Append to file ``float_cmd.py``:: | ||
|
||
@float_cmd.command() |
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.
Don't you need @float_cmd.command('export')
here?
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.
Nope, the command decorator uses the function name by default. I will add a paragraph explaining this. The changes are added in 7cfd00a.
|
||
The discovery of plugins via entry points follows exactly the same mechanisms as all other plugin types. | ||
|
||
The possibility of pluging cli commands into each other is a feature of ``click`` a python library that greatly simplifies the task. You can find in-debth documentation here: `Click 6.0 docs <click_docs>`_. |
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.
plugging, in-depth
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.
Fixed in 7cfd00a.
Append to file ``float_cmd.py``:: | ||
|
||
@float_cmd.command() | ||
@click.option('--outfile', '-o', type=click.Path(dir_ok=False), help='write output to this file (by default print to stout).' |
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 be dir_okay
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.
Agreed. Fixed in 7cfd00a.
34f9eb5
to
7cfd00a
Compare
The documentation was also updated for the tutorial parts to line up in the side bar. To mark them better visually, all their titles now start with 'Tutorial:'. The old data plugin command part was marked as outdated with a |
Marking the tutorials in the developer documentation more clearly is a good first step. In my opinion, further reorganisation is badly needed - the aiida developer documentation contains an enormous amount of information that should be categorised (and quite a bit of which is outdated). |
@ltalirz ok! |
close #992