Skip to content

Capture non-existent block within a scope, and report a nice error message #683

Description

@fsaad
ripl.execute_program('assume x1 = tag("x", "x", normal(0,1))')
ripl.execute_program('assume y1 = tag("y", "y", normal(x1,1))')
ripl.observe('y1', 2)
ripl.execute_program('infer(mh("x", 1, 100))')

The final line crashes noisily since block 1 does not exist in scope "x", leading this dictionary lookup in line 344 to fail:

def getNodesInBlock(self, scope, block, do_copy=True):
#import pdb; pdb.set_trace()
#scope, block = self._normalizeEvaluatedScopeAndBlock(scope, block)
nodes = self.scopes[scope][block]
# Defensively copying the set of nodes, because
# unregisterRandomChoice will mutate them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions