Skip to content

Commit

Permalink
Merge pull request #56 from causy-dev/add-warning-to-orientation-conf…
Browse files Browse the repository at this point in the history
…licts

add warning when orientation conflicts are detected
  • Loading branch information
LilithWittmann authored Aug 6, 2024
2 parents ebd66d8 + 82a7847 commit 06c1916
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions causy/causal_discovery/constraint/orientation_rules/pc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import enum
import logging
from typing import Tuple, List, Optional, Generic
import itertools

Expand All @@ -18,6 +19,8 @@

# TODO: refactor ColliderTest -> ColliderRule and move to folder orientation_rules (after checking for duplicates)

logger = logging.getLogger(__name__)


def filter_unapplied_actions(actions, u, v):
"""
Expand Down Expand Up @@ -139,6 +142,9 @@ def process(
unapplied_actions, y, z
)
if len(unapplied_actions_y_z) > 0 or len(unapplied_actions_x_z) > 0:
logger.warning(
f"Orientation conflict detected in ColliderTest stage when orienting the edge between {x.name} and {y.name}. The conflict is resolved using the strategy {self.conflict_resolution_strategy}, but orientation conflicts indicate assumption violations and can severely affect the accuracy of the results.",
)
if (
ColliderTestConflictResolutionStrategies.KEEP_FIRST
is self.conflict_resolution_strategy
Expand Down

0 comments on commit 06c1916

Please sign in to comment.