mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00

* Remove all __future__ imports from RLlib. * Remove (object) again from tf_run_builder.py::TFRunBuilder. * Fix 2xLINT warnings. * Fix broken appo_policy import (must be appo_tf_policy) * Remove future imports from all other ray files (not just RLlib). * Remove future imports from all other ray files (not just RLlib). * Remove future import blocks that contain `unicode_literals` as well. Revert appo_tf_policy.py to appo_policy.py (belongs to another PR). * Add two empty lines before Schedule class. * Put back __future__ imports into determine_tests_to_run.py. Fails otherwise on a py2/print related error.
48 lines
1.6 KiB
Python
48 lines
1.6 KiB
Python
def override(cls):
|
|
"""Annotation for documenting method overrides.
|
|
|
|
Arguments:
|
|
cls (type): The superclass that provides the overriden method. If this
|
|
cls does not actually have the method, an error is raised.
|
|
"""
|
|
|
|
def check_override(method):
|
|
if method.__name__ not in dir(cls):
|
|
raise NameError("{} does not override any method of {}".format(
|
|
method, cls))
|
|
return method
|
|
|
|
return check_override
|
|
|
|
|
|
def PublicAPI(obj):
|
|
"""Annotation for documenting public APIs.
|
|
|
|
Public APIs are classes and methods exposed to end users of RLlib. You
|
|
can expect these APIs to remain stable across RLlib releases.
|
|
|
|
Subclasses that inherit from a ``@PublicAPI`` base class can be
|
|
assumed part of the RLlib public API as well (e.g., all trainer classes
|
|
are in public API because Trainer is ``@PublicAPI``).
|
|
|
|
In addition, you can assume all trainer configurations are part of their
|
|
public API as well.
|
|
"""
|
|
|
|
return obj
|
|
|
|
|
|
def DeveloperAPI(obj):
|
|
"""Annotation for documenting developer APIs.
|
|
|
|
Developer APIs are classes and methods explicitly exposed to developers
|
|
for the purposes of building custom algorithms or advanced training
|
|
strategies on top of RLlib internals. You can generally expect these APIs
|
|
to be stable sans minor changes (but less stable than public APIs).
|
|
|
|
Subclasses that inherit from a ``@DeveloperAPI`` base class can be
|
|
assumed part of the RLlib developer API as well (e.g., all policy
|
|
optimizers are developer API because PolicyOptimizer is ``@DeveloperAPI``).
|
|
"""
|
|
|
|
return obj
|