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

Seeding example for 1D environment of S&H 2012 #1396

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated pre-commit hook
jtbuch committed Apr 19, 2024
commit 7c30823e24efca5fe76d2cb75bc7ac293aceec94
6 changes: 3 additions & 3 deletions PySDM/initialisation/sampling/spatial_sampling.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

class Pseudorandom: # pylint: disable=too-few-public-methods
@staticmethod
def sample(*, backend, grid, n_sd, z_part= None, x_part= None):
def sample(*, backend, grid, n_sd, z_part=None, x_part=None):
dimension = len(grid)
n_elements = dimension * n_sd

@@ -20,7 +20,7 @@ def sample(*, backend, grid, n_sd, z_part= None, x_part= None):
if x_part is not None:
ix_min = int(grid[1] * x_part[0])
ix_max = int(grid[1] * x_part[1])

for dim in range(dimension):
if dim:
positions[dim, :] *= ix_max - ix_min
@@ -33,7 +33,7 @@ def sample(*, backend, grid, n_sd, z_part= None, x_part= None):
else:
iz_min = int(grid[0] * z_part[0])
iz_max = int(grid[0] * z_part[1])

if x_part is not None:
ix_min = int(grid[1] * x_part[0])
ix_max = int(grid[1] * x_part[1])