Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_cnf returns no constraints from CNF file #104

Open
pau557 opened this issue Jun 2, 2020 · 1 comment
Open

load_cnf returns no constraints from CNF file #104

pau557 opened this issue Jun 2, 2020 · 1 comment
Labels

Comments

@pau557
Copy link

pau557 commented Jun 2, 2020

Description
I'm reading a CNF file with load_cnf, but the function returns a csp object without constraints

Steps To Reproduce

In [1]: import dwavebinarycsp as dbcsp

In [2]: cnf_file = "nae3sat_ratio210_size10_inst1.cnf"

In [3]: with open(cnf_file, 'r') as fp:
   ...:     csp = dbcsp.cnf.load_cnf(fp)
   ...:     

In [4]: csp.constraints
Out[4]: []

nae3sat_ratio210_size10_inst1.cnf.zip

Expected Behavior
I would expect the csp object to have the constraints in the file

Environment

  • OS: Mac OS 10.14.6
  • Python version: 3.7.0
  • dwavebinarycsp version: 0.1.1
@arcondello
Copy link
Member

arcondello commented Jun 2, 2020

I believe changing line 4 to p cnf _ _ will fix it. But the function should raise a better exception.

@arcondello arcondello added the bug label Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants