Skip to content

Commit

Permalink
Updated assessor docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dwest77a committed Feb 6, 2024
1 parent 1e8d87e commit a676f8f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
6 changes: 4 additions & 2 deletions assess.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,16 @@ def show_options(option: str, groupdir: str, operation: str, logger):
os.system(f'ls {groupdir}/outs/')
else:
os.system(f'ls {groupdir}/errs/')
else:
elif option == 'labels':
logger.info('Detecting labels from previous runs:')
labels = glob.glob(f'{args.workdir}/groups/{args.groupID}/proj_codes*')
for l in labels:
pcode = l.split('/')[-1].replace("proj_codes_","").replace(".txt","")
if pcode == '1':
pcode = 'main'
logger.info(f'{format_str(pcode,20)} - {l}')
else:
logger.info(f'{option} not accepted - use "jobids" or "labels"')

def cleanup(cleantype: str, groupdir: str, logger):
"""Remove older versions of project code files, error or output logs. Clear directories."""
Expand Down Expand Up @@ -343,7 +345,7 @@ def assess_main(args):

parser.add_argument('-j','--jobid', dest='jobID', help='Identifier of job to inspect')
parser.add_argument('-p','--phase', dest='phase', default='validate', help='Pipeline phase to inspect')
parser.add_argument('-s','--show-opts', dest='show_opts', help='Show options for jobids, repeat label')
parser.add_argument('-s','--show-opts', dest='show_opts', help='Show options for jobids, labels')

parser.add_argument('-r','--repeat_label', dest='repeat_label', default=None, help='Save a selection of codes which failed on a given error - input a repeat id.')
parser.add_argument('-i','--inspect', dest='inspect', help='Inspect error/output of a given type/label')
Expand Down
43 changes: 42 additions & 1 deletion docs/source/assess-overview.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
Assessor Tool
=============
=============

The assessor script ```assess.py``` is an all-purpose pipeline checking tool which can be used to assess:
- The current status of all datasets within a given group in the pipeline (which phase each dataset currently sits in)
- The errors/outputs associated with previous job runs.

1. Overall Progress of the Pipeline
--------------------------------

Check warning on line 9 in docs/source/assess-overview.rst

View workflow job for this annotation

GitHub Actions / build

Title underline too short.

To see the general status of the pipeline for a given group:
::
python assess.py <group> progress
::

An example use case is to write out all datasets that require scanning to a new label (repeat_label):

Check warning on line 16 in docs/source/assess-overview.rst

View workflow job for this annotation

GitHub Actions / build

Literal block expected; none found.
::
python assess.py <group> progress -p scan -r <label_for_scan_subgroup> -W
::

The last flag ```-W``` is required when writing an output file from this program, otherwise the program will dryrun and produce no files.

Check warning on line 21 in docs/source/assess-overview.rst

View workflow job for this annotation

GitHub Actions / build

Literal block expected; none found.

2. Checking errors
------------------
Check what repeat labels are available already using
::
python assess.py <group> errors -s labels
::

Show what jobs have previously run

Check warning on line 30 in docs/source/assess-overview.rst

View workflow job for this annotation

GitHub Actions / build

Literal block expected; none found.
::
python assess.py <group> errors -s jobids
::

For showing all errors from a previous job run

Check warning on line 35 in docs/source/assess-overview.rst

View workflow job for this annotation

GitHub Actions / build

Literal block expected; none found.
::
python assess.py <group> errors -j <jobid>
::

For selecting a specific type of error to investigate (-i) and examine the full log for each example (-E)

Check warning on line 40 in docs/source/assess-overview.rst

View workflow job for this annotation

GitHub Actions / build

Literal block expected; none found.
::
python assess.py test errors -j <jobid> -i "type_of_error" -E
::
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pandas==2.1.1
python-dateutil==2.8.2
pytz==2023.3.post1
requests==2.31.0
scipy==1.10.1
six==1.16.0
tzdata==2023.3
ujson==5.8.0
Expand Down

0 comments on commit a676f8f

Please sign in to comment.