Skip to content

Commit 3205ece

Browse files
committed
small change in validation of field
1 parent e0481ae commit 3205ece

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • src/mmirage/core/process/processors/image_gen

src/mmirage/core/process/processors/image_gen/config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,12 @@ def is_computable(self, vars: Sequence[BaseVar]) -> bool:
248248
)
249249
return False
250250

251-
if self.output_mode not in set(ImageOutputMode):
251+
try:
252+
self.output_mode = ImageOutputMode(self.output_mode)
253+
except ValueError:
252254
logger.warning(
253-
f"⚠️ Invalid output_mode for {self.name}: {self.output_mode}. Expected one of {[m.value for m in ImageOutputMode]}"
255+
f"⚠️ Invalid output_mode for {self.name}: {self.output_mode}. "
256+
f"Expected one of {[m.value for m in ImageOutputMode]}"
254257
)
255258
return False
256259

0 commit comments

Comments
 (0)