cai-causal-graph 0.4.0.dev0__tar.gz → 0.4.0.dev1__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.
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/PKG-INFO +1 -1
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/__init__.py +1 -1
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/identify_utils.py +1 -9
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/pyproject.toml +1 -1
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/LICENSE +0 -0
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/README.md +0 -0
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/causal_graph.py +0 -0
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/exceptions.py +0 -0
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/graph_components.py +0 -0
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/interfaces.py +0 -0
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/time_series_causal_graph.py +0 -0
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/type_definitions.py +0 -0
- {cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/utils.py +0 -0
{cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/identify_utils.py
RENAMED
|
@@ -132,16 +132,8 @@ def identify_confounders(graph: CausalGraph, node_1: NodeLike, node_2: NodeLike)
|
|
|
132
132
|
# verify inputs and obtain node identifiers
|
|
133
133
|
node_1_id, node_2_id = _verify_identify_inputs(graph, node_1, node_2)
|
|
134
134
|
|
|
135
|
-
# Remove all descendants of node 1 and node 2 as they will not be necessary in the search for confounders
|
|
136
|
-
# This is to reduce memory overhead as we pass the graph throughout recursive calls
|
|
137
|
-
pruned_graph = graph.copy()
|
|
138
|
-
all_descendants = pruned_graph.get_descendants(node_1_id).union(pruned_graph.get_descendants(node_2_id))
|
|
139
|
-
all_descendants -= {node_1_id, node_2_id} # do not want to remove the nodes themselves
|
|
140
|
-
for descendant in all_descendants:
|
|
141
|
-
pruned_graph.remove_node(descendant)
|
|
142
|
-
|
|
143
135
|
# convert to networkx for optimized performance
|
|
144
|
-
digraph: networkx.DiGraph =
|
|
136
|
+
digraph: networkx.DiGraph = graph.to_networkx()
|
|
145
137
|
|
|
146
138
|
# identify confounders starting the search from each node
|
|
147
139
|
confounders = _identify_confounders_no_checks_no_descendant_pruning_networkx(digraph, node_1_id, node_2_id)
|
|
@@ -42,7 +42,7 @@ cache_dir = '/dev/null'
|
|
|
42
42
|
|
|
43
43
|
[tool.poetry]
|
|
44
44
|
name = "cai-causal-graph"
|
|
45
|
-
version = "0.4.0.
|
|
45
|
+
version = "0.4.0.dev1"
|
|
46
46
|
description = "A Causal AI package for causal graphs."
|
|
47
47
|
license = "Apache-2.0"
|
|
48
48
|
authors = ["causaLens <opensource@causalens.com>"]
|
|
File without changes
|
|
File without changes
|
{cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/causal_graph.py
RENAMED
|
File without changes
|
|
File without changes
|
{cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/graph_components.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cai_causal_graph-0.4.0.dev0 → cai_causal_graph-0.4.0.dev1}/cai_causal_graph/type_definitions.py
RENAMED
|
File without changes
|
|
File without changes
|