PyDecisionGraph 0.1.1__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/PKG-INFO +3 -2
  2. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/PyDecisionGraph.egg-info/PKG-INFO +3 -2
  3. pydecisiongraph-0.2.0/PyDecisionGraph.egg-info/SOURCES.txt +44 -0
  4. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/decision_graph/__init__.py +2 -2
  5. pydecisiongraph-0.2.0/decision_graph/decision_tree/__init__.py +44 -0
  6. pydecisiongraph-0.2.0/decision_graph/decision_tree/capi/__init__.py +52 -0
  7. pydecisiongraph-0.2.0/decision_graph/decision_tree/capi/c_abc.pyi +537 -0
  8. pydecisiongraph-0.2.0/decision_graph/decision_tree/capi/c_collection.pyi +243 -0
  9. pydecisiongraph-0.2.0/decision_graph/decision_tree/capi/c_node.pyi +358 -0
  10. pydecisiongraph-0.2.0/decision_graph/decision_tree/exc.py +74 -0
  11. pydecisiongraph-0.2.0/decision_graph/decision_tree/native/__init__.py +98 -0
  12. {pydecisiongraph-0.1.1/decision_graph/decision_tree → pydecisiongraph-0.2.0/decision_graph/decision_tree/native}/abc.py +188 -37
  13. {pydecisiongraph-0.1.1/decision_graph/decision_tree → pydecisiongraph-0.2.0/decision_graph/decision_tree/native}/collection.py +7 -13
  14. {pydecisiongraph-0.1.1/decision_graph/decision_tree → pydecisiongraph-0.2.0/decision_graph/decision_tree/native}/expression.py +1 -1
  15. {pydecisiongraph-0.1.1/decision_graph/decision_tree → pydecisiongraph-0.2.0/decision_graph/decision_tree/native}/node.py +25 -11
  16. pydecisiongraph-0.2.0/decision_graph/logic_group/__init__.py +22 -0
  17. pydecisiongraph-0.2.0/decision_graph/logic_group/base.py +72 -0
  18. pydecisiongraph-0.2.0/decision_graph/logic_group/pending_request.py +253 -0
  19. pydecisiongraph-0.2.0/tests/test_le.py +114 -0
  20. pydecisiongraph-0.2.0/tests/test_skippable.py +229 -0
  21. pydecisiongraph-0.1.1/PyDecisionGraph.egg-info/SOURCES.txt +0 -28
  22. pydecisiongraph-0.1.1/decision_graph/decision_tree/__init__.py +0 -32
  23. pydecisiongraph-0.1.1/decision_graph/decision_tree/exc.py +0 -38
  24. pydecisiongraph-0.1.1/decision_graph/decision_tree/logic_group.py +0 -307
  25. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/LICENSE +0 -0
  26. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/MANIFEST.in +0 -0
  27. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/PyDecisionGraph.egg-info/dependency_links.txt +0 -0
  28. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/PyDecisionGraph.egg-info/not-zip-safe +0 -0
  29. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/PyDecisionGraph.egg-info/requires.txt +0 -0
  30. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/PyDecisionGraph.egg-info/top_level.txt +0 -0
  31. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/README.md +0 -0
  32. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/pyproject.toml +0 -0
  33. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/setup.cfg +0 -0
  34. {pydecisiongraph-0.1.1 → pydecisiongraph-0.2.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: PyDecisionGraph
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: A rule-based decision tree implementation for Python
5
5
  Home-page: https://github.com/BolunHan/PyDecisionGraph
6
6
  Author: Han Bolun
@@ -23,6 +23,7 @@ Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
23
23
  Provides-Extra: visualization
24
24
  Requires-Dist: pyvis; extra == "visualization"
25
25
  Requires-Dist: networkx; extra == "visualization"
26
+ Dynamic: license-file
26
27
 
27
28
  # PyDecisionGraph
28
29
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: PyDecisionGraph
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: A rule-based decision tree implementation for Python
5
5
  Home-page: https://github.com/BolunHan/PyDecisionGraph
6
6
  Author: Han Bolun
@@ -23,6 +23,7 @@ Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
23
23
  Provides-Extra: visualization
24
24
  Requires-Dist: pyvis; extra == "visualization"
25
25
  Requires-Dist: networkx; extra == "visualization"
26
+ Dynamic: license-file
26
27
 
27
28
  # PyDecisionGraph
28
29
 
@@ -0,0 +1,44 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ setup.cfg
6
+ setup.py
7
+ ./decision_graph/__init__.py
8
+ ./decision_graph/decision_tree/__init__.py
9
+ ./decision_graph/decision_tree/exc.py
10
+ ./decision_graph/decision_tree/capi/__init__.py
11
+ ./decision_graph/decision_tree/capi/c_abc.pyi
12
+ ./decision_graph/decision_tree/capi/c_collection.pyi
13
+ ./decision_graph/decision_tree/capi/c_node.pyi
14
+ ./decision_graph/decision_tree/native/__init__.py
15
+ ./decision_graph/decision_tree/native/abc.py
16
+ ./decision_graph/decision_tree/native/collection.py
17
+ ./decision_graph/decision_tree/native/expression.py
18
+ ./decision_graph/decision_tree/native/node.py
19
+ ./decision_graph/logic_group/__init__.py
20
+ ./decision_graph/logic_group/base.py
21
+ ./decision_graph/logic_group/pending_request.py
22
+ PyDecisionGraph.egg-info/PKG-INFO
23
+ PyDecisionGraph.egg-info/SOURCES.txt
24
+ PyDecisionGraph.egg-info/dependency_links.txt
25
+ PyDecisionGraph.egg-info/not-zip-safe
26
+ PyDecisionGraph.egg-info/requires.txt
27
+ PyDecisionGraph.egg-info/top_level.txt
28
+ decision_graph/__init__.py
29
+ decision_graph/decision_tree/__init__.py
30
+ decision_graph/decision_tree/exc.py
31
+ decision_graph/decision_tree/capi/__init__.py
32
+ decision_graph/decision_tree/capi/c_abc.pyi
33
+ decision_graph/decision_tree/capi/c_collection.pyi
34
+ decision_graph/decision_tree/capi/c_node.pyi
35
+ decision_graph/decision_tree/native/__init__.py
36
+ decision_graph/decision_tree/native/abc.py
37
+ decision_graph/decision_tree/native/collection.py
38
+ decision_graph/decision_tree/native/expression.py
39
+ decision_graph/decision_tree/native/node.py
40
+ decision_graph/logic_group/__init__.py
41
+ decision_graph/logic_group/base.py
42
+ decision_graph/logic_group/pending_request.py
43
+ tests/test_le.py
44
+ tests/test_skippable.py
@@ -1,9 +1,9 @@
1
- __version__ = "0.1.1"
1
+ __version__ = "0.2.0"
2
2
 
3
3
  import logging
4
4
  import sys
5
5
 
6
- LOGGER = logging.getLogger("DecisionTree")
6
+ LOGGER = logging.getLogger("DecisionGraph")
7
7
  LOGGER.setLevel(logging.INFO)
8
8
 
9
9
  if not LOGGER.hasHandlers():
@@ -0,0 +1,44 @@
1
+ import logging
2
+
3
+ from .. import LOGGER
4
+
5
+ LOGGER = LOGGER.getChild("DecisionTree")
6
+
7
+ __all__ = [
8
+ 'LOGGER', 'set_logger',
9
+ 'NodeError', 'TooManyChildren', 'TooFewChildren', 'NodeNotFountError', 'NodeValueError', 'EdgeValueError', 'ResolutionError', 'ExpressFalse', 'ContextsNotFound',
10
+ 'LGM', 'LogicGroup', 'SkipContextsBlock', 'LogicExpression', 'LogicNode', 'ActionNode', 'ELSE_CONDITION',
11
+ 'NoAction', 'LongAction', 'ShortAction', 'RootLogicNode', 'ContextLogicExpression', 'AttrExpression', 'MathExpression', 'ComparisonExpression', 'LogicalExpression',
12
+ 'LogicMapping', 'LogicGenerator'
13
+ ]
14
+
15
+ from .exc import *
16
+
17
+ _USING_CAPI = False
18
+ try:
19
+ # Attempt to import the C API module
20
+ from . import capi
21
+ from .capi.c_abc import *
22
+ from .capi.c_node import *
23
+ from .capi.c_collection import *
24
+
25
+ _USING_CAPI = True
26
+ except Exception:
27
+ # Fallback to the python node model
28
+ from . import native
29
+ from .native.abc import *
30
+ from .native.node import *
31
+ from .native.collection import *
32
+
33
+ _USING_CAPI = False
34
+
35
+
36
+ def set_logger(logger: logging.Logger):
37
+ global LOGGER
38
+ LOGGER = logger
39
+
40
+ # ensure abc module (imported above) receives logger
41
+ if _USING_CAPI:
42
+ capi.set_logger(logger.getChild('CAPI'))
43
+ else:
44
+ native.set_logger(logger.getChild('Native'))
@@ -0,0 +1,52 @@
1
+ import logging
2
+
3
+ from .. import LOGGER
4
+
5
+ LOGGER = LOGGER.getChild('CAPI')
6
+
7
+ from ..exc import (
8
+ NodeError, TooManyChildren, TooFewChildren, NodeNotFountError, NodeValueError,
9
+ EdgeValueError, ResolutionError, ExpressFalse, ContextsNotFound
10
+ )
11
+
12
+ # import the module so we can set its LOGGER attribute
13
+ from . import c_abc
14
+
15
+ from .c_abc import (
16
+ Singleton,
17
+ NodeEdgeCondition, ConditionElse, ConditionAny, ConditionAuto, BinaryCondition, ConditionTrue, ConditionFalse,
18
+ NO_CONDITION, ELSE_CONDITION, AUTO_CONDITION, TRUE_CONDITION, FALSE_CONDITION,
19
+ SkipContextsBlock, LogicExpression, LogicNode,
20
+ LogicGroupManager, LGM, LogicGroup,
21
+ ActionNode, BreakpointNode, PlaceholderNode,
22
+ NoAction, LongAction, ShortAction,
23
+ )
24
+
25
+ from .c_node import (
26
+ RootLogicNode, ContextLogicExpression,
27
+ AttrExpression, AttrNestedExpression,
28
+ MathExpressionOperator, MathExpression,
29
+ ComparisonExpressionOperator, ComparisonExpression,
30
+ LogicalExpressionOperator, LogicalExpression,
31
+ )
32
+
33
+ from .c_collection import (
34
+ LogicMapping,
35
+ LogicSequence,
36
+ LogicGenerator,
37
+ )
38
+
39
+ __all__ = [
40
+ 'LOGGER', 'set_logger',
41
+ 'NodeError', 'TooManyChildren', 'TooFewChildren', 'NodeNotFountError', 'NodeValueError', 'EdgeValueError', 'ResolutionError', 'ExpressFalse', 'ContextsNotFound',
42
+ 'LGM', 'LogicGroup', 'SkipContextsBlock', 'LogicExpression', 'LogicNode', 'ActionNode', 'ELSE_CONDITION',
43
+ 'NoAction', 'LongAction', 'ShortAction', 'RootLogicNode', 'ContextLogicExpression', 'AttrExpression', 'MathExpression', 'ComparisonExpression', 'LogicalExpression',
44
+ 'LogicMapping', 'LogicGenerator'
45
+ ]
46
+
47
+
48
+ def set_logger(logger: logging.Logger):
49
+ global LOGGER
50
+ LOGGER = logger
51
+
52
+ c_abc.LOGGER = logger.getChild('abc')