-
Notifications
You must be signed in to change notification settings - Fork 231
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
fix documentation of shared symbols #2263
Conversation
I'm not sure this pull request addresses the real issue, which seems to be that this documentation node refers requests for documentation of document {
Key => { intersect, (intersect, List), (intersect, Sequence), intersection },
Headline => "compute an intersection",
PARA {
"This function calculates the intersection of a list or sequence of compatible objects."
},
SeeAlso => {
-- add references to intersect methods installed in packages _other than Core_ here
"M0nbar::M0nbar",
"NAGtypes::NAGtypes",
"Polyhedra::Polyhedra"
}
} |
No, I'm pretty sure it's addressing the problem. In particular, this isn't a problem only with intersection. You can try separating intersection into it's own node in Macaulay2Doc and you'll get the same problem. |
Try links to <li><span><a href="../../Macaulay2Doc/html/_is__Empty.html">isEmpty</a> -- checks if a Polyhedron is empty</span> </li>
<li><span><a title="checks if a Polyhedron is empty" href="_is__Empty.html">isEmpty(Polyhedron)</a> -- checks if a Polyhedron is empty</span> </li> The real issue, which this PR fixes, is that for instance this html file in the Polyhedra package is created incorrectly: https://faculty.math.illinois.edu/Macaulay2/doc/Macaulay2/share/doc/Macaulay2/Polyhedra/html/_is__Empty.html In this case, the node in document { Key => isEmpty, methodstr, SeeAlso => { "Polyhedra::Polyhedra",(isEmpty, RRi)} } which isn't making any misdirections, as you suggest. |
There should be no documentation node for "isEmpty" in the Polyhedra package, because "isEmpty" is in the core, and an error should be signaled when it tries to make one here: document {
Key => {isEmpty, (isEmpty,Polyhedron)},
Headline => "checks if a Polyhedron is empty",
Usage => " b = isEmpty P",
Inputs => {
... |
Why? There's no reason to disallow this, when with the changes in this PR both can exist at the same time. This was a necessary change a while back. For instance, a common word like "quotient" or "euler" can mean different things in the context of different packages. |
Because the symbol "isEmpty" is exported by the Core. Each package is allowed to document only its own symbols. it has nothing to do with the "meaning" of the symbol in the context of the package -- the package can document the methods it installs on the shared symbol, and that's sufficient. Actually, it would be nice if we had a way to tell, after the fact, which package installed a given method function, so we don't allow the wrong package to document a method function. |
This has not been the case for a few versions, and the reason is that it made the documentation system more annoying and less effective. |
Why? These are shared symbols. The whole point is to allow packages to share them, this include sharing the documentation! |
Here's the reason that this is insufficient: This is just an unnecessary requirement that was removed for good reason, and there's no point in bringing it back. Meanwhile, this PR is a simplification of the documentation system that happens to also fix this problem, so there's also no point here in discussing whether to bring back that requirement. |
We'll have to put that back to the way it was before. |
Yes, but the methods are not shared. If foo is a shared method and two packages install methods for |
If two packages export symbols with the same name, there should be no problem. Each package should be able to document its own symbols. |
Plenty of packages install the same exact method on types with the same name. This requirement limits what you can document using Macaulay2.
With your arbitrary requirement this would result in an error. |
I intended X, Y, and Z to be the same types, not types with the same names.
No, my requirement was that each package should document only its own symbols. That's not determined by looking at the name of the symbol, but by looking at the symbol itself. |
And what happens if a package intends to overwrite a method installed by another package in order to improve it or cover more possibilities?
What if one of those packages is Core or in one of the pre-loaded packages? These are not hypothetical issues. They are all issues I've had to deal with repeatedly in multiple packages I've contributed to. Your resistance to see that this requirement is pointless is counterproductive because instead of trying to make documentation more difficult you could be making it easier by fixing any of #666, #1203, #1649, #1668, or just properly documenting how you designed symbols, symbol bodies, and frames so that someone else can fix those issues. |
That shouldn't be done.
Okay, what if? Is there a problem? |
@DanGrayson regardless of your disagreement on what nodes should be documentable by a package, this pull request fixes a bug in the internal |
Fixes #2257 (comment).