-
-
Notifications
You must be signed in to change notification settings - Fork 477
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
fixed warning while calling OEISSequence.is_dead() function #36811
Conversation
With this PR, in a fresh session,
so we don't get any warning at all if we first ask for the keywords. I think that's OK, so if noone objects, this can go in. One thing I just noticed - the documentation of
I think it would be an improvement to write
|
Unfortunately, testing with
reveals a new failure, which is real and should be fixed:
I think one can fix this by adding an additional call There are other serious failures, as noted by @seblabbe, https://groups.google.com/g/sage-release/c/ow2oou9Q2dk/m/WCRtC3AsAQAJ, but these should be fixed in a separate ticket. |
@mantepse - please try pressing "Approve and run" button |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@mantepse - I don't know what's going on here. I think every member of https://github.com/orgs/sagemath/teams/triage
What browser/OS are you on? Do you use 2FA? |
anyhow, someone has just allowed a CI run - @mantepse - was it you? |
This comment was marked as off-topic.
This comment was marked as off-topic.
@mantepse - could you please log out and log in again? Do you have 2FA set up for GitHub? |
This comment was marked as off-topic.
This comment was marked as off-topic.
Can I have a look at the bottom part of #36830 - between the last comment and the bottom ? (Either here or by email). Firefox makes it easy to take screenshots of its pages (right click on the whitespace in the page, etc). |
@mantepse - I'll remove you from triage, and send you an invite. Maybe this will clean this up... |
OK, I did this, and you got re-added to Triage. Has it helped? |
@mantepse - another thing, to exclude browser issues. Do you have another machine you can try this on? Do you use |
This comment was marked as off-topic.
This comment was marked as off-topic.
I added a |
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm sorry, but something went wrong here: I now get the warning no matter what I do:
I think that it almost worked before the last commit, wouldn't it be sufficient to do the following? Or do you see other problems with this approach?
|
I thought the above changes will also solve the problem of |
src/sage/databases/oeis.py
Outdated
@@ -2019,7 +2019,7 @@ def test_compile_sage_code(self): | |||
RuntimeWarning: This sequence is dead: ... | |||
True | |||
""" | |||
if self.is_dead(): | |||
if self.is_dead(warn_only=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not look right: self.is_dead(warn_only=True)
will always return None
. The bug does not surface, because A000017 does not have sage code.
Whenever is_dead() method is called it loops from I added a third argument in is_dead() so whenever it loops from |
Did you see #36811 (comment) ? |
Yes, I did but it does not solve the problem of |
I think it is ok if - in a fresh session,
warns, but - in a fresh session
does not warn. |
56ea7df
to
2b8b0f3
Compare
Documentation preview for this PR (built with commit 8f9af0b; changes) is ready! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you so much!
If you have energy, it would be great if you could open an issue for the other issues, mentioned in #36811 (comment)!
If I did not overlook anything, the main issue is a weird change to the %I
field, which seems to contain a date now.
…function Fixes sagemath#36795 fixed warning in OEISSequence.is_dead() function in OEISSequence added a parameter warn=True in _field function and changed self.is_dead(warn_only=True) to self.is_dead(warn_only=warn) inside the _field function, changed the self._field('K') to self._field('K', warn=False) so the warning is not triggered URL: sagemath#36811 Reported by: Aman Moon Reviewer(s): Martin Rubey
Fixes #36795
fixed warning in OEISSequence.is_dead() function in OEISSequence
added a parameter warn=True in _field function
and changed self.is_dead(warn_only=True) to self.is_dead(warn_only=warn) inside the _field function,
changed the self._field('K') to self._field('K', warn=False)
so the warning is not triggered