jcmgray / quimb

A python library for quantum information and many-body calculations including tensor networks.
http://quimb.readthedocs.io
Other
455 stars 107 forks source link

Fix empty lines in dimacs #215

Closed jjcmoon closed 6 months ago

jjcmoon commented 6 months ago

Encountered a bug where .cnf files couldn't be loaded if they contain empty lines (see below). Fixed by moving the empty line check up.

  File ".../quimb/tensor/tensor_builder.py", line 2607, in cnf_file_parse
    if args[0] == "p":
IndexError: list index out of range
pep8speaks commented 6 months ago

Hello @jjcmoon! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 2761:1: W293 blank line contains whitespace

jcmgray commented 6 months ago

LGTM, thanks!