scenic.core.utils¶
Assorted utility functions and common exceptions.
Summary of Module Members¶
Functions
Whether two objects are equivalent, i.e. |
|
|
|
Decorator for making a method with no arguments cache its result |
Exceptions
Error for scenarios with inconsistent requirements. |
|
Error raised for syntactically-valid but otherwise problematic Scenic programs. |
|
An error produced by attempting to parse an invalid Scenic program. |
|
A Scenic parse error generated during execution of the translated Python. |
Member Details¶
-
areEquivalent
(a, b)[source]¶ Whether two objects are equivalent, i.e. have the same properties.
This is only used for debugging, e.g. to check that a Distribution is the same before and after pickling. We don’t want to define __eq__ for such objects since for example two values sampled with the same distribution are equivalent but not semantically identical: the code:
X = (0, 1) Y = (0, 1)
does not make X and Y always have equal values!
-
exception
ParseError
[source]¶ Bases:
Exception
An error produced by attempting to parse an invalid Scenic program.
-
exception
RuntimeParseError
[source]¶ Bases:
scenic.core.utils.ParseError
A Scenic parse error generated during execution of the translated Python.
-
exception
InvalidScenarioError
[source]¶ Bases:
Exception
Error raised for syntactically-valid but otherwise problematic Scenic programs.
-
exception
InconsistentScenarioError
(line, message)[source]¶ Bases:
scenic.core.utils.InvalidScenarioError
Error for scenarios with inconsistent requirements.