20
20
RightAction ,
21
21
LeftAction ,
22
22
Action ,
23
- ImageRightAction ,
24
23
PPerm ,
25
24
BMat8 ,
26
25
side ,
@@ -228,14 +227,26 @@ def test_action_001(right_actions, left_actions):
228
227
rows .init ()
229
228
230
229
rows .add_seed (
231
- row_space_basis (BMat8 ([[1 , 1 , 1 , 0 ], [1 , 1 , 0 , 0 ], [0 , 1 , 0 , 1 ], [0 , 1 , 0 , 0 ]]))
230
+ row_space_basis (
231
+ BMat8 ([[1 , 1 , 1 , 0 ], [1 , 1 , 0 , 0 ], [0 , 1 , 0 , 1 ], [0 , 1 , 0 , 0 ]])
232
+ )
232
233
)
233
234
234
- rows .add_generator (BMat8 ([[1 , 0 , 0 , 0 ], [0 , 1 , 0 , 0 ], [0 , 0 , 1 , 0 ], [0 , 0 , 0 , 1 ]]))
235
- rows .add_generator (BMat8 ([[0 , 1 , 0 , 0 ], [1 , 0 , 0 , 0 ], [0 , 0 , 1 , 0 ], [0 , 0 , 0 , 1 ]]))
236
- rows .add_generator (BMat8 ([[0 , 1 , 0 , 0 ], [0 , 0 , 1 , 0 ], [0 , 0 , 0 , 1 ], [1 , 0 , 0 , 0 ]]))
237
- rows .add_generator (BMat8 ([[1 , 0 , 0 , 0 ], [0 , 1 , 0 , 0 ], [0 , 0 , 1 , 0 ], [1 , 0 , 0 , 1 ]]))
238
- rows .add_generator (BMat8 ([[1 , 0 , 0 , 0 ], [0 , 1 , 0 , 0 ], [0 , 0 , 1 , 0 ], [0 , 0 , 0 , 0 ]]))
235
+ rows .add_generator (
236
+ BMat8 ([[1 , 0 , 0 , 0 ], [0 , 1 , 0 , 0 ], [0 , 0 , 1 , 0 ], [0 , 0 , 0 , 1 ]])
237
+ )
238
+ rows .add_generator (
239
+ BMat8 ([[0 , 1 , 0 , 0 ], [1 , 0 , 0 , 0 ], [0 , 0 , 1 , 0 ], [0 , 0 , 0 , 1 ]])
240
+ )
241
+ rows .add_generator (
242
+ BMat8 ([[0 , 1 , 0 , 0 ], [0 , 0 , 1 , 0 ], [0 , 0 , 0 , 1 ], [1 , 0 , 0 , 0 ]])
243
+ )
244
+ rows .add_generator (
245
+ BMat8 ([[1 , 0 , 0 , 0 ], [0 , 1 , 0 , 0 ], [0 , 0 , 1 , 0 ], [1 , 0 , 0 , 1 ]])
246
+ )
247
+ rows .add_generator (
248
+ BMat8 ([[1 , 0 , 0 , 0 ], [0 , 1 , 0 , 0 ], [0 , 0 , 1 , 0 ], [0 , 0 , 0 , 0 ]])
249
+ )
239
250
240
251
assert len (rows ) == 553
241
252
@@ -249,7 +260,9 @@ def test_action_pperm(right_actions):
249
260
right = right_actions [1 ]
250
261
right .reserve (70000 )
251
262
assert len (right ) == 65536
252
- assert repr (right ) == "<complete right action with 4 generators, 65536 points>"
263
+ assert (
264
+ repr (right ) == "<complete right action with 4 generators, 65536 points>"
265
+ )
253
266
assert right [666 ] == PPerm (
254
267
[0 , 2 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 ],
255
268
[0 , 2 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 ],
@@ -311,13 +324,15 @@ def test_action_transf(right_actions, extreme_left_actions):
311
324
312
325
def test_action_coverage ():
313
326
with pytest .raises (TypeError ):
314
- Action (element = PPerm )
327
+ Action (generators = PPerm )
315
328
316
329
with pytest .raises (TypeError ):
317
- Action (BadKeywordArg = PPerm , generators = None , seeds = None , help = None )
330
+ Action (generators = None , seeds = None )
318
331
319
332
with pytest .raises (KeyError ):
320
- Action (generators = [PPerm ], seeds = [BMat8 ], func = RightAction , side = side .left )
333
+ Action (
334
+ generators = [PPerm ], seeds = [BMat8 ], func = RightAction , side = side .left
335
+ )
321
336
322
337
right = RightAction (
323
338
generators = [
@@ -352,7 +367,9 @@ def test_action_coverage():
352
367
seeds = [PPerm .one (17 )],
353
368
)
354
369
355
- assert repr (right ) == "<incomplete right action with 1 generators, 1 points>"
370
+ assert (
371
+ repr (right ) == "<incomplete right action with 1 generators, 1 points>"
372
+ )
356
373
with pytest .raises (TypeError ):
357
374
right .add_generator (BMat8 (0 ))
358
375
@@ -444,7 +461,9 @@ def test_action_reserve(right_actions, left_actions):
444
461
445
462
def test_action_root_of_scc (right_actions , left_actions ):
446
463
for action in right_actions + left_actions :
447
- expected = BMat8 ([[1 , 1 , 1 , 0 ], [1 , 1 , 0 , 0 ], [0 , 1 , 0 , 1 ], [0 , 1 , 0 , 0 ]])
464
+ expected = BMat8 (
465
+ [[1 , 1 , 1 , 0 ], [1 , 1 , 0 , 0 ], [0 , 1 , 0 , 1 ], [0 , 1 , 0 , 0 ]]
466
+ )
448
467
assert action .root_of_scc (0 ) == expected
449
468
assert action .root_of_scc (expected ) == expected
450
469
with pytest .raises (TypeError ):
@@ -456,4 +475,6 @@ def test_action_word_graph(right_actions, left_actions):
456
475
for action in right_actions + left_actions :
457
476
wg = action .word_graph ()
458
477
assert wg .number_of_nodes () == len (action )
459
- assert wg .number_of_edges () == len (action ) * action .number_of_generators ()
478
+ assert (
479
+ wg .number_of_edges () == len (action ) * action .number_of_generators ()
480
+ )
0 commit comments