Skip to content

[BUG] __gt__ and __ge__ dunders are undefined #1391

Description

@genedan

Are you on the latest chainladder version?

  • Yes, this bug occurs on the latest version.

Describe the bug in words

Discovered when working on #1342. Trying to do something like raa > 10000 fails.

How can the bug be reproduced?

This comparison works:

import chainladder as cl
raa = cl.load_sample('raa')

raa < 10000

       12     24     36     48     60     72     84     96     108    120
1981  True   True  False  False  False  False  False  False  False  False
1982  True   True   True  False  False  False  False  False  False   True
1983  True   True  False  False  False  False  False  False   True   True
1984  True  False  False  False  False  False  False   True   True   True
1985  True   True  False  False  False  False   True   True   True   True
1986  True   True  False  False  False   True   True   True   True   True
1987  True   True  False  False   True   True   True   True   True   True
1988  True   True  False   True   True   True   True   True   True   True
1989  True   True   True   True   True   True   True   True   True   True
1990  True   True   True   True   True   True   True   True   True   True

But this one doesn't:

raa > 10000

Traceback (most recent call last):
...
  File "<ipython-input-16-bbd772ba6406>", line 1, in <module>
    raa > 10000
TypeError: '>' not supported between instances of 'Triangle' and 'int'

What is the expected behavior?

We should get a triangle back filled with the correct bools. The __gt__ and __ge__ dunders need to be defined.

Would you be willing to contribute this ticket?

  • Yes, absolutely!
  • Yes, but I would like some help.
  • No.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Great First Contribution! 🌱Beginner friendly tickets with narrow scope and huge impact. Perfect to get your feet wet!

    Type

    Fields

    Priority

    High

    Effort

    Low

    Scope

    Codebase

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions