Esempio n. 1
0
 def setUpClass(cls):
     cls.fs = FlatSym(cls.get_filename())
     cls.fs.analyze(flatness_method=cls.flatness_method,
                    symmetry_method=cls.symmetry_method,
                    vert_position=cls.vert_position,
                    horiz_position=cls.horiz_position)
     if cls.print_results:
         print(cls.fs.results())
Esempio n. 2
0
 def test_profile_limits(self):
     """Extreme profile limits should not raise an error"""
     fs = FlatSym.from_demo_image()
     fs.analyze(flatness_method="varian",
                symmetry_method="varian",
                vert_position=0.5,
                horiz_position=0.5,
                vert_width=0,
                horiz_width=0)
     fs.analyze(flatness_method="varian",
                symmetry_method="varian",
                vert_position=0.0,
                horiz_position=0.0,
                vert_width=1,
                horiz_width=1)
     fs.analyze(flatness_method="varian",
                symmetry_method="varian",
                vert_position=1.0,
                horiz_position=1.0,
                vert_width=1,
                horiz_width=1)
Esempio n. 3
0
 def test_pdf_fails_if_not_analyzed(self):
     fs = FlatSym.from_demo_image()
     with self.assertRaises(NotAnalyzed):
         fs.publish_pdf('dummy.pdf')
Esempio n. 4
0
 def test_plot_fails_if_not_analyed(self):
     fs = FlatSym.from_demo_image()
     with self.assertRaises(NotAnalyzed):
         fs.plot()
Esempio n. 5
0
 def test_results_fails_if_not_analyzed(self):
     fs = FlatSym.from_demo_image()
     with self.assertRaises(NotAnalyzed):
         fs.results()
Esempio n. 6
0
 def test_symmetry_methods(self):
     fs = FlatSym.from_demo_image()
     analyze = partial(fs.analyze, flatness_method='varian')
     for method in ('point difference', 'elekta', 'pdq iec'):
         analyze(symmetry_method=method)  # shouldn't raise
Esempio n. 7
0
 def test_flatness_methods(self):
     fs = FlatSym.from_demo_image()
     analyze = partial(fs.analyze, symmetry_method='varian')
     for method in ('varian', 'elekta', 'siemens', 'vom80', 'iec'):
         analyze(flatness_method=method)  # shouldn't raise
Esempio n. 8
0
 def test_demo_runs(self):
     FlatSym.run_demo()
Esempio n. 9
0
 def test_demo_loads_properly(self):
     """Loading the demo shouldn't raise an error"""
     FlatSym.from_demo_image()  # shouldn't raise
Esempio n. 10
0
def create_instance():
    fs = FlatSym.from_demo_image()
    fs.analyze('varian', 'varian')
    return fs