Skip to content

Commit d6768e3

Browse files
authored
fix: use pipeline key for slug not model's (#69)
1 parent 8e2c885 commit d6768e3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

trapdata/api/api.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ def make_algorithm_config_response(
108108

109109
def make_pipeline_config_response(
110110
Classifier: type[APIMothClassifier],
111+
slug: str,
111112
) -> PipelineConfigResponse:
113+
"""
114+
Create a configuration for an entire pipeline, given a species classifier class.
115+
"""
112116
detector = APIMothDetector(
113117
source_images=[],
114118
)
@@ -128,7 +132,7 @@ def make_pipeline_config_response(
128132

129133
return PipelineConfigResponse(
130134
name=classifier.name,
131-
slug=classifier.get_key(),
135+
slug=slug,
132136
description=classifier.description,
133137
version=1,
134138
algorithms=[
@@ -141,8 +145,8 @@ def make_pipeline_config_response(
141145

142146
# @TODO This requires loading all models into memory! Can we avoid this?
143147
PIPELINE_CONFIGS = [
144-
make_pipeline_config_response(classifier_class)
145-
for classifier_class in CLASSIFIER_CHOICES.values()
148+
make_pipeline_config_response(classifier_class, slug=key)
149+
for key, classifier_class in CLASSIFIER_CHOICES.items()
146150
]
147151

148152

0 commit comments

Comments
 (0)