You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a Type error issue when using this package with Pytest:
venv/lib/python3.10/site-packages/seg_metrics/seg_metrics.py:355: in write_metrics
metrics_dict_all_labels = get_metrics_dict_all_labels(labels, gdth, pred, spacing=gdth_spacing[::-1],
venv/lib/python3.10/site-packages/seg_metrics/seg_metrics.py:213: in get_metrics_dict_all_labels logging.info('\nstart to get metrics for label: ', label)
/usr/local/lib/python3.10/logging/init.py:2138: in info
root.info(msg, *args, **kwargs)
/usr/local/lib/python3.10/logging/init.py:1477: in info
self._log(INFO, msg, args, **kwargs)
/usr/local/lib/python3.10/logging/init.py:1624: in _log
self.handle(record)
/usr/local/lib/python3.10/logging/init.py:1634: in handle
self.callHandlers(record)
/usr/local/lib/python3.10/logging/init.py:1696: in callHandlers
hdlr.handle(record)
/usr/local/lib/python3.10/logging/init.py:968: in handle
self.emit(record)
/usr/local/lib/python3.10/site-packages/_pytest/logging.py:342: in emit
super().emit(record)
/usr/local/lib/python3.10/logging/init.py:1108: in emit
self.handleError(record)
/usr/local/lib/python3.10/logging/init.py:1100: in emit
msg = self.format(record)
/usr/local/lib/python3.10/logging/init.py:943: in format
return fmt.format(record)
/usr/local/lib/python3.10/site-packages/_pytest/logging.py:113: in format
return super().format(record)
/usr/local/lib/python3.10/logging/init.py:678: in format
record.message = record.getMessage()
def getMessage(self):
"""
Return the message for this LogRecord.
Return the message for this LogRecord after merging any user-supplied
arguments with the message.
"""
msg = str(self.msg)
if self.args:
msg = msg % self.args
E TypeError: not all arguments converted during string formatting
The fix is to change this line to: logging.info(f'\nstart to get metrics for label: {label}')
The text was updated successfully, but these errors were encountered:
https://github.com/Jingnan-Jia/segmentation_metrics/blob/5387ddb07c31f65c0617ecb6ae88f8170cc305fa/seg_metrics/seg_metrics.py#L213C9-L213C66
There is a Type error issue when using this package with Pytest:
venv/lib/python3.10/site-packages/seg_metrics/seg_metrics.py:355: in write_metrics
metrics_dict_all_labels = get_metrics_dict_all_labels(labels, gdth, pred, spacing=gdth_spacing[::-1],
venv/lib/python3.10/site-packages/seg_metrics/seg_metrics.py:213: in get_metrics_dict_all_labels
logging.info('\nstart to get metrics for label: ', label)
/usr/local/lib/python3.10/logging/init.py:2138: in info
root.info(msg, *args, **kwargs)
/usr/local/lib/python3.10/logging/init.py:1477: in info
self._log(INFO, msg, args, **kwargs)
/usr/local/lib/python3.10/logging/init.py:1624: in _log
self.handle(record)
/usr/local/lib/python3.10/logging/init.py:1634: in handle
self.callHandlers(record)
/usr/local/lib/python3.10/logging/init.py:1696: in callHandlers
hdlr.handle(record)
/usr/local/lib/python3.10/logging/init.py:968: in handle
self.emit(record)
/usr/local/lib/python3.10/site-packages/_pytest/logging.py:342: in emit
super().emit(record)
/usr/local/lib/python3.10/logging/init.py:1108: in emit
self.handleError(record)
/usr/local/lib/python3.10/logging/init.py:1100: in emit
msg = self.format(record)
/usr/local/lib/python3.10/logging/init.py:943: in format
return fmt.format(record)
/usr/local/lib/python3.10/site-packages/_pytest/logging.py:113: in format
return super().format(record)
/usr/local/lib/python3.10/logging/init.py:678: in format
record.message = record.getMessage()
E TypeError: not all arguments converted during string formatting
The fix is to change this line to:
logging.info(f'\nstart to get metrics for label: {label}')
The text was updated successfully, but these errors were encountered: