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

TypeError: Package infodynamics.measures.continuous.gaussian.ConditionalMutualInfoCalculatorMultiVariateGaussian is not Callable #9

Closed
nickvandewiele opened this issue Sep 28, 2017 · 7 comments

Comments

@nickvandewiele
Copy link

Any idea what I am doing wrong?

I'm running the example shown in the wiki. I installed JPype1 via pip, although the package via the conda-forge channel runs into the same issue.

ubuntu 12.04, python 3.5 run from within a conda env. some more info below.

(idt) vagrant@precise64:/vagrant_data$ python first.py
Adding data with properties: 5 processes, 1000 samples, 5 replications
overwriting existing data

####### analysing target with index 0 from list [0, 1, 2, 3, 4]
Traceback (most recent call last):
  File "first.py", line 17, in <module>
    results = network_analysis.analyse_network(settings=settings, data=data)
  File "/vagrant_data/IDTxl/idtxl/multivariate_te.py", line 163, in analyse_network
    sources[t])
  File "/vagrant_data/IDTxl/idtxl/multivariate_te.py", line 273, in analyse_single_target
    self._initialise(settings, data, sources, target)
  File "/vagrant_data/IDTxl/idtxl/network_inference.py", line 51, in _initialise
    self._cmi_estimator = EstimatorClass(settings)
  File "/vagrant_data/IDTxl/idtxl/estimators_jidt.py", line 1230, in __init__
    super().__init__(CalcClass, settings)
  File "/vagrant_data/IDTxl/idtxl/estimators_jidt.py", line 306, in __init__
    self.calc = CalcClass()
  File "/home/vagrant/anaconda/envs/idt/lib/python3.5/site-packages/jpype/_jpackage.py", line 60, in __call__
    raise TypeError("Package {0} is not Callable".format(self.__name))
TypeError: Package infodynamics.measures.continuous.gaussian.ConditionalMutualInfoCalculatorMultiVariateGaussian is not Callable
(idt) vagrant@precise64:/vagrant_data$ pip freeze
certifi==2016.2.28
cffi==1.10.0
cycler==0.10.0
decorator==4.1.2
h5py==2.7.0
-e git+https://github.com/pwollstadt/IDTxl.git@4ddb995bc5fa15587cbb95d8b876bee26795ea96#egg=idtxl
JPype1==0.6.2
matplotlib==2.0.2
networkx==1.11
numpy==1.13.1
pycparser==2.18
pyparsing==2.2.0
python-dateutil==2.6.1
pytz==2017.2
scipy==0.19.1
six==1.10.0
(idt) vagrant@precise64:/vagrant_data$ conda list
# packages in environment at /home/vagrant/anaconda/envs/idt:
#
certifi                   2016.2.28                py35_0
cffi                      1.10.0                   py35_0
cycler                    0.10.0                   py35_0
dbus                      1.10.20                       0
decorator                 4.1.2                    py35_0
expat                     2.1.0                         0
fontconfig                2.12.1                        3
freetype                  2.5.5                         2
glib                      2.50.2                        1
gst-plugins-base          1.8.0                         0
gstreamer                 1.8.0                         0
h5py                      2.7.0               np113py35_0
hdf5                      1.8.17                        2
icu                       54.1                          0
jpeg                      9b                            0
JPype1                    0.6.2                     <pip>
libffi                    3.2.1                         1
libgcc                    5.2.0                         0
libgfortran               3.0.0                         1
libiconv                  1.14                          0
libpng                    1.6.30                        1
libxcb                    1.12                          1
libxml2                   2.9.4                         0
matplotlib                2.0.2               np113py35_0
mkl                       2017.0.3                      0
networkx                  1.11                     py35_0
numpy                     1.13.1                   py35_0
openssl                   1.0.2l                        0
pcre                      8.39                          1
pip                       9.0.1                    py35_1
pycparser                 2.18                     py35_0
pyparsing                 2.2.0                    py35_0
pyqt                      5.6.0                    py35_2
python                    3.5.4                         0
python-dateutil           2.6.1                    py35_0
pytz                      2017.2                   py35_0
qt                        5.6.2                         5
readline                  6.2                           2
scipy                     0.19.1              np113py35_0
setuptools                36.4.0                   py35_1
sip                       4.18                     py35_0
six                       1.10.0                   py35_0
sqlite                    3.13.0                        0
tk                        8.5.18                        0
wheel                     0.29.0                   py35_0
xz                        5.2.3                         0
zlib                      1.2.11                        0
@jlizier
Copy link
Collaborator

jlizier commented Sep 29, 2017

Hi Nick,

This seems to match a known issue (not formally listed here as an issue) that I haven't addressed yet, being that the jar for the underlying JIDT computation engine was targetted for Java 1.7 but I think you're using an earlier Java version. You can verify this by running:

jsys = JPackage("java.lang").System
print("%s\n" % jsys.getProperty("java.version"))

somewhere in your code.

The targetting of Java 1.7 should have been brought back to 1.6 earlier, but I just haven't gotten to this yet; it depends on a fix coming through from JIDT. We'll get you to retest when that comes through.

Can I also confirm you are running from the master branch?

Thanks,
--joe

@nickvandewiele
Copy link
Author

Thanks for the quick reply! You are right, I was using JDK 6 (default JDK for Ubuntu 12.04).

(idt) vagrant@precise64:~$ java -version
java version "1.6.0_41"
OpenJDK Runtime Environment (IcedTea6 1.13.13) (6b41-1.13.13-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 23.41-b41, mixed mode)

I was indeed using the master branch.

vagrant@precise64:/vagrant_data/IDTxl$ git branch
* master

(idt) vagrant@precise64:/vagrant_data/IDTxl$ git log -1
commit 4ddb995bc5fa15587cbb95d8b876bee26795ea96
Author: pwollstadt <patricia.wollstadt@gmx.de>
Date:   Mon Sep 11 12:34:09 2017 +0200

    Remove unnecessary line from examples

...
Upon upgrading to JDK7 (sudo apt-get install openjdk-7-jdk)

Upon testing again, it seems to go through, but at the end, I get the following:

creating surrogate table with 500 permutations:
        cand.   (3, 1) -- significant


---------------------------- (4) final statistics
[(4, 1), (4, 4), (4, 2), (4, 3), (4, 5), (3, 1)]
no. target sources: 5, no. sources: 1
omnibus test, n_perm: 500
 -- significant

final source samples: [(3, 1)]
final target samples: [(4, 1), (4, 4), (4, 2), (4, 3), (4, 5)]
Traceback (most recent call last):
  File "first.py", line 20, in <module>
    print_res_to_console(data=data, results=results)
TypeError: print_res_to_console() got an unexpected keyword argument 'results'

Should I close this issue, and create a new issue?

@nickvandewiele
Copy link
Author

the last error is because the keyword args used by print_res_to_console, plot_network in first.py should be changed from results to res with 4ddb995. Not a big deal, though. Thanks!

@jlizier
Copy link
Collaborator

jlizier commented Oct 2, 2017 via email

@pwollstadt
Copy link
Owner

Hi Nick,
thanks for pointing that out, I corrected the example script in the wiki.
Best, Patricia

pwollstadt added a commit that referenced this issue Dec 5, 2017
Add JIDT jar-file v1.4, targeting Java 1.6.

Fixes #9.
@Dirivian
Copy link

I get the same error and my Java version is 11

@pwollstadt
Copy link
Owner

Hi @Dirivian, for debugging could you try running example code after a new install in a conda environment (see my answer to #26) and let me know if this works for you? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants