From f8a4c4012e0c87c7c7476e4096943822266c4cb3 Mon Sep 17 00:00:00 2001 From: Kevin Sheppard Date: Fri, 11 Oct 2024 11:38:19 +0100 Subject: [PATCH] DOC: Add warning to UBG Add a warning closes #389 --- randomgen/wrapper.pyx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/randomgen/wrapper.pyx b/randomgen/wrapper.pyx index 6ee7cf48e..a4a63f01d 100644 --- a/randomgen/wrapper.pyx +++ b/randomgen/wrapper.pyx @@ -72,6 +72,16 @@ cdef class UserBitGenerator(BitGenerator): a single input. If not provided, getting the ``state`` property will raise NotImplementedError. + Notes + ----- + There is one key caveat when using a UserBitGenerator. The callable must run without + exceptions. + + .. warning:: + It is essential that the callable function runs without producing an Exception. + Exceptions will be silently ignored and the generator will produce incorrect + results. + Examples -------- A generator that rotates across 4 values from random.org.