dwavesystems / dwavesystems/dwave-optimization

Silent casting of int symbol's state in some cases

Open
#25 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
31
Forks
36
Avg merge
16h 55m
Merged PRs (30d)
8

Description

Silent casting of int only when boundaries are defined:

1. Got what I expected:
```
>>> i = model.integer()
>>> with model.lock():
model.states.resize(1)
i.set_state(0, -2.5)
print(i.state(0))
ValueError: Invalid data provided for node
```

2. Got surprised:
```
j = model.integer(lower_bound=-5, upper_bound=0)
>>> with model.lock():
model.states.resize(1)
j.set_state(0, -2.5)
print(j.state(0))
-2.0
```

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.