Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/crowsetta/formats/bbox/raven.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class RavenSchema(pandera.pandas.DataFrameModel):

begin_time_s: Series[float] = pandera.pandas.Field()
end_time_s: Series[float] = pandera.pandas.Field()
low_freq_hz: Series[float] = pandera.pandas.Field()
high_freq_hz: Series[float] = pandera.pandas.Field()
low_freq_hz: Series[float] = pandera.pandas.Field(coerce=True)
high_freq_hz: Series[float] = pandera.pandas.Field(coerce=True)
annotation: Series[pd.StringDtype] = pandera.pandas.Field(coerce=True)

class Config:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_formats/test_bbox/test_audbbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_raven_schema_bad_df(self, an_audbbox_path):
# if we just load the csv directly, it will be invalid
df = pd.read_csv(an_audbbox_path, sep="\t", header=None)

with pytest.raises(pandera.errors.SchemaError):
with pytest.raises(pandera.errors.SchemaErrors):
crowsetta.formats.bbox.audbbox.AudBBoxSchema.validate(df)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_formats/test_seq/test_audseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_audseq_schema_bad_df(self, an_audseq_path):
audseq_df = pd.read_csv(an_audseq_path, sep="\t", header=None)
# notice: wrong column name 'stop_time'
audseq_df.columns = ["start_time", "stop_time", "label"]
with pytest.raises(pandera.errors.SchemaError):
with pytest.raises(pandera.errors.SchemaErrors):
crowsetta.formats.seq.audseq.AudSeqSchema.validate(audseq_df)


Expand Down
4 changes: 2 additions & 2 deletions tests/test_formats/test_seq/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_missing_column_raises(self, csv_missing_fields_in_header):
def test_invalid_column_raises(self, csv_with_invalid_fields_in_header):
"""test that invalid column name 'invalid' raises a schema error"""
invalid_df = pd.read_csv(csv_with_invalid_fields_in_header)
with pytest.raises(pandera.errors.SchemaError):
with pytest.raises(pandera.errors.SchemaErrors):
crowsetta.formats.seq.generic.GenericSeqSchema.validate(invalid_df)

def test_onset_s_with_no_offset_s_raises(self, csv_with_onset_s_but_no_offset_s):
Expand Down Expand Up @@ -378,7 +378,7 @@ def test_csv2annot_missing_fields_raises(self, csv_missing_fields_in_header):
crowsetta.formats.seq.generic.csv2annot(csv_path=csv_missing_fields_in_header)

def test_csv2annot_invalid_fields_raises(self, csv_with_invalid_fields_in_header):
with pytest.raises(pandera.errors.SchemaError):
with pytest.raises(pandera.errors.SchemaErrors):
crowsetta.formats.seq.generic.csv2annot(csv_path=csv_with_invalid_fields_in_header)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_formats/test_seq/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_simple_seq_schema_bad_df(self, a_simple_csv_path):
simple_df = pd.read_csv(a_simple_csv_path)
# notice: wrong column names
simple_df.columns = ["text", "begin_sample", "end_sample"]
with pytest.raises(pandera.errors.SchemaError):
with pytest.raises(pandera.errors.SchemaErrors):
simple_df = crowsetta.formats.seq.simple.SimpleSeqSchema.validate(simple_df)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_formats/test_seq/test_timit.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_timit_schema_bad_df(self, a_transcript_path):
phn_df = pd.read_csv(a_transcript_path, sep=" ", header=None)
# notice: wrong column names
phn_df.columns = ["text", "begin_sample", "end_sample"]
with pytest.raises(pandera.errors.SchemaError):
with pytest.raises(pandera.errors.SchemaErrors):
phn_df = crowsetta.formats.seq.timit.TimitTranscriptSchema.validate(phn_df)


Expand Down
Loading