Skip to content

Commit

Permalink
Merge pull request #45 from mbsantiago/fix/broken-geometry-update
Browse files Browse the repository at this point in the history
Fix Sound Event Geometry Update Bug
  • Loading branch information
mbsantiago authored Dec 4, 2024
2 parents 351ff06 + e9b4e54 commit 38c8e21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion back/src/whombat/api/sound_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ async def update_geometric_features(
The updated sound event.
"""
geom_features = compute_geometric_features(sound_event.geometry)

for feature in geom_features:
try:
sound_event = await self.update_feature(
Expand All @@ -341,7 +342,9 @@ async def update_geometric_features(
schemas.Feature(name=feature.name, value=feature.value),
)

feature_mapping = {f.name: f for f in geom_features}
feature_mapping = {
f.name: schemas.Feature.model_validate(f) for f in geom_features
}
sound_event = sound_event.model_copy(
update=dict(
features=[
Expand Down

0 comments on commit 38c8e21

Please sign in to comment.