-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Display method for pc groups #3621
Add Display method for pc groups #3621
Conversation
Is there anything to be said for omitting relations of the form |
Codecov Report
@@ Coverage Diff @@
## master #3621 +/- ##
==========================================
+ Coverage 84.58% 84.65% +0.07%
==========================================
Files 698 698
Lines 345626 345685 +59
==========================================
+ Hits 292341 292637 +296
+ Misses 53285 53048 -237
|
@stevelinton Thanks for the reply. I added the message to the output of the Display function. |
The tests need to be updated to account for the new line that you added. Also, I think that the line |
@flyingapfopenguin you added the message, but did not update the tests (which you can do by running |
@wilfwilson @fingolfin Thanks for your constructive response. I applied (most of) your suggestions. |
lib/grppc.gi
Outdated
gens := GeneratorsOfGroup( F ); | ||
pis := RelativeOrders( pcgs ); | ||
|
||
# the power |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you maybe improve this comment so it says more about the following code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to improve it a little. Do you want more?
One general remark: You print the message |
efb6f5a
to
9bc1ba2
Compare
local pcgs, n, F, gens, i, pis, exp, t, h, rel, commPower, j, trivialCommutators; | ||
|
||
pcgs:=Pcgs(G); | ||
n:=Length(pcgs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a request for change, just wanted to point something out: the above two lines clearly come from another source than the following three lines, based on their formatting... Overall, this function mixes several code formatting styles (e.g. Foo( arg )
vs. Foo(arg)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fingolfin What is the GAP coding style? As I didn't knew I copied code without changing its formating and coded the rest like it seems to make sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no official coding style (and trying to set one is one of these things were I expect a lot of pain and blood for little gain). Many people seem to take the formatting which GAP itself uses when printing a function as reference, but usually with some adjustments (e.g. aligning some things across multiple lines, as below).
Anyway, I am not asking for a specific style to be followed -- just that the code within a given function be self-consistent. That's note the case here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to fix this tomorrow by adding a new commit, so that you can do a reintegration merge afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already merged this PR, didn't want to hold it hostage over some whitespace differences :-) I only pointed this formatting bit out again to make you aware of it; as it is, lots of GAP code is less well formatted than what is in this PR...
lib/grppc.gi
Outdated
fi; | ||
n := Size(Pcgs(G)); | ||
if IsOne(n) then | ||
Print("cyclic pc-group with one pc-generator and the relation:\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unimportant nitpick: So you print "one pc-generator" but "2 pc-generators" ? maybe "one" -> "1" for consistency?
I am not sure I see the importance of adding cyclic
. It might even be misleading, because many cyclic pc-groups won't get it (e.g. C_4 or C_6 if the pcgs is refined).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to change "one" to "1" for consistency.
About "cyclic": I don't think this is important in any way but i'm going to leave this.
fi; | ||
trivialCommutators := PrintPcPresentation( G, false ); | ||
if IsAbelian(G) then | ||
Print("all generators commute, the groups is abelian\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again unimportant, but: If you handle the 1 generator case separately above, you might want to consider doing so here as well, as "all generators" then refers to just 1 generator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, but all is one in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall seems fine to me now, though I had some further minor nitpicks. The PR should also be squashed.
Should I simply squash all commits together and do a force push or how is this usually done? |
@flyingapfopenguin yes, please squash, rebase on latest master and then force push. |
00cb8e6
to
5d4c5fc
Compare
done |
One test failed due to a download error, I restarted it. |
Is there a reason why this PR does not close Issue #3538? |
Is |
Description / Text for release notes
Add Display method for pc groups, refering #3538.