@@ -2999,7 +2999,7 @@ def code_snippets(self):
29992999 if lang not in code ['code_description' ]:
30003000 code ['code_description' ][lang ] = 'G := SmallGroup(' + gap_id [0 ]+ ', ' + gap_id [1 ]+ ');'
30013001 if 'sage_gap' not in code ['code_description' ]:
3002- code ['code_description' ]['sage_gap' ] = 'G = gap .SmallGroup(' + gap_id [0 ]+ ', ' + gap_id [1 ]+ ')'
3002+ code ['code_description' ]['sage_gap' ] = 'G = libgap .SmallGroup(' + gap_id [0 ]+ ', ' + gap_id [1 ]+ ')'
30033003 # Otherwise, check if group is abelian (then can define as product of cyclic groups from its primary decomposition)
30043004 if self .abelian :
30053005 for lang in ['magma' , 'gap' ]:
@@ -3033,30 +3033,35 @@ def code_snippets(self):
30333033 # then unfortunately not all the default code snippets in Sage and Magma will work correctly!
30343034 # As a (hopefully temporary) solution, we hide the code snippets which will not work with our implemention of G in the top code snippet
30353035 # TODO: Find a better solution for this (would it be worth converting G to a permutation group within the top code snippet?)
3036- if ( "MatrixGroup" in code ['code_description' ]['sage' ]) and ( "permutation" not in code ['code_description' ]['sage' ]) :
3036+ if 'sage' in code [ 'code_description' ] and "MatrixGroup" in code ['code_description' ]['sage' ] and "permutation" not in code ['code_description' ]['sage' ]:
30373037 # Must disable all code snippets which do not work with MatrixGroup in Sage
30383038 for c in ['composition_factors' , 'is_cyclic' , 'is_elementary_abelian' , 'is_pgroup' , 'abelianization' , 'schur_multiplier' ,
30393039 'commutator' , 'frattini_subgroup' , 'fitting_subgroup' , 'socle' , 'derived_series' , 'lower_central_series' , 'upper_central_series' ]:
30403040 if c in code :
30413041 code [c ].pop ('sage' , None )
3042- if ( "AbelianGroup" in code ['code_description' ]['sage' ]) and ( "permutation" not in code ['code_description' ]['sage' ]) :
3042+ if 'sage' in code [ 'code_description' ] and "AbelianGroup" in code ['code_description' ]['sage' ] and "permutation" not in code ['code_description' ]['sage' ]:
30433043 # Must disable all code snippets which do not work with AbelianGroup in Sage
30443044 for c in ['composition_factors' , 'is_elementary_abelian' , 'is_nilpotent' , 'is_perfect' , 'is_pgroup' , 'is_polycyclic' , 'is_solvable' , 'is_supersolvable' ,
30453045 'abelianization' , 'schur_multiplier' , 'center' , 'commutator' , 'frattini_subgroup' , 'fitting_subgroup' , 'socle' ,
30463046 'derived_series' , 'lower_central_series' , 'upper_central_series' ]:
30473047 if c in code :
30483048 code [c ].pop ('sage' , None )
3049- if ( "MatrixGroup" in code ['code_description' ]['magma' ]) and ( "permutation" not in code ['code_description' ]['magma' ]) :
3049+ if 'magma' in code [ 'code_description' ] and "MatrixGroup" in code ['code_description' ]['magma' ] and "permutation" not in code ['code_description' ]['magma' ]:
30503050 # Must disable all code snippets which do not work with MatrixGroup in Magma
30513051 for c in ['socle' ]:
30523052 if c in code :
30533053 code [c ].pop ('magma' , None )
3054- if ( "AbelianGroup" in code ['code_description' ]['magma' ]) and ( "permutation" not in code ['code_description' ]['magma' ]) :
3054+ if 'magma' in code [ 'code_description' ] and "AbelianGroup" in code ['code_description' ]['magma' ] and "permutation" not in code ['code_description' ]['magma' ]:
30553055 # Must disable all code snippets which do not work with AbelianGroup in Magma
30563056 for c in ['radical' , 'socle' ]:
30573057 if c in code :
30583058 code [c ].pop ('magma' , None )
30593059
3060+ # Hides code snippets for language lang if no top code snippet has been defined for lang
3061+ for lang in list (code ['prompt' ]):
3062+ if lang not in code ['code_description' ]:
3063+ code ['prompt' ].pop (lang , None )
3064+
30603065 for prop in code :
30613066 for lang in code [prop ]:
30623067 code [prop ][lang ] = code [prop ][lang ].format (** data )
0 commit comments