Zulip Chat Archive

Stream: mathlib4

Topic: Fixing docstrings in Mathlib 4


Antoine Chambert-Loir (Jul 31 2023 at 14:16):

I often notice that some docstrings have not been ported correctly, for example, because the comments still mention the old Mathlib3 name. What is the proper way to suggest corrections?
Should I open a PR for each of them, or could there be a larger collaborative PR to that aim?

Anatole Dedecker (Jul 31 2023 at 14:22):

I think the most efficient way is not to organize things too much here, so you can open a PR for each one (or a small batch) and tag the corresponding PR as "easy". At some point we will probably organize some kind of coordinated effort for this, but for now please fix the one you stumble upon!

Riccardo Brasca (Jul 31 2023 at 14:22):

There are several PRs fixing small problems like this. I think you can just open a PR every time you notice a problem (maybe check at least the whole file...). If it is just in the doc you can label it "easy" and it should be reviewed quicky.

Eric Wieser (Jul 31 2023 at 14:25):

Separate PRs are better because if the fixes are in different areas of the library, different people might feel more qualified to know what the comment was supposed to be

Eric Wieser (Jul 31 2023 at 14:26):

If it's all in one PR, everyone is waiting on someone else to review part of it

Matthew Ballard (Jul 31 2023 at 14:26):

I am hopeful this organic piecemeal approach will be all that is necessary

Eric Wieser (Jul 31 2023 at 14:30):

I guess an alternative would be to run fix-comments.py on everything, and then have people carefully review for false-positives

Ruben Van de Velde (Jul 31 2023 at 14:39):

Eric Wieser said:

I guess an alternative would be to run fix-comments.py on everything, and then have people carefully review for false-positives

Note that the script is not idempotent, e.g. ring -> Ring -> RingCat

Jireh Loreaux (Jul 31 2023 at 15:04):

Could fix-comments read an align file where we remove all the category theory stuff? Or all the stuff with upper case Lean 3 decls? That should make it almost idempotent.

Eric Wieser (Jul 31 2023 at 17:03):

What if you ran fix-comments in reverse first, then ran it forwards again?

Jireh Loreaux (Jul 31 2023 at 17:23):

Did anything get aligned to an existing mathlib 3 name (different from the one it's coming from)? If so, then that approach doesn't work either, but it's possible it would be less error prone.

Eric Wieser (Jul 31 2023 at 17:39):

Yes, there are a few lemmas where the prime swapped between 3 and 4

Eric Wieser (Jul 31 2023 at 17:39):

I think they're probably not mentioned in docstrings that often

Mario Carneiro (Aug 01 2023 at 03:41):

why don't you use the actual #aligns in mathlib to do this, instead of just using the mathport heuristic?

Jireh Loreaux (Aug 01 2023 at 04:56):

Isn't that what we do already?

Eric Wieser (Aug 01 2023 at 08:15):

fix-comments does that (via grep), but as pointed out above we now have no automated way to tell which comments have already been fixed


Last updated: Dec 20 2023 at 11:08 UTC