Skip to content

Commit

Permalink
move the test inwards
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin committed Dec 18, 2023
1 parent 8eb34d4 commit 38ea764
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/unit/test_ecephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,23 @@ def test_dimensions_warning(self):
) in str(w[-1].message)


def test_get_data_in_units():

data = np.asarray([[1, 1, 1, 1, 1], [1, 1, 1, 1, 1]])
conversion = 1.0
offset = 3.0
channel_conversion = np.asarray([2.0, 2.0])
electrical_series = mock_ElectricalSeries(
data=data,
conversion=conversion,
offset=offset,
channel_conversion=channel_conversion,
)

data_in_units = electrical_series.get_data_in_units()
expected_data = data * conversion * channel_conversion[:, np.newaxis] + offset

np.testing.assert_almost_equal(data_in_units, expected_data)
def test_get_data_in_units(self):

data = np.asarray([[1, 1, 1, 1, 1], [1, 1, 1, 1, 1]])
conversion = 1.0
offset = 3.0
channel_conversion = np.asarray([2.0, 2.0])
electrical_series = mock_ElectricalSeries(
data=data,
conversion=conversion,
offset=offset,
channel_conversion=channel_conversion,
)

data_in_units = electrical_series.get_data_in_units()
expected_data = data * conversion * channel_conversion[:, np.newaxis] + offset

np.testing.assert_almost_equal(data_in_units, expected_data)


class SpikeEventSeriesConstructor(TestCase):
Expand Down

0 comments on commit 38ea764

Please sign in to comment.