Remove todos and update docstrings

This commit is contained in:
Ines Montani 2020-08-28 20:34:46 +02:00
parent 3ce5be4b76
commit 1e0363290e

View File

@ -850,24 +850,23 @@ class Language:
def disable_pipe(self, name: str) -> None:
"""Disable a pipeline component. The component will still exist on
the nlp object, but it won't be run as part of the pipeline.
the nlp object, but it won't be run as part of the pipeline. Does
nothing if the component is already disabled.
name (str): The name of the component to disable.
"""
if name not in self._pipe_names:
raise ValueError(Errors.E001.format(name=name, opts=self._pipe_names))
# TODO: should we raise if pipe is already disabled?
self._disabled.add(name)
def enable_pipe(self, name: str) -> None:
"""Enable a previously disabled pipeline component so it's run as part
of the pipeline.
of the pipeline. Does nothing if the component is already enabled.
name (str): The name of the component to enable.
"""
if name not in self._pipe_names:
raise ValueError(Errors.E001.format(name=name, opts=self._pipe_names))
# TODO: should we raise if pipe is already enabled?
if name in self._disabled:
self._disabled.remove(name)