-
Notifications
You must be signed in to change notification settings - Fork 251
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
[Merged by Bors] - chore: rename op_norm to opNorm #10185
Conversation
sgouezel
commented
Feb 2, 2024
•
edited
Loading
edited
Picking up on this conversation, what would you think of adding after each modified
Catching changed aligns is relatively easy and then it is simply a matter of reading the git diff. |
It would definitely be an improvement, but still not perfect because some lemmas are not backported from Lean 3 and therefore have no #align. If you know how to write a script reading git diff, it shouldn't be much more complicated to check for lines starting with |
Ok, I'm busy for about an hour, but will play with it a little afterwards! |
Btw, the main issue is not finding the start of the theorem, but the end. |
Evyerthing between |
Yes, after |
Ok, my previous comment was a little misguided: the deprecation statement does not need to be right after the statement to deprecate, although it is probably desirable that it is. Anyway, I have a rough script for adding deprecations and the latest commit only adds the deprecations. Let's see if CI is happy and then what actual issues there are with the deprecations! |
This is awesome, thanks a lot! |
The script is easy to use, but it assumes that every line that has a theorem/lemma in the diff corresponds to a name change to be deprecated. This applies if you change anything on that line, not necessarily the name! Also, it assumes that the new declarations appear in the same order as the old ones and in the same files. I'll polish it up and make it available, though maybe tonight and after a little more testing. |
The script that I used is here. To use it, copy it to your computer, make it executable and run it. You have the option of passing a commit hash that the script will use to figure out what has been deprecated. If you do not provide one, then the script will try to find the master commit from which you branched and use that. If you use a Unix-based system, the commands below should work (assuming that you saved the file in the root directory and called it chmod u+x add_deprecation.sh
./add_deprecation.sh
## you will be prompted to provide a commit hash, but the script suggests a guess
## you can also pass the hash explicitly when you run the command The heuristic that the script uses for finding which declarations to deprecate is very crude. This means that in order for the script to have a chance of producing a useful output, the PR should be carefully prepared to assist the script. Basically, your PR was perfect: just lemma renames and fixing up proofs. As soon as there are more changes happening on lines containing |
Thanks! 🎉 |
Co-authored-by: adomani <adomani@gmail.com>
Build failed: |
bors r+ |
Co-authored-by: adomani <adomani@gmail.com>
Pull request successfully merged into master. Build succeeded: |
Co-authored-by: adomani <adomani@gmail.com>
Following [these](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Thank.20you.20for.20the.20deprecation.20warnings!/near/420078161) [Zulip](https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/machineApplicableDeprecated.20tag.20attribute/near/397630551) discussions, I realised that my deprecation script produced a deprecation syntax that did not allow for auto-replacement in Sébastien's #10185. This PR fixes the deprecation statements, allowing self-correction: 119 times I replaced `@[deprecated xxx] --> @[deprecated]`.
Co-authored-by: adomani <adomani@gmail.com>
Following [these](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Thank.20you.20for.20the.20deprecation.20warnings!/near/420078161) [Zulip](https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/machineApplicableDeprecated.20tag.20attribute/near/397630551) discussions, I realised that my deprecation script produced a deprecation syntax that did not allow for auto-replacement in Sébastien's #10185. This PR fixes the deprecation statements, allowing self-correction: 119 times I replaced `@[deprecated xxx] --> @[deprecated]`.
Following [these](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Thank.20you.20for.20the.20deprecation.20warnings!/near/420078161) [Zulip](https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/machineApplicableDeprecated.20tag.20attribute/near/397630551) discussions, I realised that my deprecation script produced a deprecation syntax that did not allow for auto-replacement in Sébastien's #10185. This PR fixes the deprecation statements, allowing self-correction: 119 times I replaced `@[deprecated xxx] --> @[deprecated]`.
…3368) Deprecations have been forgotten in #11486. We add them in this PR. Methodology: start from the last commit of #11486, use the script by @adomani in #10185 (comment) to generate deprecation aliases (I am also adding an updated version of the script in a comment below) and commit. Then cherry pick this last commit on master and fix whatever has changed in between. This is not perfect as declarations which have been moved since #11486 won't get their deprecated alias, but this should be good enough.
…3368) Deprecations have been forgotten in #11486. We add them in this PR. Methodology: start from the last commit of #11486, use the script by @adomani in #10185 (comment) to generate deprecation aliases (I am also adding an updated version of the script in a comment below) and commit. Then cherry pick this last commit on master and fix whatever has changed in between. This is not perfect as declarations which have been moved since #11486 won't get their deprecated alias, but this should be good enough.