Skip to content

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

@JoelPasvolsky

Description

@JoelPasvolsky

The detach_model() docs say "Subsequent attempts to access the model will raise a 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions