Skip to content

[Merged by Bors] - feat: improve ToAdditive.guessName to work with capitalisation#579

Closed
joneugster wants to merge 21 commits intomasterfrom
eugster-to_additive
Closed

[Merged by Bors] - feat: improve ToAdditive.guessName to work with capitalisation#579
joneugster wants to merge 21 commits intomasterfrom
eugster-to_additive

Conversation

@joneugster
Copy link
Copy Markdown
Contributor

@joneugster joneugster commented Nov 12, 2022

This is a suggestion for to_additive to parse names in the new naming conventions.

It does keep capitalised abbreviations like "LE" together but it would not split a single capitalised char off.
E.g. "OneCommMonoidLEHMul_one_lt_Conj₂Pow" becomes "ZeroAddCommMonoidLEHAdd_pos_Conj₂Nsmul"

@joneugster joneugster changed the title feat(Tactic/ToAdditive): rewrite to_additive to new naming convention. feat(Tactic/ToAdditive): improve ToAdditive.guessName to guess capitalisation Nov 12, 2022
@joneugster joneugster changed the title feat(Tactic/ToAdditive): improve ToAdditive.guessName to guess capitalisation feat(Tactic/ToAdditive): improve ToAdditive.guessName to work with capitalisation Nov 12, 2022
@digama0 digama0 changed the title feat(Tactic/ToAdditive): improve ToAdditive.guessName to work with capitalisation feat: improve ToAdditive.guessName to work with capitalisation Nov 12, 2022
@digama0
Copy link
Copy Markdown
Member

digama0 commented Nov 12, 2022

Can you add test cases to the test file?

Regarding performance, I can't imagine there is anything you can do here which would have unacceptable performance. It is only run once per declaration and it's a tiny input so it shouldn't be a problem.

@kim-em kim-em added awaiting-author A reviewer has asked the author a question or requested changes. and removed awaiting-review labels Nov 14, 2022
@joneugster joneugster added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Nov 14, 2022
@joneugster
Copy link
Copy Markdown
Contributor Author

Done that :)

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Nov 17, 2022

I made a few further changes. If you happy, please go ahead and merge.

bors d+

@bors
Copy link
Copy Markdown

bors bot commented Nov 17, 2022

✌️ joneugster can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@kim-em kim-em added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Nov 17, 2022
Co-authored-by: Scott Morrison <scott@tqft.net>
@joneugster
Copy link
Copy Markdown
Contributor Author

joneugster commented Nov 17, 2022

Thanks @semorrison ! I made a few more minor changes, all fixes to the test cases.
(edit: not sure if that means I can't bors r+ anymore or if it normal for bors to take 10min+ to respond...)

@joneugster
Copy link
Copy Markdown
Contributor Author

bors r+

@joneugster
Copy link
Copy Markdown
Contributor Author

bors ping

@bors
Copy link
Copy Markdown

bors bot commented Nov 17, 2022

pong

@joneugster
Copy link
Copy Markdown
Contributor Author

bors r+

bors bot pushed a commit that referenced this pull request Nov 17, 2022
This is a suggestion for `to_additive` to parse names in the new naming conventions.

It does keep capitalised abbreviations like "LE" together but it would not split a single capitalised char off.
E.g. "OneCommMonoidLEHMul_one_lt_Conj₂Pow" becomes "ZeroAddCommMonoidLEHAdd_pos_Conj₂Nsmul"

Co-authored-by: Jon Eugster <Jon.Eugster@hhu.de>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@bors
Copy link
Copy Markdown

bors bot commented Nov 17, 2022

Canceled.

@joneugster
Copy link
Copy Markdown
Contributor Author

joneugster commented Nov 17, 2022

I hope it's okay if I merge now with your comments integrated @digama0 . Please cancel if not!

bors r+

bors bot pushed a commit that referenced this pull request Nov 17, 2022
This is a suggestion for `to_additive` to parse names in the new naming conventions.

It does keep capitalised abbreviations like "LE" together but it would not split a single capitalised char off.
E.g. "OneCommMonoidLEHMul_one_lt_Conj₂Pow" becomes "ZeroAddCommMonoidLEHAdd_pos_Conj₂Nsmul"

Co-authored-by: Jon Eugster <Jon.Eugster@hhu.de>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
@bors
Copy link
Copy Markdown

bors bot commented Nov 17, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: improve ToAdditive.guessName to work with capitalisation [Merged by Bors] - feat: improve ToAdditive.guessName to work with capitalisation Nov 17, 2022
@bors bors bot closed this Nov 17, 2022
@bors bors bot deleted the eugster-to_additive branch November 17, 2022 14:54
bors bot pushed a commit that referenced this pull request Nov 28, 2022
- [x] depends on: #579 

Mathlib SHA: 17a9f8f7a4ef32ee65d418103367cf30e84e631d

Done with the reviews. This should hopefully now be ready to merge.

Co-authored-by: Jon <jon.eugster@gmx.ch>
Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Scott Morrison <scott@tqft.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants