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())
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)
def test_pdf_fails_if_not_analyzed(self): fs = FlatSym.from_demo_image() with self.assertRaises(NotAnalyzed): fs.publish_pdf('dummy.pdf')
def test_plot_fails_if_not_analyed(self): fs = FlatSym.from_demo_image() with self.assertRaises(NotAnalyzed): fs.plot()
def test_results_fails_if_not_analyzed(self): fs = FlatSym.from_demo_image() with self.assertRaises(NotAnalyzed): fs.results()
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
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
def test_demo_runs(self): FlatSym.run_demo()
def test_demo_loads_properly(self): """Loading the demo shouldn't raise an error""" FlatSym.from_demo_image() # shouldn't raise
def create_instance(): fs = FlatSym.from_demo_image() fs.analyze('varian', 'varian') return fs