M2 icon indicating copy to clipboard operation
M2 copied to clipboard

Format better "about" output

Open pzinn opened this issue 1 year ago • 3 comments

This is an attempt to improve the output of about. before:

i1 : about resolution

o1 = {0 => ChainComplexExtras::resolution(ChainComplex)             }
     {1 => Complexes::resolution(Complex)                           }
     {2 => EagonResolution::resolution(EagonData)                   }
     {3 => Macaulay2Doc::resolution                                 }
     {4 => Macaulay2Doc::resolution(...,DegreeLimit=>...)           }
     {5 => Macaulay2Doc::resolution(...,FastNonminimal=>...)        }
     {6 => Macaulay2Doc::resolution(...,HardDegreeLimit=>...)       }
     {7 => Macaulay2Doc::resolution(...,LengthLimit=>...)           }
     {8 => Macaulay2Doc::resolution(...,PairLimit=>...)             }
     {9 => Macaulay2Doc::resolution(...,SortStrategy=>...)          }
     {10 => Macaulay2Doc::resolution(...,StopBeforeComputation=>...)}
     {11 => Macaulay2Doc::resolution(...,Strategy=>...)             }
     {12 => Macaulay2Doc::resolution(...,SyzygyLimit=>...)          }
     {13 => Macaulay2Doc::resolution(Ideal)                         }
     {14 => Macaulay2Doc::resolution(Matrix)                        }
     {15 => Macaulay2Doc::resolution(Module)                        }
     {16 => NCAlgebra::resolution(NCMatrix)                         }

o1 : NumberedVerticalList

after:

i1 : about resolution
 -- warning: symbol "minimize" in Core.Dictionary is shadowed by a symbol in ChainComplexExtras.Dictionary
 --   use the synonym Core$minimize

o1 = {0 => "resolution" -- projective resolution                                                                                                     }
     {1 => "resolution(...,DegreeLimit=>...)" -- compute only up to this degree                                                                      }
     {2 => "resolution(...,FastNonminimal=>...)" -- compute a non-minimal graded free resolution                                                     }
     {3 => "resolution(...,HardDegreeLimit=>...)"                                                                                                    }
     {4 => "resolution(...,LengthLimit=>...)" -- stop when the resolution reaches this length                                                        }
     {5 => "resolution(...,PairLimit=>...)" -- stop when this number of pairs has been handled                                                       }
     {6 => "resolution(...,SortStrategy=>...)"                                                                                                       }
     {7 => "resolution(...,StopBeforeComputation=>...)" -- whether to stop the computation immediately                                               }
     {8 => "resolution(...,Strategy=>...)"                                                                                                           }
     {9 => "resolution(...,SyzygyLimit=>...)" -- stop when this number of syzygies is reached                                                        }
     {10 => "resolution(ChainComplex)" -- Resolves a ChainComplex.                                                                                   }
     {11 => "resolution(Complex)" -- minimal free resolution of a complex                                                                            }
     {12 => "resolution(EagonData)" -- outputs the resolution that is the 0th row of the Eagon double complex                                        }
     {13 => "resolution(Ideal)" -- compute a projective resolution of (the quotient ring corresponding to) an ideal                                  }
     {14 => "resolution(Matrix)" -- given a module map represented by a matrix, produce a comparison map between resolutions of its source and target}
     {15 => "resolution(Module)" -- compute a free resolution of a module                                                                            }
     {16 => "resolution(NCMatrix)" -- Compute the resolution of coker M as a map of free right modules                                               }

o1 : NumberedVerticalList

looks good, except we're getting this extra warning now. of course we would've gotten it anyway by invoking help so I think it's not a big deal?

pzinn avatar Jun 30 '24 10:06 pzinn

It would be great if repeated entries (i.e. doc tags pointing to the same doc node) were grouped together. For instance, (ideal, List) and (ideal, Sequence) are documented together, but currently:

     {10 => Macaulay2Doc::ideal(List)                                                                                       }
     {11 => Macaulay2Doc::ideal(Matrix)                                                                                     }
...
     {17 => Macaulay2Doc::ideal(RingElement)                                                                                }
     {18 => Macaulay2Doc::ideal(Sequence)                                                                                   }

The html documentation takes care of this correctly, since it's fresh in your mind, is there an easy way to fix this? Another similar request would be grouping the entries first by package, then ordered for instance as function > method > options > etc, so for instance (gb, Ideal) shows up before all the options here:

o7 = {0 => Macaulay2Doc::gb                                     }
     {1 => Macaulay2Doc::gb(...,Algorithm=>...)                 }
...
     {17 => Macaulay2Doc::gb(...,SyzygyRows=>...)               }
     {18 => Macaulay2Doc::gb(Ideal)                             }

Also, not a point against your PR, but it really showcases how people treat the headline however they want:

     {10 => "resolution(ChainComplex)" -- Resolves a ChainComplex.                                                                                   }
     {11 => "resolution(Complex)" -- minimal free resolution of a complex                                                                            }
     {12 => "resolution(EagonData)" -- outputs the resolution that is the 0th row of the Eagon double complex                                        }
     {13 => "resolution(Ideal)" -- compute a projective resolution of (the quotient ring corresponding to) an ideal                                  }
     {14 => "resolution(Matrix)" -- given a module map represented by a matrix, produce a comparison map between resolutions of its source and target}
     {15 => "resolution(Module)" -- compute a free resolution of a module                                                                            }
     {16 => "resolution(NCMatrix)" -- Compute the resolution of coker M as a map of free right modules                                               }

Literally no two are comparable!

mahrud avatar Jun 30 '24 18:06 mahrud

not related to your request for grouping, but about ideal looks like this now:

o1 = {0 => "Alternative algorithm to compute the symbolic powers of a prime ideal in positive characteristic"    }
     {1 => "Computing symbolic powers of an ideal"                                                               }
     {2 => "creating an ideal"                                                                                   }
     {3 => "extracting generators of an ideal"                                                                   }
     {4 => "ideal" -- make an ideal                                                                              }
     {5 => "ideal quotients and saturation"                                                                      }
     {6 => "ideal(CoincidentRootLocus)" -- the defining ideal of a coincident root locus                         }
     {7 => "ideal(CubicSurface)" -- extracts the ideal of a surface                                              }
     {8 => "ideal(Curve)" -- extracts the ideal of a Curve                                                       }
     {9 => "ideal(LieAlgebra)" -- get the relations in a Lie algebra                                             }
     {10 => "ideal(List)" -- make an ideal                                                                       }
     {11 => "ideal(Matrix)" -- make an ideal                                                                     }
     {12 => "ideal(Matroid)" -- Stanley-Reisner (circuit) ideal of matroid                                       }
     {13 => "ideal(Module)" -- converts a module to an ideal                                                     }
     {14 => "ideal(MonomialIdeal)" -- converts a monomial ideal to an ideal                                      }
     {15 => "ideal(MultiprojectiveVariety)" -- the defining ideal of the variety                                 }
     {16 => "ideal(NCPolynomialRing)" -- The defining ideal of an NCPolynomialRing                               }
     {17 => "ideal(NCQuotientRing)" -- Defining ideal of an NCQuotientRing in its ambient ring                   }
     {18 => "ideal(NormalToricVariety)" -- make the irrelevant ideal                                             }
     {19 => "ideal(Number)" -- make an ideal                                                                     }
     {20 => "ideal(PolySystem)" -- a polynomial system                                                           }
     {21 => "ideal(QuadricSurface)" -- extracts the ideal of a surface                                           }
     {22 => "ideal(QuarticSurfaceRational)" -- extracts the ideal of a surface                                   }
     {23 => "ideal(QuotientRing)" -- returns the defining ideal                                                  }
     {24 => "ideal(QWeilDivisor)" -- calculate the corresponding module of a divisor and represent it as an ideal}
     {25 => "ideal(RationalMap)" -- base locus of a rational map                                                 }
     {26 => "ideal(Ring)" -- returns the defining ideal                                                          }
     {27 => "ideal(RingElement)" -- make an ideal                                                                }
     {28 => "ideal(RWeilDivisor)" -- calculate the corresponding module of a divisor and represent it as an ideal}
     {29 => "ideal(Sequence)" -- make an ideal                                                                   }
     {30 => "ideal(SimplicialComplex)" -- get the Stanley–Reisner ideal                                          }
     {31 => "ideal(String)" -- make an ideal using classic Macaulay syntax                                       }
     {32 => "ideal(ToricMap)" -- make the ideal defining the closure of the image                                }
     {33 => "ideal(Variety)" -- returns the defining ideal                                                       }
     {34 => "ideal(WeilDivisor)" -- calculate the corresponding module of a divisor and represent it as an ideal }
     {35 => "ideal(WitnessSet)" -- a witness set                                                                 }
     {36 => "minimal primes of an ideal"                                                                         }
     {37 => "radical of an ideal"                                                                                }
     {38 => "Stanley–Reisner ideal" -- get the Stanley–Reisner monomial ideal                                    }
     {39 => "The generators of the integral closure of the Rees algebra of a monomial ideal."                    }

the ordering is different. would you prefer the original ordering? that can be easily done.

pzinn avatar Jul 01 '24 02:07 pzinn

Oh, I do not like that methods from different packages are mixed now.

Edit: also, it would be good to keep the PackageName:: prefix, which I believe also fixes part of the ordering issue.

mahrud avatar Jul 01 '24 04:07 mahrud

now:

i1 : about resolution
 -- warning: symbol "minimize" in Core.Dictionary is shadowed by a symbol in ChainComplexExtras.Dictionary
 --   use the synonym Core$minimize

o1 = {0 => ChainComplexExtras "resolution(ChainComplex)" -- Resolves a ChainComplex.                                                                              }
     {1 => Complexes "resolution(Complex)" -- minimal free resolution of a complex                                                                                }
     {2 => EagonResolution "resolution(EagonData)" -- outputs the resolution that is the 0th row of the Eagon double complex                                      }
     {3 => Macaulay2Doc "resolution" -- projective resolution                                                                                                     }
     {4 => Macaulay2Doc "resolution(...,DegreeLimit=>...)" -- compute only up to this degree                                                                      }
     {5 => Macaulay2Doc "resolution(...,FastNonminimal=>...)" -- compute a non-minimal graded free resolution                                                     }
     {6 => Macaulay2Doc "resolution(...,HardDegreeLimit=>...)"                                                                                                    }
     {7 => Macaulay2Doc "resolution(...,LengthLimit=>...)" -- stop when the resolution reaches this length                                                        }
     {8 => Macaulay2Doc "resolution(...,PairLimit=>...)" -- stop when this number of pairs has been handled                                                       }
     {9 => Macaulay2Doc "resolution(...,SortStrategy=>...)"                                                                                                       }
     {10 => Macaulay2Doc "resolution(...,StopBeforeComputation=>...)" -- whether to stop the computation immediately                                              }
     {11 => Macaulay2Doc "resolution(...,Strategy=>...)"                                                                                                          }
     {12 => Macaulay2Doc "resolution(...,SyzygyLimit=>...)" -- stop when this number of syzygies is reached                                                       }
     {13 => Macaulay2Doc "resolution(Ideal)" -- compute a projective resolution of (the quotient ring corresponding to) an ideal                                  }
     {14 => Macaulay2Doc "resolution(Matrix)" -- given a module map represented by a matrix, produce a comparison map between resolutions of its source and target}
     {15 => Macaulay2Doc "resolution(Module)" -- compute a free resolution of a module                                                                            }
     {16 => NCAlgebra "resolution(NCMatrix)" -- Compute the resolution of coker M as a map of free right modules                                                  }

o1 : NumberedVerticalList

pzinn avatar Jul 03 '24 08:07 pzinn

another option would've been to include the name of the package in the output of the TOH itself?

pzinn avatar Jul 03 '24 08:07 pzinn

I think my eyes have a much harder time reading the new output. Ideally this output should be tabulated, maybe using something like netList, but short of that I definitely prefer to go back to the previous output.

mahrud avatar Jul 04 '24 03:07 mahrud