#16924: Read DIMACS files
-------------------------------------+-------------------------------------
Reporter: malb | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: PLEASE CHANGE | Resolution:
Keywords: | Merged in:
Authors: Travis Scholl | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/tscholl2/read_dimacs_16924 | d9274c65814bbf7a5601345c3bda1afcb38e26b2
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Travis Scholl', 'oldvalue': ''}):
* status: new => needs_review
* commit: => d9274c65814bbf7a5601345c3bda1afcb38e26b2
* branch: => u/tscholl2/read_dimacs_16924
* author: => Travis Scholl
Comment:
I added a `read` method as described in the comments here. I split it into
two methods, a `read` method with the usual `read(filename)` signature and
also a `load(file_object)` method which actually reads the lines from the
file. This way it's easy to use other kinds of buffers besides files. Also
it allows easy testing using fake files from StringIO. The import uses the
`six` package so the example is compatible with both python 2 and 3. It
should read line by line so it shouldn't store the entire files in memory
as it sounds like people use somewhat larger files for this.
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=d9274c65814bbf7a5601345c3bda1afcb38e26b2
d9274c6]||{{{added satsolver method to read in DIMACS files}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/16924#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.