Skip to content

Commit

Permalink
Fix tests for audio_count_loud
Browse files Browse the repository at this point in the history
  • Loading branch information
rantahar committed Oct 21, 2024
1 parent 21a77f7 commit 1ed8a94
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/preprocessing/test_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_audio_features():
test_user1 = test[test["user"] == "jd9INuQ5BBlW"]
assert test_user1["audio_count_silent"].sum() == 0
assert test_user1.loc[pd.Timestamp("2020-01-09 02:00:00", tz='Europe/Helsinki')]["audio_count_silent"] == 0
assert test_user1["audio_count_loud"].sum() == 16
assert test_user1["audio_count_loud"].sum() == 12
assert test_user1.loc[pd.Timestamp("2020-01-09 10:30:00", tz='Europe/Helsinki')]["audio_min_freq"] == 9601
assert test_user1.loc[pd.Timestamp("2020-01-09 10:30:00", tz='Europe/Helsinki')]["audio_max_freq"] == 9601
assert test_user1.loc[pd.Timestamp("2020-01-09 10:30:00", tz='Europe/Helsinki')]["audio_mean_freq"] == 9601
Expand All @@ -33,7 +33,7 @@ def test_audio_features():
assert test_user2["audio_count_silent"].sum() == 3
assert test_user2.loc[pd.Timestamp("2019-08-13 15:00:00", tz='Europe/Helsinki')]["audio_count_silent"] == 2
assert test_user2.loc[pd.Timestamp("2019-08-13 15:30:00", tz='Europe/Helsinki')]["audio_count_speech"] == 1
assert test_user2["audio_count_loud"].sum() == 17
assert test_user2["audio_count_loud"].sum() == 10
assert test_user2.loc[pd.Timestamp("2019-08-13 15:00:00", tz='Europe/Helsinki')]["audio_min_freq"] == 2914
assert test_user2.loc[pd.Timestamp("2019-08-13 15:00:00", tz='Europe/Helsinki')]["audio_max_freq"] == 7195
assert test_user2.loc[pd.Timestamp("2019-08-13 15:00:00", tz='Europe/Helsinki')]["audio_mean_freq"] == 5054.5
Expand All @@ -57,9 +57,9 @@ def test_audio_features():
assert test_user1_dev1.loc[pd.Timestamp("2020-01-09", tz='Europe/Helsinki')]["audio_count_silent"] == 0
assert test_user2.loc[pd.Timestamp("2019-08-13", tz='Europe/Helsinki')]["audio_count_silent"] == 3
assert test_user2.loc[pd.Timestamp("2019-08-13", tz='Europe/Helsinki')]["audio_count_speech"] == 1
assert test_user1_dev1.loc[pd.Timestamp("2020-01-09", tz='Europe/Helsinki')]["audio_count_loud"] == 10
assert test_user1_dev2.loc[pd.Timestamp("2020-01-09", tz='Europe/Helsinki')]["audio_count_loud"] == 6
assert test_user2.loc[pd.Timestamp("2019-08-13", tz='Europe/Helsinki')]["audio_count_loud"] == 17
assert test_user1_dev1.loc[pd.Timestamp("2020-01-09", tz='Europe/Helsinki')]["audio_count_loud"] == 7
assert test_user1_dev2.loc[pd.Timestamp("2020-01-09", tz='Europe/Helsinki')]["audio_count_loud"] == 5
assert test_user2.loc[pd.Timestamp("2019-08-13", tz='Europe/Helsinki')]["audio_count_loud"] == 10

features ={audio.audio_min_freq:{"audio_column_name":"double_frequency","resample_args":{"rule":"2h"}},
audio.audio_max_freq:{"audio_column_name":"double_frequency","resample_args":{"rule":"2h"}},
Expand Down

0 comments on commit 1ed8a94

Please sign in to comment.