dwavesystems / dwavesystems/dimod

Error reporting: would be helpful to identify the offending parameter

Open
#1,405 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
143
Forks
91
Avg merge
1h 24m
Merged PRs (30d)
3

Description

**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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.