Updates fractal seeding to use new numpy seed generator.

这个提交包含在:
Craig Warren
2021-03-15 09:58:05 +00:00
父节点 fb9d108091
当前提交 ae85a6bcd9

查看文件

@@ -83,8 +83,8 @@ class FractalSurface:
* (surfacedims[1]) / 2])
# 2D array of random numbers to be convolved with the fractal function
R = np.random.RandomState(self.seed)
A = R.randn(surfacedims[0], surfacedims[1])
rng = np.random.default_rng(seed=self.seed)
A = rng.standard_normal(size=(surfacedims[0], surfacedims[1]))
# 2D FFT
A = fftpack.fftn(A)
@@ -176,8 +176,8 @@ class FractalVolume:
* self.ny / 2, self.weighting[2] * self.nz / 2])
# 3D array of random numbers to be convolved with the fractal function
R = np.random.RandomState(self.seed)
A = R.randn(self.nx, self.ny, self.nz)
rng = np.random.default_rng(seed=self.seed)
A = rng.standard_normal(size=(self.nx, self.ny, self.nz))
# 3D FFT
A = fftpack.fftn(A)