Skip to content

Commit 204bb47

Browse files
authored
Merge pull request #540 from gchq/feature/experimental-warnings
Add warnings to experimental parts of the codebase
2 parents a3ec996 + 357e15a commit 204bb47

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ filterwarnings = [
237237

238238
# Other warnings
239239
"ignore::pytest.PytestCollectionWarning",
240-
"ignore::vanguard.warnings.ExperimentalFeatureWarning",
240+
"ignore::vanguard.warnings.ExperimentalFeatureWarning", # we already know what parts of the code are experimental!
241241
"ignore:The input matches the stored training data. Did you forget to call model.train\\(\\)\\?:gpytorch.utils.warnings.GPInputWarning",
242242
"ignore:To copy construct from a tensor, it is recommended to use sourceTensor.clone\\(\\).detach\\(\\):UserWarning",
243243
"ignore:Pass auto_restart=True to the controller to automatically restart training up to the last stable iterations:UserWarning",

vanguard/classification/kernel.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from vanguard.classification.mixin import Classification, ClassificationMixin
3131
from vanguard.classification.models import InertKernelModel
3232
from vanguard.decoratorutils import Decorator, process_args, wraps_class
33+
from vanguard.warnings import warn_experimental
3334

3435
ControllerT = TypeVar("ControllerT", bound=GPController)
3536
SAMPLE_DIM, TASK_DIM = 0, 2
@@ -41,6 +42,11 @@ class DirichletKernelMulticlassClassification(Decorator):
4142
4243
Based on the paper :cite:`MacKenzie14`.
4344
45+
46+
.. warning::
47+
This decorator is EXPERIMENTAL. It may cause errors or give incorrect results, and may have breaking changes
48+
without warning.
49+
4450
.. warning::
4551
Fuzzy classification (with `classify_fuzzy_points`) is not supported.
4652
@@ -80,6 +86,7 @@ def __init__(self, num_classes: int, **kwargs: Any) -> None:
8086
:param num_classes: The number of target classes.
8187
:param kwargs: Keyword arguments passed to :class:`~vanguard.decoratorutils.basedecorator.Decorator`.
8288
"""
89+
warn_experimental("The DirichletKernelMulticlassClassification decorator")
8390
self.num_classes = num_classes
8491
super().__init__(framework_class=GPController, required_decorators={}, **kwargs)
8592

vanguard/features.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ class HigherRankFeatures(Decorator):
4747
This decorator modifies the gp model class to make it compatible with higher
4848
rank features.
4949
50+
.. warning::
51+
This decorator is EXPERIMENTAL. It may cause errors or give incorrect results, and may have breaking changes
52+
without warning.
53+
5054
:Example:
5155
>>> @HigherRankFeatures(2)
5256
... class NewController(GPController):

0 commit comments

Comments
 (0)