-
-
Notifications
You must be signed in to change notification settings - Fork 559
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
Clarify and complete documentation of function() #17447
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:3
For the question about creation and overwriting: The toplevel
The library versions of these routines don't do that:
The intended use of the toplevel As a result I think this is the point where people usually give up fixing this mess (I have). Hopefully you will now follow through. Note that we can probably not do more than document the issues, which is not going to fix much, because people won't read the doc, but then at least you can point them somewhere when they complain. I suspect that Zimmerman's calculus book uses this stuff quite extensively, so deprecating/changing the current behaviour will likely lead to pushback from him, and probably rightly so. (this is the kind of issue that earns sage the reputation of "implement now, design later") |
comment:5
Awesome, thank you, Nils. These things always confused me, so I'm relieved to hear that they should be avoided! Even the documentation of var is full of such examples:
Should we change these examples, too? |
comment:6
Don't base any other work on this branch just yet, since it's likely to be rebased. I have deprecated the use of The object returned by I haven't changed all doctests to take into account the deprecation, but I've done some files to show the impact of the change (seems relatively minor). |
Commit: |
comment:7
Not really ready for review but is ready for input. And is mainly ready for someone else to rewrite documentation properly. People CC'd on this ticket look like good candidates to do so. New commits:
note that the doctest that apparently got removed in b41248b in reality gets moved to var.pyx because it tests the toplevel |
comment:8
Replying to @nbruin:
This makes it a lot clearer to me now. Just a minor thing:
by
which in my understanding does the same but is shorter and makes clear that |
comment:9
Replying to @sagetrac-schymans:
At least one occurrence of that is in the doctest of Another independent point: the top-level |
comment:10
There are broken doctests in the 'doc' folder
Nathann |
comment:11
Replying to @nathanncohen:
Yes, and that is not the only place. First we need to see if there is any good reason why |
comment:12
I am afraid that you will have to find somebody else. I never used Sage's symbolics. Nathann |
Changed branch from u/nbruin/clarify_and_complete_documentation_of_function__ to public/17447 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Reviewer: Ralf Stephan |
comment:17
These are the remaining doctest fixes coming from
|
comment:18
Cc:ing him for that reason. Though we have already had a few other discussions on Trac about the need to update our tests while not maintaining exact compatibility. Since they don't (yet) raise errors, but apparently only the deprecation warning, should we maybe update the tests (in that part only) to have the deprecation warning returned? Note that I don't believe the deprecation warning is even doctested, which is a no-no :) Also, does the current branch actually "clarify and complete documentation of function"? It looks like it mostly fixes doctests. Another change not doctested is
which I think happens twice. I'm still not sure I even understand some of the subtle differences. Are there occasions where the old behavior was "right" in the sense that one wanted that returned, and have we shown how to get that object? What about the ask.sagemath question? All that to say that nonetheless it will be great to have a unified interface on this, if that is really the right thing to do, which from the comments it apparently is. |
comment:24
Replying to @nbruin:
That would be awesome! Much more consistent AND flexible. +1 from me. |
comment:25
Replying to @nbruin:
See #17958 for |
comment:26
Replying to @nbruin:
I'm not sure about And IMO, the version of |
comment:27
So, comment:17 gave part of a review. Can someone please complete it? |
comment:28
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:32
OK, comments #17 and #27 provide a positive review of the first bit. I give a largely positive review to Ralf's doctest adjustments. There was one overcorrection in patchbot is happy and I think all code is positively reviewed now. Ready for merge! |
Changed author from schymans to Nils Bruin, Ralf Stephan |
Changed reviewer from Ralf Stephan to Ralf Stephan, Nils Bruin |
Changed branch from public/17447 to |
The documentation of function() is incomplete and confusing.
For example, none of the methods described in http://www.sagemath.org/doc/reference/calculus/sage/symbolic/function_factory.html show up when I type:
The distinction between
and
is also not documented. See also #17445 for sources of confusion. Need to explain what happens in the second case above (
f = function('f',x)
). A symbolic functionf
is first created and then overwritten by the expressionf
?See the following example, where f is first an expression, then becomes redefined to a function in the background, but does not contain any information about its variables.
See http://ask.sagemath.org/question/9932/how-to-substitute-a-function-within-derivatives/?answer=14752#post-id-14752 for a possible start at how to explain this, at least for those writing this.
CC: @nbruin @kcrisman @sagetrac-tmonteil @zimmermann6
Component: documentation
Author: Nils Bruin, Ralf Stephan
Branch/Commit:
7c029f3
Reviewer: Ralf Stephan, Nils Bruin
Issue created by migration from https://trac.sagemath.org/ticket/17447
The text was updated successfully, but these errors were encountered: