Skip to content

Commit c767576

Browse files
committed
Replace Engarde assertion by a manual assertion.
This dependency is not pulling its own weight.
1 parent dc217c2 commit c767576

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

loudspeakerexplorer/data.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import re
22

3-
import engarde.decorators as ed
43
import pandas as pd
54

65

@@ -72,15 +71,17 @@ def _load_fr(file):
7271
.pipe(_index_by_frequency))
7372

7473

75-
@ed.none_missing()
7674
def load_speaker(dir):
77-
# If the none_missing() assertion fires, it likely means something is wrong or
78-
# corrupted in the data files of the speaker (e.g. some frequencies present in
79-
# some columns/files but not others)
80-
return pd.concat(
75+
speaker = pd.concat(
8176
(_load_fr(file) for file in filter(lambda path: not path.name in (
8277
'LICENSE.txt', 'Read License Agreement.txt', 'speaker_metadata.yaml'), dir.iterdir())),
8378
axis='columns')
79+
if speaker.isna().any(axis=None):
80+
# If this fires, it likely means something is wrong or corrupted in the
81+
# data files of the speaker (e.g. some frequencies present in some
82+
# columns/files but not others)
83+
raise AssertionError
84+
return speaker
8485

8586

8687
def convert_angles(df):

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
numpy
22
pandas
3-
engarde
43
ipywidgets
54
dominate
65
altair

0 commit comments

Comments
 (0)