Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various merges made into 1.x #29

Merged
merged 9 commits into from
Mar 16, 2023
6 changes: 3 additions & 3 deletions ratinabox/Environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ def sample_positions(self, n=10, method="uniform_jitter"):
elif self.dimensionality == "2D":

if method == "random":
positions = np.random.uniform(size=(n, 2))
positions[:, 0] *= self.extent[1] - self.extent[0]
positions[:, 1] *= self.extent[3] - self.extent[2]
positions = np.zeros((n, 2))
positions[:, 0] = np.random.uniform(self.extent[0], self.extent[1], size=n)
positions[:, 1] = np.random.uniform(self.extent[2], self.extent[3], size=n)
elif method[:7] == "uniform":
ex = self.extent
area = (ex[1] - ex[0]) * (ex[3] - ex[2])
Expand Down