Exemple #1
0
 def test_to_profiles(self):
     path = get_file_from_cloud_test_repo(['9E-GA0.prs'])
     prof = SNCProfiler(path)
     profs = prof.to_profiles()
     self.assertEqual(len(profs), 4)
     self.assertIsInstance(profs[0], SingleProfile)
Exemple #2
0
 def test_bb_too_far_away_fails(self):
     """BB is >20mm from CAX"""
     file = get_file_from_cloud_test_repo([TEST_DIR, 'bb_too_far_away.zip'])
     wl = WinstonLutz.from_zip(file)
     with self.assertRaises(ValueError):
         wl.analyze()
Exemple #3
0
 def test_loading(self):
     path = get_file_from_cloud_test_repo(['9E-GA0.prs'])
     prof = SNCProfiler(path)
     self.assertEqual(len(prof.detectors), 254)
Exemple #4
0
 def test_invalid_file(self):
     invalid_file = get_file_from_cloud_test_repo(
         ['mlc_logs', 'Demo-subbeam-0-actual-fluence.npy'])
     with self.assertRaises(NotALogError):
         load_log(invalid_file)
Exemple #5
0
 def test_publish_pdf_w_imaging_log(self):
     imaging_tlog = TrajectoryLog(
         get_file_from_cloud_test_repo(['mlc_logs', 'tlogs',
                                        'imaging.bin']))
     with self.assertRaises(ValueError), tempfile.NamedTemporaryFile() as t:
         imaging_tlog.publish_pdf(t.name)
Exemple #6
0
 def test_tlog_file(self):
     tlog = get_file_from_cloud_test_repo(
         ['mlc_logs', 'tlogs', 'dynamic_imrt.bin'])
     self.assertIsInstance(load_log(tlog), TrajectoryLog)
Exemple #7
0
 def test_zip(self):
     zip_file = get_file_from_cloud_test_repo(
         ['mlc_logs', 'mixed_types.zip'])
     self.assertIsInstance(load_log(zip_file), MachineLogs)
Exemple #8
0
 def test_static_imrt_log(self):
     get_folder_from_cloud_test_repo(['mlc_logs', 'dlogs'])
     dlog = Dynalog(
         get_file_from_cloud_test_repo(
             ['mlc_logs', 'dlogs', 'A_static_imrt.dlg']))
     self.assertTrue(dlog.treatment_type, TreatmentType.STATIC_IMRT)
Exemple #9
0
 def test_dynalog_file(self):
     dynalog = get_file_from_cloud_test_repo(
         ['mlc_logs', 'dlogs', 'A_static_imrt.dlg'])
     self.assertIsInstance(load_log(dynalog), Dynalog)
Exemple #10
0
 def test_vmat_log(self):
     get_folder_from_cloud_test_repo(['mlc_logs', 'dlogs'])
     dlog = Dynalog(
         get_file_from_cloud_test_repo(['mlc_logs', 'dlogs', 'A_vmat.dlg']))
     self.assertTrue(dlog.treatment_type, TreatmentType.VMAT)
Exemple #11
0
 def test_dynamic_imrt_log(self):
     tlog = TrajectoryLog(
         get_file_from_cloud_test_repo(
             ['mlc_logs', 'tlogs', 'dynamic_imrt.bin']))
     self.assertTrue(tlog.treatment_type, TreatmentType.DYNAMIC_IMRT.value)
Exemple #12
0
 def test_vmat_log(self):
     tlog = TrajectoryLog(
         get_file_from_cloud_test_repo(['mlc_logs', 'tlogs', 'vmat.bin']))
     self.assertTrue(tlog.treatment_type, TreatmentType.VMAT.value)
Exemple #13
0
 def test_imaging_log(self):
     tlog = TrajectoryLog(
         get_file_from_cloud_test_repo(['mlc_logs', 'tlogs',
                                        'imaging.bin']))
     self.assertTrue(tlog.treatment_type, TreatmentType.IMAGING.value)
Exemple #14
0
 def test_loading_from_zip(self):
     img_zip = get_file_from_cloud_test_repo(['Starshot', 'set.zip'])
     star = Starshot.from_zip(img_zip)
     # shouldn't raise
     star.analyze()