Skip to content

bug: Fatal TypeError when importing or running with JIT disabled (NUMBA_DISABLE_JIT=1) due to Interval constructor arity mismatch #158

Description

@abhiprd2000

Description

When running PyReason with Numba's JIT compilation disabled (NUMBA_DISABLE_JIT=1), the package crashes on import. This happens because the Interval class constructor (__new__) expects 3 positional arguments, but upstream factory functions are passing 5 arguments, causing a TypeError. This completely breaks the interpreted fallback mode and the disable_jit unit tests.

Steps to Reproduce

import os
os.environ['NUMBA_DISABLE_JIT'] = '1'

import pyreason as pr

Expected Behavior

The package should import cleanly without compilation dependency requirements.

Actual Behaviour

Traceback (most recent call last):
  File "verify_bug.py", line 6, in <module>
    import pyreason as pr
  File "pyreason/__init__.py", line 10, in <module>
    from pyreason.pyreason import *
  File "pyreason/pyreason.py", line 1672, in <module>
    def filter_and_sort_nodes(interpretation, labels: List[str], bound: interval.Interval=interval.closed(0,1), sort_by: str='lower', descending: bool=True):
  File "pyreason/scripts/numba_wrapper/numba_types/interval_type.py", line 145, in closed
    return Interval(np.float64(lower), np.float64(upper), static, np.float64(lower), np.float64(upper))
TypeError: Interval.__new__() takes from 3 to 4 positional arguments but 6 were given

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions