@@ -1,5 +1,4 @@
Loading
1 1
from collections import namedtuple
2 -
from collections.abc import Mapping
3 2
from functools import singledispatch
4 3
import dis
5 4
import inspect
@@ -10,6 +9,10 @@
Loading
10 9
from .abstract import Check
11 10
from experta.watchers import MATCH
12 11
12 +
try:
13 +
    from collections.abc import Mapping  # noqa
14 +
except ImportError:
15 +
    from collections import Mapping  # noqa
13 16
14 17
CheckFunction = namedtuple('CheckFunction',
15 18
                           ['key_a', 'key_b', 'expected', 'check'])
@@ -232,15 +235,15 @@
Loading
232 235
233 236
234 237
class SameContextCheck(Check):
235 -
    def __call__(self, l, r):
236 -
        for key, value in l.items():
238 +
    def __call__(self, left, right):
239 +
        for key, value in left.items():
237 240
            if key[0] is False:
238 241
                raise RuntimeError(
239 242
                    'Negated value "%s" present before capture.' % key[1])
240 243
            else:
241 -
                if key in r and value != r[key]:
244 +
                if key in right and value != right[key]:
242 245
                    return False
243 -
                if (False, key) in r and value == r[(False, key)]:
246 +
                if (False, key) in right and value == right[(False, key)]:
244 247
                    return False
245 248
        else:
246 249
            return True

@@ -1,6 +1,10 @@
Loading
1 1
"""Mixing classes for the RETE nodes."""
2 2
from collections import namedtuple
3 -
from collections.abc import Callable
3 +
4 +
try:
5 +
    from collections.abc import Callable  # noqa
6 +
except ImportError:
7 +
    from collections import Callable  # noqa
4 8
5 9
6 10
#: Used to store node/callback pair in nodes children set.

@@ -1,7 +1,6 @@
Loading
1 1
from itertools import chain
2 2
from functools import lru_cache
3 3
import abc
4 -
import collections
5 4
6 5
from schema import Schema
7 6
@@ -10,6 +9,11 @@
Loading
10 9
from experta.conditionalelement import OperableCE
11 10
from experta.conditionalelement import ConditionalElement
12 11
12 +
try:
13 +
    from collections.abc import Callable  # noqa
14 +
except ImportError:
15 +
    from collections import Callable  # noqa
16 +
13 17
14 18
class BaseField(metaclass=abc.ABCMeta):
15 19
    @abc.abstractmethod
@@ -70,7 +74,7 @@
Loading
70 74
                raise KeyError(key)
71 75
            elif key in self.__defaults:
72 76
                return self.__defaults[key]
73 -
            elif isinstance(default, collections.abc.Callable):
77 +
            elif isinstance(default, Callable):
74 78
                return self.__defaults.setdefault(key, default())
75 79
            else:
76 80
                return self.__defaults.setdefault(key, default)

@@ -1,10 +1,14 @@
Loading
1 1
from functools import singledispatch
2 -
import collections.abc
3 2
4 -
from frozendict import frozendict
3 +
from immutabledict import immutabledict as frozendict
5 4
6 5
from .fieldconstraint import P
7 6
7 +
try:
8 +
    from collections.abc import Hashable  # noqa
9 +
except ImportError:
10 +
    from collections import Hashable  # noqa
11 +
8 12
9 13
class frozenlist(tuple):
10 14
    def __repr__(self):
@@ -13,7 +17,7 @@
Loading
13 17
14 18
@singledispatch
15 19
def freeze(obj):
16 -
    if isinstance(obj, collections.abc.Hashable):
20 +
    if isinstance(obj, Hashable):
17 21
        return obj
18 22
    else:
19 23
        raise TypeError(

@@ -1,10 +1,14 @@
Loading
1 -
from collections.abc import Iterable
2 1
from functools import update_wrapper
3 2
import inspect
4 3
5 4
from experta import watchers
6 5
from experta.conditionalelement import ConditionalElement
7 6
7 +
try:
8 +
    from collections.abc import Iterable  # noqa
9 +
except ImportError:
10 +
    from collections import Iterable  # noqa
11 +
8 12
9 13
class Rule(ConditionalElement):
10 14
    """

@@ -6,7 +6,6 @@
Loading
6 6
needed in this implementation.
7 7
8 8
"""
9 -
from collections.abc import Mapping
10 9
from contextlib import suppress
11 10
from itertools import chain
12 11
@@ -18,6 +17,11 @@
Loading
18 17
from .abstract import Node, OneInputNode, TwoInputNode
19 18
from .token import Token
20 19
20 +
try:
21 +
    from collections.abc import Mapping  # noqa
22 +
except ImportError:
23 +
    from collections import Mapping  # noqa
24 +
21 25
22 26
class BusNode(mixins.AnyChild,
23 27
              mixins.NoMemory,

@@ -1,11 +1,15 @@
Loading
1 1
"""Token object and related objects needed by the RETE algorithm."""
2 2
3 3
from collections import namedtuple
4 -
from collections.abc import Mapping
5 4
from enum import Enum
6 5
7 6
from experta.fact import Fact
8 7
8 +
try:
9 +
    from collections.abc import Mapping  # noqa
10 +
except ImportError:
11 +
    from collections import Mapping  # noqa
12 +
9 13
10 14
class TokenInfo(namedtuple('_TokenInfo', ['data', 'context'])):
11 15
    """Tag agnostig version of Token with inmutable data."""

@@ -1,8 +1,11 @@
Loading
1 -
from collections.abc import Callable
2 -
3 1
from experta.conditionalelement import ConditionalElement
4 2
from experta.pattern import Bindable
5 3
4 +
try:
5 +
    from collections.abc import Callable  # noqa
6 +
except ImportError:
7 +
    from collections import Callable  # noqa
8 +
6 9
__all__ = ['L', 'W', 'P']
7 10
8 11
Files Coverage
experta 92.69%
Project Totals (26 files) 92.69%
49.2
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
49.3
TRAVIS_PYTHON_VERSION=3.7
TRAVIS_OS_NAME=linux
49.1
TRAVIS_PYTHON_VERSION=3.5
TRAVIS_OS_NAME=linux
49.4
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading