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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cai-causal-graph
3
- Version: 0.4.0.dev0
3
+ Version: 0.4.0.dev1
4
4
  Summary: A Causal AI package for causal graphs.
5
5
  Home-page: https://causalgraph.causalens.com/
6
6
  License: Apache-2.0
@@ -31,7 +31,7 @@ __all__ = [
31
31
  'VARIABLE_NAME',
32
32
  ]
33
33
 
34
- __version__ = '0.4.0.dev0'
34
+ __version__ = '0.4.0.dev1'
35
35
 
36
36
  from cai_causal_graph.causal_graph import CausalGraph, Skeleton
37
37
  from cai_causal_graph.time_series_causal_graph import TimeSeriesCausalGraph
@@ -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 = pruned_graph.to_networkx()
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.dev0"
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>"]