Skip to content

Commit

Permalink
black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
eberrigan committed Apr 8, 2024
1 parent 3eeb9fd commit b4bdca1
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions tests/io/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1563,23 +1563,26 @@ def test_export_nwb(centered_pair_predictions: Labels, tmpdir):
assert_read_labels_match(centered_pair_predictions, read_labels)


@pytest.mark.parametrize("labels_fixture_name", [
"centered_pair_labels",
"centered_pair_predictions",
"min_labels",
"min_labels_slp",
"min_labels_robot"
])
@pytest.mark.parametrize(
"labels_fixture_name",
[
"centered_pair_labels",
"centered_pair_predictions",
"min_labels",
"min_labels_slp",
"min_labels_robot",
],
)
def test_export_csv(labels_fixture_name, tmpdir, request):
# Retrieve Labels fixture by name
labels_fixture = request.getfixturevalue(labels_fixture_name)

# Generate the filename for the CSV file
csv_filename = Path(tmpdir) / (labels_fixture_name + "_export.csv")

# Export to CSV file
labels_fixture.export_csv(str(csv_filename))

# Assert that the CSV file was created
assert csv_filename.is_file(), f"CSV file '{csv_filename}' was not created"

Expand All @@ -1592,16 +1595,11 @@ def test_exported_csv(tmpdir, min_labels_slp, minimal_instance_predictions_csv_p
labels.export_csv(filename_csv)
# Read the CSV file
labels_csv = pd.read_csv(filename_csv)

# Read the csv file fixture
csv_predictions = pd.read_csv(minimal_instance_predictions_csv_path)

assert labels_csv.equals(csv_predictions)

# check number of cols
assert len(labels_csv.columns) - 3 == len(get_nodes_as_np_strings(labels)) * 3





0 comments on commit b4bdca1

Please sign in to comment.