8000 MNT Update liac-arff to 2.3.1 (#11831) · scikit-learn/scikit-learn@f4ce3e8 · GitHub
[go: up one dir, main page]

Skip to content

Commit f4ce3e8

Browse files
jnothmanrth
authored andcommitted
MNT Update liac-arff to 2.3.1 (#11831)
1 parent d2d9abb commit f4ce3e8

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

sklearn/externals/_arff.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
__author_email__ = ('renato.ppontes@gmail.com, '
147147
'feurerm@informatik.uni-freiburg.de, '
148148
'joel.nothman@gmail.com')
149-
__version__ = '2.3'
149+
__version__ = '2.3.1'
150150

151151
import re
152152
import sys
@@ -171,7 +171,7 @@
171171

172172

173173
def _build_re_values():
174-
quoted_re = r'''(?x)
174+
quoted_re = r'''
175175
" # open quote followed by zero or more of:
176176
(?:
177177
(?<!\\) # no additional backslash
@@ -185,7 +185,7 @@ def _build_re_values():
185185
" # close quote
186186
'''
187187
# a value is surrounded by " or by ' or contains no quotables
188-
value_re = r'''(?x)(?:
188+
value_re = r'''(?:
189189
%s| # a value may be surrounded by "
190190
%s| # or by '
191191
[^,\s"'{}]+ # or may contain no characters requiring quoting
@@ -253,7 +253,7 @@ def _parse_values(s):
253253
for match in _RE_SPARSE_KEY_VALUES.finditer(s):
254254
if not match.group(1):
255255
raise BadLayout('Error parsing %r' % match.group())
256-
raise
256+
raise BadLayout('Unknown parsing error')
257257
else:
258258
# an ARFF syntax error
259259
for match in _RE_DENSE_VALUES.finditer(s):
@@ -310,7 +310,7 @@ def __init__(self, value):
310310
)
311311

312312
class BadAttributeType(ArffException):
313-
'''Error raised when some invalid type is provided into the attribute
313+
'''Error raised when some invalid type is provided into the attribute
314314
declaration.'''
315315
message = 'Bad @ATTRIBUTE type, at line %d.'
316316

@@ -327,7 +327,7 @@ def __init__(self, value, value2):
327327
)
328328

329329
class BadNominalValue(ArffException):
330-
'''Error raised when a value in used in some data instance but is not
330+
'''Error raised when a value in used in some data instance but is not
331331
declared into it respective attribute declaration.'''
332332

333333
def __init__(self, value):
@@ -347,7 +347,7 @@ def __init__(self, value):
347347
)
348348

349349
class BadNumericalValue(ArffException):
350-
'''Error raised when and invalid numerical value is used in some data
350+
'''Error raised when and invalid numerical value is used in some data
351351
instance.'''
352352
message = 'Invalid numerical value, at line %d.'
353353

@@ -365,14 +365,14 @@ def __init__(self, msg=''):
365365
self.message = BadLayout.message + ' ' + msg.replace('%', '%%')
366366

367367
class BadObject(ArffException):
368-
'''Error raised when the object representing the ARFF file has something
368+
'''Error raised when the object representing the ARFF file has something
369369
wrong.'''
370370

371371
def __str__(self):
372372
return 'Invalid object.'
373373

374374
class BadObject(ArffException):
375-
'''Error raised when the object representing the ARFF file has something
375+
'''Error raised when the object representing the ARFF file has something
376376
wrong.'''
377377
def __init__(self, msg=''):
378378
self.msg = msg
@@ -636,7 +636,7 @@ def _decode_comment(self, s):
636636
characters.
637637
638638
This method must receive a normalized string, i.e., a string without
639-
padding, including the "\r\n" characters.
639+
padding, including the "\r\n" characters.
640640
641641
:param s: a normalized string.
642642
:return: a string with the decoded comment.
@@ -647,13 +647,13 @@ def _decode_comment(self, s):
647647
def _decode_relation(self, s):
648648
'''(INTERNAL) Decodes a relation line.
649649
650-
The relation declaration is a line with the format ``@RELATION
650+
The relation declaration is a line with the format ``@RELATION
651651
<relation-name>``, where ``relation-name`` is a string. The string must
652652
start with alphabetic character and must be quoted if the name includes
653653
spaces, otherwise this method will raise a `BadRelationFormat` exception.
654654
655655
This method must receive a normalized string, i.e., a string without
656-
padding, including the "\r\n" characters.
656+
padding, including the "\r\n" characters.
657657
658658
:param s: a normalized string.
659659
:return: a string with the decoded relation name.
@@ -670,26 +670,26 @@ def _decode_relation(self, s):
670670
def _decode_attribute(self, s):
671671
'''(INTERNAL) Decodes an attribute line.
672672
673-
The attribute is the most complex declaration in an arff file. All
673+
The attribute is the most complex declaration in an arff file. All
674674
attributes must follow the template::
675675
676676
@attribute <attribute-name> <datatype>
677677
678-
where ``attribute-name`` is a string, quoted if the name contains any
678+
where ``attribute-name`` is a string, quoted if the name contains any
679679
whitespace, and ``datatype`` can be:
680680
681681
- Numerical attributes as ``NUMERIC``, ``INTEGER`` or ``REAL``.
682682
- Strings as ``STRING``.
683683
- Dates (NOT IMPLEMENTED).
684684
- Nominal attributes with format:
685685
686-
{<nominal-name1>, <nominal-name2>, <nominal-name3>, ...}
686+
{<nominal-name1>, <nominal-name2>, <nominal-name3>, ...}
687687
688688
The nominal names follow the rules for the attribute names, i.e., they
689689
must be quoted if the name contains whitespaces.
690690
691691
This method must receive a normalized string, i.e., a string without
692-
padding, including the "\r\n" characters.
692+
padding, including the "\r\n" characters.
693693
694694
:param s: a normalized string.
695695
:return: a tuple (ATTRIBUTE_NAME, TYPE_OR_VALUES).
@@ -874,8 +874,8 @@ def _encode_comment(self, s=''):
874874
def _encode_relation(self, name):
875875
'''(INTERNAL) Decodes a relation line.
876876
877-
The relation declaration is a line with the format ``@RELATION
878-
<relation-name>``, where ``relation-name`` is a string.
877+
The relation declaration is a line with the format ``@RELATION
878+
<relation-name>``, where ``relation-name`` is a string.
879879
880880
:param name: a string.
881881
:return: a string with the encoded relation declaration.
@@ -901,7 +901,7 @@ def _encode_attribute(self, name, type_):
901901
- Dates (NOT IMPLEMENTED).
902902
- Nominal attributes with format:
903903
904-
{<nominal-name1>, <nominal-name2>, <nominal-name3>, ...}
904+
{<nominal-name1>, <nominal-name2>, <nominal-name3>, ...}
905905
906906
This method must receive a the name of the attribute and its type, if
907907
the attribute type is nominal, ``type`` must be a list of values.
@@ -936,7 +936,7 @@ def encode(self, obj):
936936
def iter_encode(self, obj):
937937
'''The iterative version of `arff.ArffEncoder.encode`.
938938
939-
This encodes iteratively a given object and return, one-by-one, the
939+
This encodes iteratively a given object and return, one-by-one, the
940940
lines of the ARFF file.
941941
942942
:param obj: the object containing the ARFF information.

0 commit comments

Comments
 (0)
0