Skip to content

Add comment with download link to n=32 transitive groups - #7197

Open
havarddj wants to merge 3 commits into
LMFDB:mainfrom
havarddj:trans-32
Open

havarddj wants to merge 3 commits into
LMFDB:mainfrom
havarddj:trans-32

Conversation

@havarddj

@havarddj havarddj commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Gap currently does not have transitive groups of degree 32. Therefore the code snippets on the pages for these groups will give errors unless the user has installed the relevant databases.

This PR adds comments with the relevant links to the transitive groups pages, as well as cleans up newline stripping in utils/place_code.py

@rvisser7

Copy link
Copy Markdown
Member

This looks great, thank you! I've just put some comments below. :)

Comment thread lmfdb/galois_groups/code.yaml Outdated
gap: G := TransitiveGroup({n}, {t});

n32_dbs:
comment: Databases for transitive groups of order 32

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be "degree 32".

Comment thread lmfdb/galois_groups/transitive_group.py Outdated
for lang in self.code[prop]:
self.code[prop][lang] = self.code[prop][lang].format(**{'n':self.n(), 't':self.t()})
self.code['show'] = { lang:'' for lang in self.code['prompt'] }
# For transitive groups of order 32, the user needs to load an extra package

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also should be "degree 32" :)

Comment thread lmfdb/utils/place_code.py Outdated
if isinstance(code[item][L],str):
lines = code[item][L].split('\n')[:-1] if '\n' in code[item][L] else [code[item][L]]
lines = code[item][L].split('\n') if '\n' in code[item][L] else [code[item][L]]
# remove trailing empty line if any

@rvisser7 rvisser7 Sep 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, I think this would remove all blank lines in lines, not necessarily just the trailing one. Though I don't think we have any code snippets with interior blank lines, so I think this is fine :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, I've updated the comment!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can now just be code[item][L].split('\n') since "".split('\n') is [""].

@rvisser7

Copy link
Copy Markdown
Member

Another side-effect I've noticed is that, in the Galois group code download pages, there is no longer a newline between defining the transitive group G, and the code snippet for the abstract group. E.g. compare these pages:

https://beta.lmfdb.org/GaloisGroup/32T14/download/gap
http://localhost:37777/GaloisGroup/32T14/download/gap

I think an easy fix is to replace line 131 (second last line) of lmfdb/utils/place_code.py with:

code += self.code[key][lang].rstrip('\n') + '\n'

@havarddj

Copy link
Copy Markdown
Contributor Author

Thanks, I've addressed your comments now, let me know if you spot anything else!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants