Skip to content

Commit

Permalink
Created results_data method for data summary as dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
crcrewso committed Mar 17, 2021
1 parent f8dec17 commit 672584c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pylinac/winston_lutz.py
Expand Up @@ -540,6 +540,20 @@ def results(self, as_list: bool=False) -> str:
if not as_list:
result = '\n'.join(result)
return result

def results_data(self):
"""Return the analysis results as a dictionary."""
return_dict = {}
return_dict['cax2bb max'] = self.cax2bb_distance('max')
return_dict['cax2bb median'] = self.cax2bb_distance('median')
return_dict['coll iso size'] = self.collimator_iso_size
return_dict['couch iso size'] = self.couch_iso_size
return_dict['gantry iso size'] = self.gantry_iso_size
return_dict['gantry coll iso size'] = self.gantry_coll_iso_size
return_dict['MechRad x'] = self.bb_shift_vector.x
return_dict['MechRad y'] = self.bb_shift_vector.y
return_dict['MechRad z'] = self.bb_shift_vector.z
return return_dict

def publish_pdf(self, filename: str, notes: Optional[Union[str, List[str]]]=None, open_file: bool=False, metadata: Optional[dict]=None):
"""Publish (print) a PDF containing the analysis, images, and quantitative results.
Expand Down
4 changes: 4 additions & 0 deletions tests_basic/test_winstonlutz.py
Expand Up @@ -49,6 +49,10 @@ def test_bb_shift_instructions(self):
self.assertTrue("RIGHT" in move)
self.assertTrue("VRT" in move)

def test_results_data(self):
self.assertTrue(bool(self.wl.results_data())) # empty dictionaries evaluate to false



class TestPublishPDF(TestCase):

Expand Down

0 comments on commit 672584c

Please sign in to comment.