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

Use function name/docstring for label/description of CalcFunctioNode #2682

Closed
ltalirz opened this issue Apr 1, 2019 · 3 comments · Fixed by #2830
Closed

Use function name/docstring for label/description of CalcFunctioNode #2682

ltalirz opened this issue Apr 1, 2019 · 3 comments · Fixed by #2830

Comments

@ltalirz
Copy link
Member

ltalirz commented Apr 1, 2019

When running a calcfunction, the name of the function (here: testing) is shown as the process label in the verdi process list command. This is obviously very useful information.

$ verdi process list -a
 ...
 104  7s ago     ⏹ Finished [0]  testing
 ...

However, when looking at the generated CalcFunctionNode using verdi node show, label and description are empty.

$ verdi node show 104
\/Users/leopold/Applications/miniconda3/envs/aiida_rmq_py3/lib/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
  """)
Property       Value
-------------  ------------------------------------
type           CalcFunctionNode
pk             104
uuid           dccc4421-4349-46cd-9203-41e485bcff0d
label
description
ctime          2019-04-01 12:13:02.502981+00:00
mtime          2019-04-01 12:13:02.902249+00:00
process state  ProcessState.FINISHED
exit status    0
Inputs      PK  Type
--------  ----  ------
a          103  Int
Outputs      PK  Type
---------  ----  ------
result      105  Int

I propose to populate the fields

  • label by the name of the function
  • description by the docstring of the function (if exists)
@ltalirz ltalirz added the type/feature request status undecided label Apr 1, 2019
@sphuber
Copy link
Contributor

sphuber commented Apr 1, 2019

Seems a very useful suggestion. I think it would make the most sense that these serve as a default and that explicitly specifying either of them in the metadata when calling the function should override. Do you agree?

@ltalirz
Copy link
Member Author

ltalirz commented Apr 1, 2019

I think it would make the most sense that these serve as a default and that explicitly specifying either of them in the metadata when calling the function should override. Do you agree?

Fully agreed!

@ltalirz
Copy link
Member Author

ltalirz commented May 3, 2019

Very nice, thanks @sphuber !

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

Successfully merging a pull request may close this issue.

2 participants