Skip to content

Commit

Permalink
fix(lib): wrong ValueError message (NVlabs#157)
Browse files Browse the repository at this point in the history
Fixes a typo in multiple error messages where the complex dtype is duplicated.
  • Loading branch information
jeertmans authored Jul 10, 2023
1 parent f41d40c commit 0565aa8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions sionna/rt/antenna.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self,
):

if dtype not in (tf.complex64, tf.complex128):
raise ValueError("`dtype` must be tf.complex64 or tf.complex64`")
raise ValueError("`dtype` must be tf.complex64 or tf.complex128`")
self._dtype = dtype = dtype

# Pattern is provided as string
Expand Down Expand Up @@ -157,7 +157,7 @@ def compute_gain(pattern, dtype=tf.complex64):
"""

if dtype not in (tf.complex64, tf.complex128):
raise ValueError("`dtype` must be tf.complex64 or tf.complex64`")
raise ValueError("`dtype` must be tf.complex64 or tf.complex128`")

# Create angular meshgrid
theta = tf.linspace(0.0, PI, 1810)
Expand Down
4 changes: 2 additions & 2 deletions sionna/rt/antenna_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, antenna, positions, trainable_positions=False, dtype=tf.compl
super().__init__()

if dtype not in (tf.complex64, tf.complex128):
raise ValueError("`dtype` must be tf.complex64 or tf.complex64`")
raise ValueError("`dtype` must be tf.complex64 or tf.complex128`")
self._rdtype = dtype.real_dtype

self.antenna = antenna
Expand Down Expand Up @@ -206,7 +206,7 @@ def __init__(self,
dtype=tf.complex64):

if dtype not in (tf.complex64, tf.complex128):
raise ValueError("`dtype` must be tf.complex64 or tf.complex64`")
raise ValueError("`dtype` must be tf.complex64 or tf.complex128`")

# Create list of antennas
array_size = num_rows*num_cols
Expand Down
2 changes: 1 addition & 1 deletion sionna/rt/paths_2_cir.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def __init__(self, sampling_frequency,
dtype=tf.complex64):

if dtype not in (tf.complex64, tf.complex128):
raise ValueError("`dtype` must be tf.complex64 or tf.complex64`")
raise ValueError("`dtype` must be tf.complex64 or tf.complex128`")

if scene is not None:
if not isinstance(scene, Scene):
Expand Down
2 changes: 1 addition & 1 deletion sionna/rt/radio_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self,
dtype=tf.complex64):

if dtype not in (tf.complex64, tf.complex128):
raise ValueError("`dtype` must be tf.complex64 or tf.complex64`")
raise ValueError("`dtype` must be tf.complex64 or tf.complex128`")
self._dtype = dtype
self._rdtype = dtype.real_dtype

Expand Down
2 changes: 1 addition & 1 deletion sionna/rt/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self,
if env_filename:

if dtype not in (tf.complex64, tf.complex128):
msg = "`dtype` must be tf.complex64 or tf.complex64`"
msg = "`dtype` must be tf.complex64 or tf.complex128`"
raise ValueError(msg)
self._dtype = dtype
self._rdtype = dtype.real_dtype
Expand Down
2 changes: 1 addition & 1 deletion sionna/rt/solver_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, scene, solver=None, dtype=tf.complex64):
# _prim_offsets

assert dtype in (tf.complex64, tf.complex128),\
"`dtype` must be tf.complex64 or tf.complex64`"
"`dtype` must be tf.complex64 or tf.complex128`"
self._dtype = dtype
self._rdtype = dtype.real_dtype

Expand Down

0 comments on commit 0565aa8

Please sign in to comment.