Skip to content

Commit 5d691e0

Browse files
committed
Fix confusing variable names
1 parent 2f36552 commit 5d691e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/chromatix/field.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,21 @@ def grid(self) -> Array:
8989
the corner.
9090
"""
9191
# We must use meshgrid instead of mgrid here in order to be jittable
92-
N_x, N_y = self.spatial_shape
92+
N_y, N_x = self.spatial_shape
9393
grid = jnp.meshgrid(
94-
jnp.linspace(-N_x // 2, N_x // 2 - 1, num=N_x) + 0.5,
9594
jnp.linspace(-N_y // 2, N_y // 2 - 1, num=N_y) + 0.5,
95+
jnp.linspace(-N_x // 2, N_x // 2 - 1, num=N_x) + 0.5,
9696
indexing="ij",
9797
)
9898
grid = rearrange(grid, "d h w -> d " + ("1 " * (self.ndim - 4)) + "h w 1 1")
9999
return self.dx * grid
100100

101101
@property
102102
def k_grid(self) -> Array:
103-
N_x, N_y = self.spatial_shape
103+
N_y, N_x = self.spatial_shape
104104
grid = jnp.meshgrid(
105-
jnp.linspace(-N_x // 2, N_x // 2 - 1, num=N_x) + 0.5,
106105
jnp.linspace(-N_y // 2, N_y // 2 - 1, num=N_y) + 0.5,
106+
jnp.linspace(-N_x // 2, N_x // 2 - 1, num=N_x) + 0.5,
107107
indexing="ij",
108108
)
109109
grid = rearrange(grid, "d h w -> d " + ("1 " * (self.ndim - 4)) + "h w 1 1")

0 commit comments

Comments
 (0)