diff --git a/.circleci/config.yml b/.circleci/config.yml index 0083b2711..778994e6c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -109,6 +116,7 @@ jobs: command: | python -m pip install numpy==1.22.0 + - run: name: Build documentation command: | diff --git a/doc/whats_new/v0.2.rst b/doc/whats_new/v0.2.rst index b0c53955a..aebb2d19e 100644 --- a/doc/whats_new/v0.2.rst +++ b/doc/whats_new/v0.2.rst @@ -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 ----------------------------------- diff --git a/examples/intro/checking_validity_of_a_pag.py b/examples/intro/checking_validity_of_a_pag.py new file mode 100644 index 000000000..c0d7dc3b5 --- /dev/null +++ b/examples/intro/checking_validity_of_a_pag.py @@ -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::