Skip to content

Commit

Permalink
Merge branch 'aryan_valid_pag' of github.com:aryan26roy/pywhy-graphs …
Browse files Browse the repository at this point in the history
…into aryan_valid_pag
  • Loading branch information
adam2392 committed Jul 9, 2024
2 parents e4a6d3d + af213e8 commit 8529393
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,18 @@ jobs:
name: Setup torch for pgmpy
command: |
sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc
- run:
name: Install dowhy
command: |
git clone https://github.com/py-why/dodiscover.git
cd dodiscover
poetry run python -m pip install .
- run:
name: Check installation
command: |
python -c "import pywhy_graphs;"
python -c "import numpy; numpy.show_config()"
python -c "import dowhy;"
LIBGL_DEBUG=verbose python -c "import matplotlib.pyplot as plt; plt.figure()"
# dowhy currently requires an older version of numpy
Expand All @@ -109,6 +116,7 @@ jobs:
command: |
python -m pip install numpy==1.22.0
- run:
name: Build documentation
command: |
Expand Down
1 change: 1 addition & 0 deletions doc/whats_new/v0.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Changelog
- |Feature| Implement a suite of functions for finding and checking semi-directed paths on a mixed-edge graph, by `Adam Li`_ (:pr:`101`)
- |Feature| Implement functions for converting between a DAG and PDAG and CPDAG for generating consistent extensions of a CPDAG for example. These functions are :func:`pywhy_graphs.algorithms.pdag_to_cpdag`, :func:`pywhy_graphs.algorithms.pdag_to_dag` and :func:`pywhy_graphs.algorithms.dag_to_cpdag`, by `Adam Li`_ (:pr:`102`)
- |API| Remove poetry based setup, by `Adam Li`_ (:pr:`110`)
- |Feature| Implement and test function to validate PAG, by `Aryan Roy`_ (:pr:`100`)

Code and Documentation Contributors
-----------------------------------
Expand Down
31 changes: 31 additions & 0 deletions examples/intro/checking_validity_of_a_pag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
===========================
On PAGs and their validity
===========================
A PAG or a Partial Ancestral Graph is a type of mixed edge
graph that can represent, in a single graph, the causal relationship
between several nodes as defined by an equivalence class of MAGs.
PAGs model this relationship by displaying all common edge marks shared
by all members in the equivalence class and displaying circles for those marks
that are not common.
More details on inducing paths can be found at :footcite:`Zhang2008`.
"""


try:
from dodiscover import FCI, make_context
from dodiscover.ci import Oracle
from dodiscover.constraint.utils import dummy_sample
except ImportError as e:
raise ImportError("The 'dodiscover' package is required to convert a MAG to a PAG.")


# %%
# References
# ----------
# .. footbibliography::

0 comments on commit 8529393

Please sign in to comment.