Skip to content

Error reporting: would be helpful to identify the offending parameter #1405

@JoelPasvolsky

Description

@JoelPasvolsky

Description
If you set a dict as the value of an Ising term, ```BinaryQuadraticModel.from_ising()`` correctly errors and reports that the value should not be a dict, but doesn't specify the offending parameter.

Steps To Reproduce

>>> sampleset = DWaveSampler().sample_ising({0: {1, 2}, 1: 0}, {(0, 1): 0}, num_reads=10)
TypeError: must be real number, not set

Here it's clear but if the value was a variable, less so.

Expected Behavior
Be nice to say "TypeError: Ising terms must be real number, not set" or "TypeError: h must be real number, not set"

Environment

  • OS: WIN11
  • Python version: 3.10

Additional Context
Low priority bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions