-
-
Notifications
You must be signed in to change notification settings - Fork 580
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
Issue @experimental warnings only once #20601
Comments
Branch: u/jsrn/20601_experimental |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Commit: |
comment:3
I've implemented a flag so However, during doc-testing I get strange behaviour: I wanted to add a test to demonstrate that an error message is now only issued on the first call. However, the test passes even without the patch! This is in stark contrast to the behaviour in the terminal, where the message (copy-paste the code from the doc-tested) is definitely issued every time. There is some magic in either Sphinx or the terminal interface that I'm not understanding here. (more data is that #20526, commit 0ab93ec currently has all doc-tests failing due to experimental warnings being issued, but with this patch, all the tests pass) |
Author: Johan S. R. Nielsen |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:5
I managed to make a test that properly demonstrates the behaviour: without the patch, the test fails since extra Due to aforementioned Sphinx magic the test is a bit complicated: it seems the test has to involve a "real" function/class and span multiple documentation strings, so I've added a class Note that this behaviour is really critical, i.e. that only a single warning is issued across documentation strings: if not, a class that is marked as The patch is still in needs review. |
comment:6
Detail: replace |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
Done. |
comment:9
Hello, It works (I tested it in #20526 and it fixed my problem with experimental warnings), the doc looks good... If you fix that I'll set this ticket to positive review. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:11
Stupid of me: I forgot |
comment:12
Great, I'm giving the green light! David |
comment:13
Awesome, thanks! |
comment:14
Reviewer name(s) |
Reviewer: David Lucas |
comment:16
Oops. Done now! |
comment:17
Various doctest failures, e.g.
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:19
Indeed, fixed. |
comment:20
I ran the tests and it works on my side, setting to David |
Changed branch from u/jsrn/20601_experimental to |
Changed author from Johan S. R. Nielsen to Johan Sebastian Rosenkilde Nielsen |
Changed commit from |
comment:23
Follow-up: #29272 |
Marking a function/method/constructor as
@experimental
causes the experimental warning message to be issued every time. This seems to be due to a general convention in Sage that warnings are issued repeatedly.That convention leaves
@experimental
virtually useless, however, since the user is clearly aware of the experimental nature of the code after the first issuing of the warning, but nonetheless chooses to keep on using it.This patch makes sure that the
@experimental
warnings are issued only once (without changing behaviour for other warnings)CC: @sagetrac-dlucas @dkrenn @sagetrac-tmonteil
Component: misc
Keywords: warnings, experimental
Author: Johan Sebastian Rosenkilde Nielsen
Branch:
7298382
Reviewer: David Lucas
Issue created by migration from https://trac.sagemath.org/ticket/20601
The text was updated successfully, but these errors were encountered: