You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sage: s = oeis(17)
sage: s.is_dead()
/home/martin/sage/src/sage/databases/oeis.py:1153: RuntimeWarning: This sequence is dead: "A000017: Erroneous version of A032522."
warn('This sequence is dead: "{}: {}"'.format(self.id(), self.name()), RuntimeWarning)
True
Expected Behavior
It should just return the result, without triggering the warning.
Actual Behavior
A warning is triggered, which is annoying when processing many sequences.
Additional Information
The reason is that OEISSequence._field issues a warning when the sequence is dead, and this cannot be bypassed.
I see two possible solutions:
have a keyword warn for _field(self, warn=True) and, in is_dead, do "dead" in self._field('K', warn=False)[0].
check the raw_entry in is_dead directly, e.g., ["dead" in l[11:] for l in s.raw_entry().splitlines() if l[1] == "K"]
Environment
irrelevant.
Checklist
I have searched the existing issues for a bug report that matches the one I want to file, without success.
I have read the documentation and troubleshoot guide
The text was updated successfully, but these errors were encountered:
…function
Fixessagemath#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
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Dec 26, 2023
…function
Fixessagemath#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
Steps To Reproduce
In a fresh session,
Expected Behavior
It should just return the result, without triggering the warning.
Actual Behavior
A warning is triggered, which is annoying when processing many sequences.
Additional Information
The reason is that
OEISSequence._field
issues a warning when the sequence is dead, and this cannot be bypassed.I see two possible solutions:
warn
for_field(self, warn=True)
and, inis_dead
, do"dead" in self._field('K', warn=False)[0]
.raw_entry
inis_dead
directly, e.g.,["dead" in l[11:] for l in s.raw_entry().splitlines() if l[1] == "K"]
Environment
Checklist
The text was updated successfully, but these errors were encountered: