Skip to content

Cannot detect whether a sequence from the oeis is dead without warning #36795

@mantepse

Description

@mantepse

Steps To Reproduce

In a fresh session,

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions