Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer #178

Merged
merged 2 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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