@@ -88,14 +88,14 @@ def __init__(self, factor, type, state, num_columns=None, categories=None):
88
88
if self .type == "numerical" :
89
89
if not isinstance (num_columns , int ):
90
90
raise ValueError (
91
- "For numerical factors, num_columns " " must be an integer"
91
+ "For numerical factors, num_columns must be an integer"
92
92
)
93
93
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" )
95
95
else :
96
96
assert self .type == "categorical"
97
97
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" )
99
99
categories = tuple (categories )
100
100
self .num_columns = num_columns
101
101
self .categories = categories
@@ -280,8 +280,7 @@ def __init__(self, column_names, factor_infos=None, term_codings=None):
280
280
281
281
if (factor_infos is None ) != (term_codings is None ):
282
282
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="
285
284
)
286
285
287
286
self .factor_infos = factor_infos
@@ -304,17 +303,15 @@ def __init__(self, column_names, factor_infos=None, term_codings=None):
304
303
term_factors = set (term .factors )
305
304
for subterm in subterms :
306
305
if not isinstance (subterm , SubtermInfo ):
307
- raise ValueError ("expected SubtermInfo, " " not %r" % (subterm ,))
306
+ raise ValueError ("expected SubtermInfo, not %r" % (subterm ,))
308
307
if not term_factors .issuperset (subterm .factors ):
309
308
raise ValueError ("unexpected factors in subterm" )
310
309
311
310
all_factors = set ()
312
311
for term in self .term_codings :
313
312
all_factors .update (term .factors )
314
313
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" )
318
315
for factor , factor_info in self .factor_infos .items ():
319
316
if not isinstance (factor_info , FactorInfo ):
320
317
raise ValueError (
@@ -343,8 +340,7 @@ def __init__(self, column_names, factor_infos=None, term_codings=None):
343
340
exp_cols *= cm .shape [1 ]
344
341
if cat_factors != set (subterm .contrast_matrices ):
345
342
raise ValueError (
346
- "Mismatch between contrast_matrices "
347
- "and categorical factors"
343
+ "Mismatch between contrast_matrices and categorical factors"
348
344
)
349
345
if exp_cols != subterm .num_columns :
350
346
raise ValueError ("Unexpected num_columns" )
@@ -368,7 +364,7 @@ def __init__(self, column_names, factor_infos=None, term_codings=None):
368
364
idx += term_columns
369
365
if idx != len (self .column_names ):
370
366
raise ValueError (
371
- "mismatch between column_names and columns " " coded by given terms"
367
+ "mismatch between column_names and columns coded by given terms"
372
368
)
373
369
self .term_name_slices = OrderedDict (
374
370
[(term .name (), slice_ ) for (term , slice_ ) in self .term_slices .items ()]
0 commit comments