diff --git a/clean_python/extractors.py b/clean_python/extractors.py index eaa7a1f..234b7af 100644 --- a/clean_python/extractors.py +++ b/clean_python/extractors.py @@ -43,9 +43,9 @@ class Evaluator(ABC): @timeit def generate_mask(self, img: FFT, merge=False): hash = str(img.intens.shape) - self.mask = self.gen_mask_helper(img, hash=hash) + self.mask = self.gen_mask_helper(img) if merge: - self.mask = self.merge_mask_helper(hash=hash) + self.mask = self.merge_mask_helper() self.eval_points = [[a] for a in np.arange(len(self.eval_points))] @abstractmethod diff --git a/clean_python/main.py b/clean_python/main.py index f1cba20..c78e84d 100644 --- a/clean_python/main.py +++ b/clean_python/main.py @@ -1,4 +1,5 @@ from lattices import SCC_Lattice, VO2_Lattice +import sys from spin_image import SpinImage import numpy as np import matplotlib.pyplot as plt @@ -121,7 +122,7 @@ def random(seed): for i in tqdm.tqdm(ind): maske[np.unravel_index(i, (LEN, LEN))] = True counter += 1 - if np.mod(counter, 100) != 0: + if np.mod(counter, 100) != 0 and not i == ind[-1]: continue si.apply_mask(lat.parse_mask(maske)) @@ -204,21 +205,34 @@ def ising(seed, temp=0.5): out_2=out_rect[1], out_3=out_rect[2], out_4=out_rect[3]) +def runner(): + np.random.seed(1234) + seeds = np.random.randint(0, 10000, 200) + idx = int(sys.argv[1]) + if idx < 0: + return + if idx >= seeds.size: + return + seed = seeds[idx] + random(seed) + + if __name__ == "__main__": np.random.seed(1234) + runner() # test_me() # test_square() # test_mixed() # plt.show() # random(1234) # ising(1234) - test_pdf() - plt.show() - exit() - for i in np.random.randint(0, 10000, 5): - random(i) - ising(i, 0.5) - ising(i, 1.0) - ising(i, 1.5) + # test_pdf() + # plt.show() + # exit() + # for i in np.random.randint(0, 10000, 5): + # random(i) + # ising(i, 0.5) + # ising(i, 1.0) + # ising(i, 1.5) # plt.show()