From f4405ca3ad710835e2861de0a846b8ec974718b0 Mon Sep 17 00:00:00 2001 From: shademe Date: Tue, 14 Jun 2022 15:49:01 +0200 Subject: [PATCH] Export function signature to allow introspection of args in tests --- spacy/pipeline/trainable_pipe.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/pipeline/trainable_pipe.pyx b/spacy/pipeline/trainable_pipe.pyx index e4ef6134f..b5f243ab4 100644 --- a/spacy/pipeline/trainable_pipe.pyx +++ b/spacy/pipeline/trainable_pipe.pyx @@ -1,5 +1,6 @@ -# cython: infer_types=True, profile=True +# cython: infer_types=True, profile=True, binding = True import functools +import inspect from typing import Iterable, Iterator, Optional, Dict, Tuple, Callable import srsly from thinc.api import set_dropout_rate, Model, Optimizer @@ -26,6 +27,7 @@ def trainable_pipe_nvtx_range(func): with use_nvtx_range(f"{self.name} {func.__name__}"): return func(self, *args, **kwargs) + inner.__signature__ = inspect.signature(func) return inner