@@ -88,14 +88,14 @@ def __init__(self, factor, type, state, num_columns=None, categories=None):
8888 if self .type == "numerical" :
8989 if not isinstance (num_columns , int ):
9090 raise ValueError (
91- "For numerical factors, num_columns " " must be an integer"
91+ "For numerical factors, num_columns must be an integer"
9292 )
9393 if categories is not None :
94- raise ValueError ("For numerical factors, categories " " must be None" )
94+ raise ValueError ("For numerical factors, categories must be None" )
9595 else :
9696 assert self .type == "categorical"
9797 if num_columns is not None :
98- raise ValueError ("For categorical factors, num_columns " " must be None" )
98+ raise ValueError ("For categorical factors, num_columns must be None" )
9999 categories = tuple (categories )
100100 self .num_columns = num_columns
101101 self .categories = categories
@@ -280,8 +280,7 @@ def __init__(self, column_names, factor_infos=None, term_codings=None):
280280
281281 if (factor_infos is None ) != (term_codings is None ):
282282 raise ValueError (
283- "Must specify either both or neither of "
284- "factor_infos= and term_codings="
283+ "Must specify either both or neither of factor_infos= and term_codings="
285284 )
286285
287286 self .factor_infos = factor_infos
@@ -304,17 +303,15 @@ def __init__(self, column_names, factor_infos=None, term_codings=None):
304303 term_factors = set (term .factors )
305304 for subterm in subterms :
306305 if not isinstance (subterm , SubtermInfo ):
307- raise ValueError ("expected SubtermInfo, " " not %r" % (subterm ,))
306+ raise ValueError ("expected SubtermInfo, not %r" % (subterm ,))
308307 if not term_factors .issuperset (subterm .factors ):
309308 raise ValueError ("unexpected factors in subterm" )
310309
311310 all_factors = set ()
312311 for term in self .term_codings :
313312 all_factors .update (term .factors )
314313 if all_factors != set (self .factor_infos ):
315- raise ValueError (
316- "Provided Term objects and factor_infos " "do not match"
317- )
314+ raise ValueError ("Provided Term objects and factor_infos do not match" )
318315 for factor , factor_info in self .factor_infos .items ():
319316 if not isinstance (factor_info , FactorInfo ):
320317 raise ValueError (
@@ -343,8 +340,7 @@ def __init__(self, column_names, factor_infos=None, term_codings=None):
343340 exp_cols *= cm .shape [1 ]
344341 if cat_factors != set (subterm .contrast_matrices ):
345342 raise ValueError (
346- "Mismatch between contrast_matrices "
347- "and categorical factors"
343+ "Mismatch between contrast_matrices and categorical factors"
348344 )
349345 if exp_cols != subterm .num_columns :
350346 raise ValueError ("Unexpected num_columns" )
@@ -368,7 +364,7 @@ def __init__(self, column_names, factor_infos=None, term_codings=None):
368364 idx += term_columns
369365 if idx != len (self .column_names ):
370366 raise ValueError (
371- "mismatch between column_names and columns " " coded by given terms"
367+ "mismatch between column_names and columns coded by given terms"
372368 )
373369 self .term_name_slices = OrderedDict (
374370 [(term .name (), slice_ ) for (term , slice_ ) in self .term_slices .items ()]
0 commit comments