From dfe724a401838e2bd2147b42b6d09c4a06584656 Mon Sep 17 00:00:00 2001 From: yancong Date: Wed, 7 Sep 2022 11:01:40 +0800 Subject: [PATCH] dev(dispatch): rename MMEvalDispatcher to _MMEvalDispatcher --- mmeval/core/dispatcher.py | 6 +++--- tests/test_core/test_dispatcher.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mmeval/core/dispatcher.py b/mmeval/core/dispatcher.py index 5cef74f2..371cca72 100644 --- a/mmeval/core/dispatcher.py +++ b/mmeval/core/dispatcher.py @@ -39,7 +39,7 @@ Benefit from the tricks above, plum dispatch got twice faster as before. More detail can be found at: https://github.com/wesselb/plum/issues/53 -Besides, we implement `MMEvalDispatcher` to extend plum dispatch for better +Besides, we implement `_MMEvalDispatcher` to extend plum dispatch for better support of ``typing.ForwardRef``. """ @@ -128,7 +128,7 @@ def __hash__(self): 'The multiple dispatch speed may be slow.') -class MMEvalDispatcher(plum.Dispatcher): +class _MMEvalDispatcher(plum.Dispatcher): """A Dispatcher inherited from ``plum.Dispatcher`` that resolve ``typing.ForwardRef``. @@ -222,4 +222,4 @@ def __call__(self, return super().__call__(method=method, **kwargs) -dispatch = MMEvalDispatcher() +dispatch = _MMEvalDispatcher() diff --git a/tests/test_core/test_dispatcher.py b/tests/test_core/test_dispatcher.py index 92d5aa9c..8ec8750e 100644 --- a/tests/test_core/test_dispatcher.py +++ b/tests/test_core/test_dispatcher.py @@ -4,7 +4,7 @@ import pytest from typing import Dict, List, overload -from mmeval.core.dispatcher import MMEvalDispatcher, dispatch +from mmeval.core.dispatcher import _MMEvalDispatcher, dispatch try: import torch @@ -14,7 +14,7 @@ class TestMMEvalDispatcher(): - dispatcher = MMEvalDispatcher() + dispatcher = _MMEvalDispatcher() def test_resolve_importable_type(self): ty = self.dispatcher._resolve_importable_type('numpy.ndarray')