def main (rofl_path, *args, **kws): args = [ast.literal_eval(arg) for arg in args] result = tr.roflfe(rofl_path, *args, **kws) assert result != "!Error" assert hasattr(result, "ndim") and result.ndim == 2 result -= result.min() result *= 255. / result.max() image = Image.fromarray(result.astype(numpy.uint8)) image.show()
def main (dx = None, dy = None, *args, **kws): if dx is None: dx = 640 else: dx = int(dx) if dy is None: dy = 480 else: dy = int(dy) mandelbrot_output = tr.roflfe(SRC_PATH, dx, dy) assert mandelbrot_output != '!Error' mandelbrot_output -= mandelbrot_output.min() mandelbrot_output *= 255. / mandelbrot_output.max() image = Image.fromarray(mandelbrot_output.astype(numpy.uint8)) image.show()
def test_n_body_sanity (self): '''Do a sanity check on a 2D n-body simulator written in ROFL. This is by no means a functional test of the results of the n-body simulator.''' self.assertNotEqual(tr.roflfe(SRC_PATH, 3, 10, 3), '!Error')
def test_raycast_sanity (self): self.assertNotEqual(tr.roflfe(SRC_PATH, 100, 100, 5, 1), '!Error')
def test_mandelbrot_sanity (self): self.assertNotEqual(tr.roflfe(SRC_PATH, 120, 80), '!Error')