Skip to content

Commit

Permalink
Merge pull request #121 from jakobrunge/developer
Browse files Browse the repository at this point in the history
Developer
  • Loading branch information
jakobrunge authored Jun 4, 2021
2 parents 1ce2a4b + 034ee7f commit 5f68977
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 33 deletions.
9 changes: 1 addition & 8 deletions environment_py3.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
name: tigramite4_conda
dependencies:
- python=3
- numpy>=1.14.0
- numpy>=1.17.0
- scipy>=1.3.0
- scikit-learn>=0.21.2
- matplotlib>=3.1.1
- networkx>=2.4
- cython>=0.26
- torch>=1.7
- gpytorch>=1.4
- dcor>=0.5.3
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def define_extension(extension_name, source_files=None):
EXTRAS_REQUIRE = {
"all": [
"scikit-learn>=0.21", # Gaussian Process (GP) Regression
"matplotlib>=3.0", # plotting
"matplotlib>=3.4.0", # plotting
"networkx>=2.4", # plotting
"torch>=1.7", # GPDC torch version
"gpytorch>=1.4", # GPDC torch version
"dcor>=0.5.3", # GPDC
"gpytorch>=1.4", # GPDC gpytorch version
"dcor>=0.5.3", # GPDC distance correlation version
]
}

Expand All @@ -90,7 +90,7 @@ def define_extension(extension_name, source_files=None):
# Run the setup
setup(
name="tigramite",
version="4.2.2.0",
version="4.2.2.1",
packages=["tigramite", "tigramite.independence_tests"],
license="GNU General Public License v3.0",
description="Tigramite causal discovery for time series",
Expand Down
7 changes: 3 additions & 4 deletions tigramite/independence_tests/cmiknn.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
from __future__ import print_function
from scipy import special, stats, spatial
import numpy as np

import warnings
from .independence_tests_base import CondIndTest

try:
from tigramite import tigramite_cython_code
except:
print("Could not import packages for CMIknn and GPDC estimation")
except Exception as e:
warnings.warn(str(e))


class CMIknn(CondIndTest):
Expand Down
8 changes: 4 additions & 4 deletions tigramite/independence_tests/gpdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

from __future__ import print_function
import numpy as np
import dcor

import warnings
from .independence_tests_base import CondIndTest

try:
import dcor
from sklearn import gaussian_process
except:
print("Could not import sklearn for Gaussian process tests")
except Exception as e:
warnings.warn(str(e))

class GaussProcReg():
r"""Gaussian processes abstract base class.
Expand Down
15 changes: 8 additions & 7 deletions tigramite/independence_tests/gpdc_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
#
# License: GNU General Public License v3.0



from __future__ import print_function
import warnings
import numpy as np
import gpytorch
import torch
import dcor
import gc

from .independence_tests_base import CondIndTest
from .LBFGS import FullBatchLBFGS
try:
import dcor
import torch
import gpytorch
from .LBFGS import FullBatchLBFGS
except Exception as e:
warnings.warn(str(e))

class GaussProcRegTorch():
r"""Gaussian processes abstract base class.
Expand Down
10 changes: 5 additions & 5 deletions tigramite/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ def draw_edge(
cax_e = pyplot.axes(
[
0.55,
ax.figbox.bounds[1] + 0.02,
ax.get_subplotspec().get_position(ax.figure).bounds[1] + 0.02,
0.4,
0.025 + (len(all_links_edge_weights) == 0) * 0.035,
],
Expand All @@ -1375,7 +1375,7 @@ def draw_edge(
# except:
# print('no ticks given')

cb_e.outline.remove()
cb_e.outline.clear()
cax_e.set_xlabel(
link_colorbar_label, labelpad=1, fontsize=label_fontsize, zorder=-10
)
Expand Down Expand Up @@ -1442,13 +1442,13 @@ def get_aspect(ax):
if node_rings[ring]["colorbar"]:
# Create colorbars for nodes
# cax_n = pyplot.axes([.8 + ring*0.11,
# ax.figbox.bounds[1]+0.05, 0.025, 0.35], frameon=False) #
# ax.get_subplotspec().get_position(ax.figure).bounds[1]+0.05, 0.025, 0.35], frameon=False) #
# setup colorbar axes.
# setup colorbar axes.
cax_n = pyplot.axes(
[
0.05,
ax.figbox.bounds[1] + 0.02 + ring * 0.11,
ax.get_subplotspec().get_position(ax.figure).bounds[1] + 0.02 + ring * 0.11,
0.4,
0.025 + (len(node_rings) == 1) * 0.035,
],
Expand All @@ -1466,7 +1466,7 @@ def get_aspect(ax):
)
# except:
# print ('no ticks given')
cb_n.outline.remove()
cb_n.outline.clear()
# cb_n.set_ticks()
cax_n.set_xlabel(
node_rings[ring]["label"], labelpad=1, fontsize=label_fontsize
Expand Down
12 changes: 11 additions & 1 deletion tutorials/tigramite_tutorial_basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,16 @@
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/rung_ja/anaconda3/envs/py36/lib/python3.6/site-packages/sklearn/gaussian_process/kernels.py:409: ConvergenceWarning: The optimal value found for dimension 0 of parameter k2__noise_level is close to the specified lower bound 1e-05. Decreasing the bound and calling fit again may find a better value.\n",
" ConvergenceWarning)\n",
"/home/rung_ja/anaconda3/envs/py36/lib/python3.6/site-packages/sklearn/gaussian_process/kernels.py:409: ConvergenceWarning: The optimal value found for dimension 0 of parameter k2__noise_level is close to the specified lower bound 1e-05. Decreasing the bound and calling fit again may find a better value.\n",
" ConvergenceWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
Expand Down Expand Up @@ -994,7 +1004,7 @@
" No conditions of dimension 1 left.\n",
"\n",
" Link ($X^0$ -1) --> $X^2$ (2/2):\n",
" Subset 0: ($X^1$ -2) gives pval = 0.14700 / val = 0.022\n",
" Subset 0: ($X^1$ -2) gives pval = 0.14900 / val = 0.022\n",
" Non-significance detected.\n",
"\n",
" Sorting parents in decreasing order with \n",
Expand Down

0 comments on commit 5f68977

Please sign in to comment.