Skip to content

Commit

Permalink
clean up minor warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
waltsims committed Dec 19, 2023
1 parent 9bcadc6 commit ce938f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion kwave/reconstruction/beamform.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ def focus(kgrid, input_signal, source_mask, focus_position, sound_speed):
input_signal_mat: matrix of time series following the source points
"""

assert not np.all(kgrid.t_array == 'auto'), "kgrid.t_array must be defined."
assert not isinstance(kgrid.t_array, str), "kgrid.t_array must be a numeric array."

if isinstance(sound_speed, int):
sound_speed = float(sound_speed)

Expand Down
6 changes: 4 additions & 2 deletions kwave/utils/mapgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def make_cart_bowl(bowl_pos: np.ndarray, radius: float, diameter: float, focus_p
bowl = R @ p0 + b

# plot results
if plot_bowl:
if plot_bowl is True:
# select suitable axis scaling factor
_, scale, prefix, unit = scale_SI(np.max(bowl))

Expand Down Expand Up @@ -558,6 +558,8 @@ def make_cart_sphere(radius: float, num_points: int, center_pos: Vector = Vector
r = np.sqrt(1 - (y ** 2))
phi = k * inc

assert num_points > 0, "num_points must be greater than 0"

# create the sphere
sphere = radius * np.concatenate([np.cos(phi) * r[np.newaxis, :], y[np.newaxis, :], np.sin(phi) * r[np.newaxis, :]])

Expand Down Expand Up @@ -2968,7 +2970,7 @@ def make_cart_spherical_segment(bowl_pos: np.ndarray, radius: float, inner_diame
segment = R @ p0 + b

# plot results
if plot_bowl:
if plot_bowl is True:
_, scale, prefix, unit = scale_SI(np.max(segment))

# create the figure
Expand Down

0 comments on commit ce938f6

Please sign in to comment.