wmayner / pyphi

A toolbox for integrated information theory.
https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1006343
Other
374 stars 97 forks source link

Improved ExplicitTPM API and method semantics (now with array methods for free) #73

Closed isacdaavid closed 1 year ago

isacdaavid commented 1 year ago

Now that the current state of both branches is reasonably clean, and before (a) introducing xarray as the base array type and (b) before divergence increases, I would like to bring these changes (and conflicts) to the table and possibly merge.

feature/iit-4.0 $  py.test -k 'not test_relations' -W ignore::UserWarning
[...]
104 failed, 579 passed, 37 skipped, 27 deselected, 2 xfailed, 23 errors in 88.10s (0:01:28)
feature/tpm-class $  py.test -k 'not test_relations' -W ignore::UserWarning
[...]
103 failed, 580 passed, 37 skipped, 27 deselected, 2 xfailed, 23 errors in 75.63s (0:01:15)

bfd62c9 includes a workaround for the issue I experienced with parallel evaluation, reproducible using Matteo's example:

import pyphi

k = 4
n = 7

weights = pyphi.network_generator.weights.nearest_neighbor(n,.5,.5)
state = (0,)*n
network = pyphi.network_generator.build_network([pyphi.network_generator.ising.probability]*n,weights,temperature=1/k)
subsystems = [pyphi.Subsystem(network,state,nodes=nodes) for nodes in pyphi.utils.powerset(range(n),nonempty=True)]
sias = [pyphi.new_big_phi.sia(subsystem) for subsystem in subsystems]