Skip to content

ParamResolver does not have evaluatable repr #2552

Closed
@kevinsung

Description

@kevinsung

The reason is that values can be resolved into instances of sympy.Basic. For instance, repr(cirq.ParamResolver({'a': sympy.Symbol('b') + 1})) evaluates to "cirq.ParamResolver({'a': b + 1})" where the b is not a defined expression.

This is currently blocking JSON serialization of ParamResolver because the serialization test insists that the repr be evaluatable. Should we drop this requirement for ParamResolver? Or should we actually try to get an evaluatable repr for arbitrary sympy.Basic instances? As @mpharrigan mentioned in #2014 we could maybe use sympy.srepr.

@Strilanc

Metadata

Metadata

Assignees

No one assigned

    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