-
Notifications
You must be signed in to change notification settings - Fork 162
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
Make further use of Pluralize
in the GAP library
#4343
base: master
Are you sure you want to change the base?
Conversation
83ba777
to
c3c485e
Compare
I do like this, but it would indeed be best if we knew which packages have tests that are affected by this. This in turn means it would be useful to have something like what we did in Hmm, perhaps this rambling should go to its own issue... ;-) |
c3c485e
to
eba0370
Compare
As far as I can tell, the changes in the second category ("method not found ... 1 argument(s)") affects exactly semigroups and digraphs, and no other packages. As to how to deal with this: actually, |
Thanks for the hint. |
eba0370
to
fa63b8c
Compare
I've modified the PackageDistro CI to allow running tests against arbitrary GAP forks (and arbitrary branches therein, but that was already there). The result can be found here. Summary of failures:
|
Thanks for doing that @fingolfin. I was aware that Semigroups and Digraphs would be affected, primarily because of the change from "1 arguments" to "1 argument" in no method found errors (which are often tested in those packages). The smallsemi failure seems to be caused by the lack control characters given by the output of I don't imagine dealing with this will be high on mine or @james-d-mitchell's priority lists, but we might get round to it eventually. (Also, perhaps |
This is a follow-on pull request #4050, although it doesn't require that PR.
I describe the changes below, but as mentioned below, this PR will break the tests of some packages in a way that might be annoying/time consuming/tricky to fix, so it might not be worth ever merging this. However, I've made the commits, and so I may as well at least put them here as a PR (if for no other reason than to save anyone else making an independent PR to do this).
1. Use
Pluralize
in semigroupViewString
s rather than manually constructing the correct pluralisationThis reduces code duplication slightly.
Unfortunately, this will break the tests in (at least) the Semigroups package. The current
ViewString
behaviour adds control characters around the wordgenerator{s}
, i.e.\>generators\<
, butPluralize
does not do this. Perhaps someone more knowledge with control characters than me can tell me which of these behaviours is preferable. The result of this difference can sometimes be seen with the final "n generators" in theViewStrings
here:In
master
:With this PR:
To make this change compatible with the Semigroups package, either a lot of output needs to be suppressed in its tests, or Semigroups needs to test up to whitespace only. There are possibly other, more hacky, solutions.
This may well affect other packages too, so perhaps it is not worth making this change.
2. Use the correct pluralisation of "argument" in the message given for a 'no method found' error
Like the changes #4050, this makes GAP more grammatically correct. Unfortunately, it will break the tests of any package that tests for a 'no method found' error for a function on 1 argument (GAP itself has several such tests, which I update in this PR). In particular, this will break the tests of the Semigroups and Digraphs packages.
It is not see easy to work around this in packages, since 'argument' → 'arguments' is not a whitespace change, and suppressing the output of an error message is neither useful nor possible, as far as I'm aware. You could argue that testing for a 'no method found' error is not a useful test, but I'm not so sure about that.
So again, perhaps it is not worth making this change.