Merge pull request #7702 from bebatut/fix_mtx_sniff

Relax the 1st line sniffing for mtx (not only real coordinate)
This commit is contained in:
John Chilton
2019-04-09 12:42:51 -04:00
committed by GitHub
2 changed files with 18 additions and 1 deletions
+3 -1
View File
@@ -1193,6 +1193,8 @@ class MatrixMarket(TabularData):
True
>>> MatrixMarket().sniff( get_test_fname( '2.mtx' ) )
True
>>> MatrixMarket().sniff( get_test_fname( '3.mtx' ) )
True
"""
file_ext = "mtx"
@@ -1200,7 +1202,7 @@ class MatrixMarket(TabularData):
super(MatrixMarket, self).__init__(**kwd)
def sniff_prefix(self, file_prefix):
return file_prefix.startswith('%%MatrixMarket matrix coordinate real general')
return file_prefix.startswith('%%MatrixMarket matrix coordinate')
def set_meta(self, dataset, overwrite=True, skip=None, max_data_lines=5, **kwd):
if dataset.has_data():
+15
View File
@@ -0,0 +1,15 @@
%%MatrixMarket matrix coordinate integer general
%
343 12 12
201 1 1
123 2 1
283 3 1
318 4 1
175 5 1
12 6 1
132 7 1
197 8 1
222 9 1
236 10 1
317 11 1
127 12 1