What i want to do is to generate from given images new ones.
I have created transformation functions:
def trans_func_1(image,param1,param2):
#do some transformation
def trans_func_2(image,param1,param2):
#do some transformation
All functions operates on image level.
Then I have a big function which is called generate_image function, which takes as arguments a path to the folder with images, parameters for the written above functions and applies transformation functions to the images.
My idea is to define transformation functions as module-level functions and for the big functions create a class, that will look this
class ImageGeneration:
def __init__(self,path,trans_param1,trans_param2):
self.path = path
self.trans_param1 = trans_param1
self.trans_param2 = trans_param2
...
def image_generation(self):
for image in self.path:
for i in self.trans_param1:
img = trans_func_1(image,i)
write_img(img)
for i in self.trans_param2:
img = trans_func_2(image,i)
write_img(img)
My question is: is it a good practice to use module-level functions inside a class? Or is it better to define them as @staticmethod