Fix typo in function name

这个提交包含在:
nmannall
2025-01-20 14:39:56 +00:00
父节点 5b05b2af61
当前提交 f597246556
共有 2 个文件被更改,包括 5 次插入5 次删除

查看文件

@@ -82,7 +82,7 @@ class UserInput(Generic[GridType]):
""" """
return self.discretise_point(p) * self.grid.dl return self.discretise_point(p) * self.grid.dl
def descretised_to_continuous(self, p: npt.NDArray[np.int32]) -> npt.NDArray[np.float64]: def discretised_to_continuous(self, p: npt.NDArray[np.int32]) -> npt.NDArray[np.float64]:
"""Returns a point given as indices to a continuous point in the real space.""" """Returns a point given as indices to a continuous point in the real space."""
return p * self.grid.dl return p * self.grid.dl

查看文件

@@ -1074,7 +1074,7 @@ class RxArray(GridUserObject):
r.zcoordorigin = z r.zcoordorigin = z
# Point relative to main grid # Point relative to main grid
p5 = np.array([x, y, z]) p5 = np.array([x, y, z])
p5 = uip.descretised_to_continuous(p5) p5 = uip.discretised_to_continuous(p5)
p5 = uip.round_to_grid_static_point(p5) p5 = uip.round_to_grid_static_point(p5)
r.ID = f"{r.__class__.__name__}({str(x)},{str(y)},{str(z)})" r.ID = f"{r.__class__.__name__}({str(x)},{str(y)},{str(z)})"
for key in RxUser.defaultoutputs: for key in RxUser.defaultoutputs:
@@ -1166,7 +1166,7 @@ class Snapshot(GridUserObject):
# not change the snapshot output. # not change the snapshot output.
if uip.point_within_bounds(upper_bound, "", "", ignore_error=True): if uip.point_within_bounds(upper_bound, "", "", ignore_error=True):
p2 = upper_bound p2 = upper_bound
p2_continuous = uip.descretised_to_continuous(p2) p2_continuous = uip.discretised_to_continuous(p2)
logger.warning( logger.warning(
f"{self.params_str()} upper bound not aligned with discretisation. Updating 'p2'" f"{self.params_str()} upper bound not aligned with discretisation. Updating 'p2'"
f" to {p2_continuous}" f" to {p2_continuous}"
@@ -1177,7 +1177,7 @@ class Snapshot(GridUserObject):
elif any(dl > snapshot_size): elif any(dl > snapshot_size):
dl = np.where(dl > snapshot_size, snapshot_size, dl) dl = np.where(dl > snapshot_size, snapshot_size, dl)
upper_bound = self._calculate_upper_bound(p1, dl, snapshot_size) upper_bound = self._calculate_upper_bound(p1, dl, snapshot_size)
dl_continuous = uip.descretised_to_continuous(dl) dl_continuous = uip.discretised_to_continuous(dl)
logger.warning( logger.warning(
f"{self.params_str()} current bounds and discretisation would go outside" f"{self.params_str()} current bounds and discretisation would go outside"
f" domain. As discretisation is larger than the snapshot size in at least one" f" domain. As discretisation is larger than the snapshot size in at least one"
@@ -1191,7 +1191,7 @@ class Snapshot(GridUserObject):
p2 = np.where(uip.grid_upper_bound() < upper_bound, p2 - (snapshot_size % dl), p2) p2 = np.where(uip.grid_upper_bound() < upper_bound, p2 - (snapshot_size % dl), p2)
snapshot_size = p2 - p1 snapshot_size = p2 - p1
upper_bound = self._calculate_upper_bound(p1, dl, snapshot_size) upper_bound = self._calculate_upper_bound(p1, dl, snapshot_size)
p2_continuous = uip.descretised_to_continuous(p2) p2_continuous = uip.discretised_to_continuous(p2)
logger.warning( logger.warning(
f"{self.params_str()} current bounds and discretisation would go outside" f"{self.params_str()} current bounds and discretisation would go outside"
f" domain. Limiting 'p2' to {p2_continuous}" f" domain. Limiting 'p2' to {p2_continuous}"