dwavesystems / dwavesystems/dwave-preprocessing

Presolver.detach_model() should cause subsequent access to model to fail

Open
#58 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
9
Forks
18
PR merge metrics
No merged PRs in 30d

Description

The ``detach_model()`` [docs](https://docs.ocean.dwavesys.com/en/stable/docs_preprocessing/reference/generated/dwave.preprocessing.presolve.Presolver.detach_model.html#dwave.preprocessing.presolve.Presolver.detach_model) say "Subsequent attempts to access the model will raise a [RuntimeError](https://docs.python.org/3/library/exceptions.html#RuntimeError)" but that is not happening:

```
pre = Presolver(cqm)
pre.load_default_presolvers()
pre.detach_model()
cqm2 = pre.copy_model()
>>> type(cqm2)
dimod.constrained.constrained.ConstrainedQuadraticModel
>>> cqm2.is_equal(dimod.ConstrainedQuadraticModel())
True
```

The post-detach ``cqm2 = pre.copy_model()`` command gives no error and happily generates an empty CQM.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.