Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dascore/core/coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def _select_by_sample_array(self, array):
msg = "Using an array input for select with samples requires integer dtype."
raise CoordError(msg)
# Filter out bad indices
if self.ndim > 1:
if self.ndim != 1:
msg = "Select only works on 1D coords."
raise CoordError(msg)
inds = np.arange(len(self))
Expand Down
4 changes: 2 additions & 2 deletions dascore/transform/fbe.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def fbe(
can be used for downsampling of the resulting patch.
See also [rolling](`dascore.Patch.rolling`)
db
Return patch data in decibel [dB] instead of orginal units.
Decibel is calculated as 20 * log10( sqrt(mean(x^2))) ).
Return patch data in decibel [dB] instead of original units.
Decibel is calculated as 20 * log10( sqrt(mean(x^2)) ).
**kwargs
Used to specify the dimension and asociated frequency, wavelength, or
equivalent limits. For example time=(1, 100) applies a time-dimension bandpass
Expand Down
7 changes: 7 additions & 0 deletions tests/test_core/test_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,13 @@ def test_select_sample_array_2d_raises(self, coord_2d):
with pytest.raises(CoordError, match="1D coords"):
coord_2d.select(np.array([0, 1]), samples=True)

def test_select_sample_array_0d_raises(self):
"""A rank-0 coord must also be rejected, not just >1D."""
coord_0d = CoordPartial(shape=())
assert coord_0d.ndim == 0
with pytest.raises(CoordError, match="1D coords"):
coord_0d.select(np.array([0, 1]), samples=True)

def test_get_sample_count_2d_raises(self, coord_2d):
"""get_sample_count requires a 1D coord."""
with pytest.raises(CoordError, match="1D coords"):
Expand Down
Loading