Skip to content

Commit

Permalink
formatted with black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
mbsantiago committed Nov 27, 2023
1 parent f9e38d4 commit aa59a75
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/soundevent/data/clip_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

from soundevent.data.clips import Clip
from soundevent.data.notes import Note
from soundevent.data.sound_event_annotations import SoundEventAnnotation
from soundevent.data.sequence_annotations import SequenceAnnotation
from soundevent.data.sound_event_annotations import SoundEventAnnotation
from soundevent.data.tags import Tag

__all__ = [
Expand Down
5 changes: 2 additions & 3 deletions src/soundevent/evaluation/tasks/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Iterable, Tuple, Sequence
from typing import Iterable, Sequence, Tuple

from soundevent import data

Expand All @@ -8,8 +8,7 @@ def iterate_over_valid_clips(
clip_annotations: Sequence[data.ClipAnnotation],
) -> Iterable[Tuple[data.ClipAnnotation, data.ClipPrediction]]:
annotated_clips = {
example.clip.uuid: example
for example in clip_annotations
example.clip.uuid: example for example in clip_annotations
}

for predictions in clip_predictions:
Expand Down
2 changes: 1 addition & 1 deletion src/soundevent/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
This module contains the classes and functions for reading and writing
sound event data.
"""
from soundevent.io.saver import save
from soundevent.io.loader import load
from soundevent.io.saver import save
from soundevent.io.types import DataCollections

__all__ = [
Expand Down
3 changes: 2 additions & 1 deletion src/soundevent/io/aoef/recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def assemble_aoef(
notes = [self._note_adapter.to_aoef(note) for note in obj.notes]

owners = [
self._user_adapter.to_aoef(owner).uuid for owner in obj.owners or []
self._user_adapter.to_aoef(owner).uuid
for owner in obj.owners or []
]

path = obj.path
Expand Down
2 changes: 1 addition & 1 deletion src/soundevent/io/aoef/user.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, Hashable
from typing import Hashable, Optional
from uuid import UUID, uuid4

from pydantic import BaseModel
Expand Down
8 changes: 6 additions & 2 deletions tests/test_evaluation/test_clip_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ def test_each_example_score_is_the_probability_of_the_true_class(
assert len(evaluation.clip_evaluations[1].metrics) == 1

assert evaluation.clip_evaluations[0].score is not None
assert math.isclose(evaluation.clip_evaluations[0].score, 0.9, rel_tol=1e-6)
assert math.isclose(
evaluation.clip_evaluations[0].score, 0.9, rel_tol=1e-6
)

assert evaluation.clip_evaluations[1].score is not None
assert math.isclose(evaluation.clip_evaluations[1].score, 0.1, rel_tol=1e-6)
assert math.isclose(
evaluation.clip_evaluations[1].score, 0.1, rel_tol=1e-6
)
1 change: 1 addition & 0 deletions tests/test_io/test_aoef/test_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
SequenceObject,
)


def test_sequence_can_be_converted_to_aoef(
sequence: data.Sequence,
sequence_adapter: SequenceAdapter,
Expand Down

0 comments on commit aa59a75

Please sign in to comment.