Skip to content

Commit

Permalink
rm whitespaces, fix rst to render on pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
relleums committed Aug 15, 2020
1 parent 0b414bd commit b773663
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
qstat for python |TravisBuildStatus| |PyPIStatus| |BlackStyle|
==============================================================

A python API for qstat
A python API for qstat
----------------------
The sungrid job submission framework known as ```qsub``` is a powerful tool to distribute your workload over many machines in parallel. To check the status of the jobs in the queue there is ```qstat``` which can print a human readable status table on the command line. Such status can be useful to keep track of your submitted compute jobs to e.g. prevent duplicate submission.

This python qstat wrapper parses the jobs listed in ```qstat -xml``` into a list of dictionaries.
This python qstat wrapper parses the jobs listed in ```qstat -xml``` into a list of dictionaries.

Install with

.. code::
.. code::
$ pip install qstat
Expand Down Expand Up @@ -44,10 +44,10 @@ Add both ```queue_info``` and ```job_info``` to have one list of both running an
from qstat import qstat
queue_info, job_info = qstat()
all_jobs = queue_info + job_info
for job in all_jobs:
for job in all_jobs:
print(job['JB_name'], 'is', job['@state'])
::
Expand All @@ -66,28 +66,29 @@ or combine with e.g. with pandas DataFrame
import pandas as pd
df = pd.DataFrame(q + j)
df.tail()
::

@state JAT_prio JAT_start_time JB_job_number JB_name \
190 pending 0.00000 NaN 6384973 phs_obs_20160102_002
191 pending 0.00000 NaN 6384974 phs_obs_20160201_001
192 pending 0.00000 NaN 6384975 phs_obs_20160201_002
193 pending 0.00000 NaN 6384976 phs_obs_20160202_001
194 pending 0.00000 NaN 6384977 phs_obs_20160202_002
190 pending 0.00000 NaN 6384973 phs_obs_20160102_002
191 pending 0.00000 NaN 6384974 phs_obs_20160201_001
192 pending 0.00000 NaN 6384975 phs_obs_20160201_002
193 pending 0.00000 NaN 6384976 phs_obs_20160202_001
194 pending 0.00000 NaN 6384977 phs_obs_20160202_002

JB_owner JB_submission_time queue_name slots state
190 relleums 2017-09-04T16:22:51 None 1 qw
191 relleums 2017-09-04T16:22:51 None 1 qw
192 relleums 2017-09-04T16:22:51 None 1 qw
193 relleums 2017-09-04T16:22:51 None 1 qw
194 relleums 2017-09-04T16:22:51 None 1 qw
JB_owner JB_submission_time queue_name slots state
190 relleums 2017-09-04T16:22:51 None 1 qw
191 relleums 2017-09-04T16:22:51 None 1 qw
192 relleums 2017-09-04T16:22:51 None 1 qw
193 relleums 2017-09-04T16:22:51 None 1 qw
194 relleums 2017-09-04T16:22:51 None 1 qw


.. |TravisBuildStatus| image:: https://travis-ci.org/relleums/qstat.svg?branch=master
:target: https://travis-ci.org/relleums/qstat

.. |PyPIStatus| image:: https://badge.fury.io/py/qstat.svg
:target: https://pypi.python.org/pypi/qstat

Expand Down

0 comments on commit b773663

Please sign in to comment.