Skip to content

Instantly share code, notes, and snippets.

@CJ-Wright
Created July 29, 2016 18:30
Show Gist options
  • Save CJ-Wright/1752e5cd5034614e30cea529dedd46af to your computer and use it in GitHub Desktop.
Save CJ-Wright/1752e5cd5034614e30cea529dedd46af to your computer and use it in GitHub Desktop.
from magic import integrate
functions_dict = {integrate:[(args),{kwargs}} # ask people about more elegant way to do this
def __init__(self, functions_dict):
self.functions_dict = functions_dict
def run_analysis(self):
for data in self.data:
for func, v in self.functions_dict.items():
ret = func(img, *v[0], *v[1])
if isinstance(ret, tuple): # Then it is a 1D plot
plot(ret[0], ret[1]
else: # It is a 2D Plot
imshow(ret)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment