mirror of
https://github.com/macaodha/batdetect2.git
synced 2026-04-04 15:20:19 +02:00
Do not crash on failure to plot
This commit is contained in:
parent
13a31d9de9
commit
5a14b29281
@ -10,6 +10,7 @@ from typing import (
|
||||
TypeVar,
|
||||
)
|
||||
|
||||
from loguru import logger
|
||||
from matplotlib.figure import Figure
|
||||
from pydantic import Field
|
||||
from soundevent import data
|
||||
@ -107,8 +108,12 @@ class BaseTask(EvaluationTaskProtocol, Generic[T_Output]):
|
||||
self, eval_outputs: List[T_Output]
|
||||
) -> Iterable[Tuple[str, Figure]]:
|
||||
for plot in self.plots:
|
||||
try:
|
||||
for name, fig in plot(eval_outputs):
|
||||
yield f"{self.prefix}/{name}", fig
|
||||
except Exception as e:
|
||||
logger.error(f"Error plotting {self.prefix}: {e}")
|
||||
continue
|
||||
|
||||
def evaluate(
|
||||
self,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user