From 7a4d58d80f94a2c25c33cc75392d6456294aa2a3 Mon Sep 17 00:00:00 2001 From: Kai Fricke Date: Fri, 29 Apr 2022 19:13:24 +0100 Subject: [PATCH] [rllib] Fix doctest failure (#24343) Lint was still failing (but only caught with doctest): ``` File "../../python/ray/rllib/utils/numpy.py", line ?, in default Failed example: tree.traverse(make_action_immutable, d, top_down=False) Exception raised: Traceback (most recent call last): File "/opt/miniconda/lib/python3.6/doctest.py", line 1330, in __run compileflags, 1), test.globs) File "", line 1, in tree.traverse(make_action_immutable, d, top_down=False) NameError: name 'make_action_immutable' is not defined ``` --- rllib/utils/numpy.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rllib/utils/numpy.py b/rllib/utils/numpy.py index 5b83ca9c7..b7b297419 100644 --- a/rllib/utils/numpy.py +++ b/rllib/utils/numpy.py @@ -322,6 +322,7 @@ def make_action_immutable(obj): Examples: >>> import tree >>> import numpy as np + >>> from ray.rllib.utils.numpy import make_action_immutable >>> arr = np.arange(1,10) >>> d = dict(a = 1, b = (arr, arr)) >>> tree.traverse(make_action_immutable, d, top_down=False) # doctest: +SKIP