GSTT-CSC / hazen

Quality assurance framework for Magnetic Resonance Imaging
https://github.com/GSTT-CSC/hazen
Apache License 2.0
22 stars 12 forks source link

307 improve docopt description #359

Closed sophie22 closed 1 year ago

sophie22 commented 1 year ago

Simplify and clear up the usage instructions for docopt and consequently had to change how the arguments are parsed to set off the correct tasks to run.

resolves #307

sophie22 commented 1 year ago

one unit test in the test_hazenlib is failing due to lack of raising exception in main. I think this test is safe to remove and also to not include an Exception when user provides an optional argument that is not available for the selected task. I think it is okay to 'silently' ignore not applicable CLI args, it is more important to correctly parse and use the ones provided that are actually relevant to the task.

github-actions[bot] commented 1 year ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
hazenlib
   HazenTask.py25388%32–34
   __init__.py531670%125–135, 148, 182–184, 187–189, 196–198, 208
   exceptions.py21481%17–21
   relaxometry.py3119071%248–266, 640, 699–701, 755, 803–825, 843–858, 1186–1189, 1198–1201, 1213–1226, 1229–1234, 1245–1274
   utils.py1894377%61, 65, 75, 80, 117, 124–129, 140, 143–150, 170–172, 190–192, 211–213, 222, 227, 233, 284, 287, 295–300, 303, 346, 355, 371
hazenlib/tasks
   acr_geometric_accuracy.py1465662%38–75, 179–195, 209–233
   acr_ghosting.py1174363%33–55, 93–95, 125–127, 163–196
   acr_slice_position.py1555465%53–76, 154, 215–260
   acr_slice_thickness.py1546458%40–62, 188–243
   acr_snr.py1416256%34–78, 103, 172–182, 215–228, 261–274
   acr_spatial_resolution.py2447470%66–90, 169, 212, 225–234, 323–378
   acr_uniformity.py903363%34–56, 123–140
   ghosting.py1525365%18–35, 50, 112–113, 117, 127–128, 154–156, 173–175, 221–259
   relaxometry.py770%1–11
   slice_position.py1172380%28, 37–38, 49, 103–104, 130, 210, 217–234
   slice_width.py3575385%34–37, 41, 109, 168–188, 453, 458–459, 465, 470, 532–533, 782–823
   snr.py1666760%51, 68–73, 167–185, 200–209, 227–237, 264–274, 279–289, 320–333, 338–346, 375–388
   snr_map.py104199%291
   spatial_resolution.py247797%36–39, 64, 149, 208
   uniformity.py792075%42–45, 51, 93–94, 101, 135–149
TOTAL289177373% 

Tests Skipped Failures Errors Time
218 0 :zzz: 0 :x: 0 :fire: 2m 56s :stopwatch:
github-actions[bot] commented 1 year ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
hazenlib
   HazenTask.py25388%32–34
   __init__.py531670%123–133, 146, 180–182, 185–187, 194–196, 206
   exceptions.py21481%17–21
   relaxometry.py3119071%248–266, 640, 699–701, 755, 803–825, 843–858, 1186–1189, 1198–1201, 1213–1226, 1229–1234, 1245–1274
   utils.py1894377%61, 65, 75, 80, 117, 124–129, 140, 143–150, 170–172, 190–192, 211–213, 222, 227, 233, 284, 287, 295–300, 303, 346, 355, 371
hazenlib/tasks
   acr_geometric_accuracy.py1465662%38–75, 179–195, 209–233
   acr_ghosting.py1174363%33–55, 93–95, 125–127, 163–196
   acr_slice_position.py1555465%53–76, 154, 215–260
   acr_slice_thickness.py1546458%40–62, 188–243
   acr_snr.py1416256%34–78, 103, 172–182, 215–228, 261–274
   acr_spatial_resolution.py2447470%66–90, 169, 212, 225–234, 323–378
   acr_uniformity.py903363%34–56, 123–140
   ghosting.py1525365%18–35, 50, 112–113, 117, 127–128, 154–156, 173–175, 221–259
   relaxometry.py770%1–11
   slice_position.py1172380%28, 37–38, 49, 103–104, 130, 210, 217–234
   slice_width.py3575385%34–37, 41, 109, 168–188, 453, 458–459, 465, 470, 532–533, 782–823
   snr.py1666760%51, 68–73, 167–185, 200–209, 227–237, 264–274, 279–289, 320–333, 338–346, 375–388
   snr_map.py104199%291
   spatial_resolution.py247797%36–39, 64, 149, 208
   uniformity.py792075%42–45, 51, 93–94, 101, 135–149
TOTAL289177373% 

Tests Skipped Failures Errors Time
218 0 :zzz: 0 :x: 0 :fire: 2m 47s :stopwatch:
sophie22 commented 1 year ago

--report is not available for the relaxometry task and --show_rois, --show_template_fit and --show_relax_fits are not currently generating images due to the way matplotlib is configured in utils.py. I opened a new issue #360 for these, and since it's not directly related to the purpose of this PR focusing on the CLI usage interface, I think this PR is ready for review and potentially merging.