[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 "<doctest default[4]>", line 1, in <module>

        tree.traverse(make_action_immutable, d, top_down=False)

    NameError: name 'make_action_immutable' is not defined

```
This commit is contained in:
Kai Fricke 2022-04-29 19:13:24 +01:00 committed by GitHub
parent 3c3b5390d6
commit 7a4d58d80f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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