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

Homogenize the output of verdi work list and verdi calculation list #1197

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Feb 27, 2018

Fixes #1075

Now that all Calculations are routed through the Process layer and
therefore are guaranteed to share the same information through the
process_state and finish_status attributes, we can update the verdi
commands 'calculation list' and 'work' list to use the same labels,
format and default order. This hopefully creates a more consistent
and therefore more easy to understand output for the user.

Unfortunately since the querying for JobCalculations is relatively
hardcoded in AbstractJobCalculation class, I had to duplicate some
of the logic to format the various data attributes in the two
display commands. Ideally this would be abstracted but that would
take a huge effort.

@giovannipizzi
Copy link
Member

Quick question, how different the format is, now, for 'verdi calculation list'? Does it fit by default in 1 line?

@sphuber
Copy link
Contributor Author

sphuber commented Feb 27, 2018

Depends on how wide your line is :) it is quite a bit wider than the default, that is true

@sphuber sphuber force-pushed the fix_1075_verdi_normalize_process_state branch from 527716c to 32d1e07 Compare February 27, 2018 18:50
@giovannipizzi
Copy link
Member

Hi @sphuber I just realised this didn't get approved. Can you copy-paste in a comment an example of the current output? I think it would be great if by default we can stay in 1 line if possible (80 chars), looking at the current output can help give suggestions (there should already be a mechanism to change the number of columns implemented, so if the user wants more columns he can do so).

@sphuber
Copy link
Contributor Author

sphuber commented Mar 14, 2018

I will take a look at it later today hopefully and can give an example. My aim was to have verdi calculation list and verdi work list have an as similar as possible output by default. This should now be possible now that we have routed the two systems through the same process layer and all share the common process_state and finish_status attributes.

Now that all Calculations are routed through the Process layer and
therefore are guaranteed to share the same information through the
process_state and finish_status attributes, we can update the verdi
commands 'calculation list' and 'work' list to use the same labels,
format and default order. This hopefully creates a more consistent
and therefore more easy to understand output for the user.

Unfortunately since the querying for JobCalculations is relatively
hardcoded in AbstractJobCalculation class, I had to duplicate some
of the logic to format the various data attributes in the two
display commands. Ideally this would be abstracted but that would
take a huge effort.
@sphuber sphuber force-pushed the fix_1075_verdi_normalize_process_state branch from 32d1e07 to 58c11eb Compare March 14, 2018 10:57
@sphuber
Copy link
Contributor Author

sphuber commented Mar 14, 2018

With the latest change and introduction of compound projections, this is the new default output for verdi work list:

   PK  Creation    State         Process label
-----  ----------  ------------  -----------------
19804  23h ago     Finished | 0  CifCleanWorkChain
19823  23h ago     Finished | 0  CifCleanWorkChain
19845  23h ago     Finished | 0  CifCleanWorkChain

and this for verdi calculation list:

   PK  Creation    State         Type                 Computer    Job state
-----  ----------  ------------  -------------------  ----------  ---------------
19806  23h ago     Finished | 0  codtools.cif_filter  localhost   Finished | Done
19812  23h ago     Finished | 0  codtools.cif_select  localhost   Finished | Done
19825  23h ago     Finished | 0  codtools.cif_filter  localhost   Finished | Done
19831  23h ago     Finished | 0  codtools.cif_select  localhost   Finished | Done
19847  23h ago     Finished | 0  codtools.cif_filter  localhost   Finished | Done
19853  23h ago     Finished | 0  codtools.cif_select  localhost   Finished | Done

@sphuber sphuber force-pushed the fix_1075_verdi_normalize_process_state branch from 58c11eb to a69a3fb Compare March 14, 2018 11:31
The default set of projections for `verdi calculation list` should not be
wider than 80 columns roughly, otherwise the lines for people with default
shell widths will just wrap. However, with the recent changes of homogenizing
the spheres of WorkCalculations and JobCalculations through the process
layer, we want to give `verdi work list` and `verdi calculation list` a
similiar default output. In addition to the default projections of the
former, the calculations also have the calculation and scheduler state which
should remain there by default, but this would make the output to wide. The
solution is to define compound projections:

	* state
	* job_state

The first applies to both `work` and `calculation` and will show the tuple
of `process_state` and `finish_status`. The second only applies to the
`calculation list` and is the tuple of the old calculation state and the
scheduler state.
@sphuber sphuber force-pushed the fix_1075_verdi_normalize_process_state branch from a69a3fb to 7c2d789 Compare March 14, 2018 11:59
@giovannipizzi giovannipizzi merged commit f2bceae into aiidateam:workflows Mar 14, 2018
@sphuber sphuber deleted the fix_1075_verdi_normalize_process_state branch March 14, 2018 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants