Cai-causal-graph

Latest version: v0.5.8

Safety actively analyzes 710445 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 10

0.4.0

- Removed `**kwargs` from the `cai_causal_graph.causal_graph.CausalGraph.add_node`,
`cai_causal_graph.causal_graph.CausalGraph.add_edge`, and `cai_causal_graph.causal_graph.CausalGraph.add_edge_by_pair`
methods in `cai_causal_graph.causal_graph.CausalGraph` and its subclasses, as none of them use it.
- Improved the `cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph.get_minimal_graph` method in
`cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph` to avoid a recursion issue.
- Added `cai_causal_graph.causal_graph.CausalGraph.add_edges_from_paths` convenience method to the `cai_causal_graph.causal_graph.CausalGraph` class,
in order to add edges from paths.
- The `cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph.get_minimal_graph` method in
`cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph` will now always return a graph of the same class type
as the current graph instance.
- The returned graph type from the `cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph.get_summary_graph` method
in `cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph` can now be specified in subclasses of
`cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph` using the `_SummaryGraphCls` attribute.
- Fixed a bug where `__getitem__` method of `cai_causal_graph.causal_graph.CausalGraph` would work when specifying invalid
node or edge query, for example a whole path. Instead, a `TypeError` is now raised.
- Fixed a bug where `cai_causal_graph.causal_graph.CausalGraph.delete_edge` would not support passing source and destination
as `cai_causal_graph.graph_components.Node`.
- Added support for passing source and destination as `cai_causal_graph.graph_components.Node` to `cai_causal_graph.causal_graph.CausalGraph.remove_edge`.
- The `cai_causal_graph.causal_graph.CausalGraph.from_adjacency_matrix` is now a class method (rather than being a static method)
which has been generalized to return an instance of the class on which it has been called (e.g. enabling returning instances of
classes inheriting from `cai_causal_graph.causal_graph.CausalGraph`.

0.3.14

- Fixed a bug in `cai_causal_graph.identify_utils.identify_confounders` where an empty confounding set would be
returned in the edge case where all causal paths from the true confounders to `node_1` were blocked by
ancestors of `node_2`, or vice versa. This comes at a slight performance cost.

0.3.13

- Improved the `cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph.get_topological_order` method in
`cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph` to improve performance. Added a new keyword
argument `respect_time_ordering` to allow the user to specify whether the topological order must respect the
time ordering of the nodes. If `respect_time_ordering=True`, the topological order will respect the time ordering,
otherwise it may not. For example, if the graph is `'Y lag(n=1)' -> 'Y' <- 'X'`, then `['X', 'Y lag(n=1)', 'Y']` and
`['Y lag(n=1)', 'X', 'Y']` are both valid topological orders. However, only the second one would respect time
ordering. If both `return_all` and `respect_time_ordering` are `True`, then only all topological orders
that respect time are returned, not all valid topological orders. The default is `respect_time_ordering=True`,
matching previous behavior.

0.3.12

- Improved efficiency of `cai_causal_graph.identify_utils.identify_confounders` by performing all operations
directly using `networkx`, removing the need to copy graphs and improving recursive logic, such that
only the minimal confounders of the specified nodes are calculated (rather than recursively calculating minimal
confounders of each parent). This results in significant speedups (in the order of hundreds of times in some cases).

0.3.11

- Fixed a bug in the `cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph.extend_graph` method in
`cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph` where the method was not adding nodes correctly with
particular graph configurations.

0.3.10

- Fixed a bug in the `cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph.get_minimal_graph` method in
`cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph` where floating nodes were not added correctly.
This also impacted the `cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph.extend_graph` method in
`cai_causal_graph.time_series_causal_graph.TimeSeriesCausalGraph`; it is also fixed now for floating nodes.

Page 4 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.