Skip to content

Commit

Permalink
Merge pull request #178 from jakobrunge/developer
Browse files Browse the repository at this point in the history
Developer
  • Loading branch information
jakobrunge authored Feb 25, 2022
2 parents b833174 + 08a2695 commit d9d06a1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
9 changes: 5 additions & 4 deletions release_on_pip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
# cd v4210/

# Make sure to be in a clean anaconda
# conda create --name tigramite-release-4210 python=3.7
# conda activate tigramite-release-4210
conda create --name tigramite-release-5001 python=3.9
conda activate tigramite-release-5001

# Pull tigramite github
# git clone https://github.com/jakobrunge/tigramite.git
git clone https://github.com/jakobrunge/tigramite.git
cd tigramite

# Checkout master
# git checkout master
git checkout master

# Run all those in Linux or Windows

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def run(self):
# Run the setup
setup(
name="tigramite",
version="5.0.0.1",
version="5.0.0.2",
packages=["tigramite", "tigramite.independence_tests", "tigramite.toymodels"],
license="GNU General Public License v3.0",
description="Tigramite causal discovery for time series",
Expand Down
27 changes: 13 additions & 14 deletions tigramite/causal_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ def __init__(self,
if S is None:
S = []

X = set(X)
Y = set(Y)
S = set(S)
self.listX = list(X)
self.listY = list(Y)
self.listS = list(S)

self.X = set(X)
self.Y = set(Y)
self.S = set(S)

#
# Checks regarding graph type
Expand All @@ -102,12 +106,10 @@ def __init__(self,
hidden_variables = []

self.hidden_variables = set(hidden_variables)
if len(self.hidden_variables.intersection(X.union(Y).union(S))) > 0:
if len(self.hidden_variables.intersection(self.X.union(self.Y).union(self.S))) > 0:
raise ValueError("XYS overlaps with hidden_variables!")

self.X = X
self.Y = Y
self.S = S


# Only needed for later extension to MAG/PAGs
if 'pag' in graph_type:
Expand Down Expand Up @@ -148,14 +150,16 @@ def __init__(self,
M = set(mediators)
self.M = M

for varlag in X.union(Y).union(S):
self.listM = list(self.M)

for varlag in self.X.union(self.Y).union(self.S):
if abs(varlag[1]) > self.tau_max:
raise ValueError("X, Y, S must have time lags inside graph.")

if len(self.X.intersection(self.Y)) > 0:
raise ValueError("Overlap between X and Y")

if len(S.intersection(self.Y.union(self.X))) > 0:
if len(self.S.intersection(self.Y.union(self.X))) > 0:
raise ValueError("Conditions S overlap with X or Y")

# # TODO: need to prove that this is sufficient for non-identifiability!
Expand All @@ -182,11 +186,6 @@ def __init__(self,
if len(self.S.intersection(self._get_descendants(self.Y))) > 0:
raise ValueError("Not identifiable: Conditions S overlap with des(Y)")

self.listX = list(self.X)
self.listY = list(self.Y)
self.listS = list(self.S)
self.listM = list(self.M)

if self.verbosity > 0:
print("\n##\n## Initializing CausalEffects class\n##"
"\n\nInput:")
Expand Down

0 comments on commit d9d06a1

Please sign in to comment.