I got the following error when trying to create an AncestralGraph object:
NeighborError: The node X7 has parents X8. Nodes cannot have neighbors and parents/spouses.
Checking the source code in graphical_models.classes.mags.ancestral_graph, it seems that the neighbors of a node $X$ contains any node $Y$ such that $X-Y$ in the MAG, the spouses contains any node $Y$ such that $X\leftrightarrow Y$ in the MAG.
So, my question is:
Why a node can not have a neighbor and a parent/spouse at the same time?
This scenarios seems reasonable, for example:
The underlying DAG is $X\to S \leftarrow Y \leftarrow A$, where $S$ is a selection variable, then the corresponding MAG is $X - Y \leftarrow A$, right?