Skip to content

Commit

Permalink
fix merge-error
Browse files Browse the repository at this point in the history
  • Loading branch information
yeelauren committed Jan 24, 2024
1 parent fae84cc commit e5b60a8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spacer/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"""
import time
import traceback
from logging import getLogger

from typing import Callable
from spacer import config
from spacer.data_classes import ImageFeatures
from spacer.messages import \
Expand All @@ -28,8 +27,14 @@ def extract_features(msg: ExtractFeaturesMsg) -> ExtractFeaturesReturnMsg:

check_extract_inputs(img, msg.rowcols, msg.image_loc.key)

check_rowcols(msg.rowcols, img)
if not isinstance(msg.extractor, Callable):
raise TypeError("msg.extractor must be callable")

with config.log_entry_and_exit('actual extraction'):
features, return_msg = msg.extractor(img, msg.rowcols)
if not hasattr(features, 'store'):
raise TypeError("features object must have a store method")

with config.log_entry_and_exit('storing features'):
features.store(msg.feature_loc)
Expand Down

0 comments on commit e5b60a8

Please sign in to comment.