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

Add non-static and kt sampling #280

Merged
merged 10 commits into from
Jul 3, 2024
Merged
Prev Previous commit
Next Next commit
Codacy fixes
georgeyiasemis committed Jun 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 6bf763a22aba6615353e2c420094a5e23d62f0e6
2 changes: 1 addition & 1 deletion direct/common/subsample.py
Original file line number Diff line number Diff line change
@@ -2392,7 +2392,7 @@ def resolve_duplicates_on_kt_grid(

empty_indices = np.setdiff1d(np.arange(1, ny * nt + 1), trajectory_indices)

for i, duplicate_index in enumerate(duplicate_indices):
for _, duplicate_index in enumerate(duplicate_indices):
new_index = KtBaseMaskFunc.find_nearest_empty_location(
trajectory_indices[duplicate_index], empty_indices, ny
)
4 changes: 2 additions & 2 deletions direct/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -582,8 +582,8 @@ def reshape_array_to_shape(array: np.ndarray, requested_shape: Tuple[int, ...])

# Fill in the new shape list with dimensions from the current shape where appropriate
j = 0 # Index for current shape
for i in range(len(requested_shape)):
if j < len(current_shape) and requested_shape[i] == current_shape[j]:
for i, dim in enumerate(requested_shape):
if j < len(current_shape) and dim == current_shape[j]:
new_shape[i] = current_shape[j]
j += 1