Skip to content

Commit

Permalink
Merge branch 'release/0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
wmayner committed May 11, 2015
2 parents 2772bd9 + 5bb0765 commit 9b55b65
Show file tree
Hide file tree
Showing 38 changed files with 1,471 additions and 450 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@ Changelog
=========


0.7.0
------------------
_2015-05-08_

### API additions
- `pyphi.macro` provides several functions to analyze networks over different
spatial scales.
- `.convert.conditionally_independent(tpm)` checks if a TPM is conditionally
independent.

### API changes
- Φ and φ values are now rounded to `config.PRECISION` when stored on objects.

### Fixes
- Tests for `Subsystem_find_mip_parallel` and `Subsystem_find_mip_sequential`.
- Slow tests for `compute.big_mip`.

### Refactor
- Subsystem cause and effect repertoire caching.

### Documentation
- Added XOR and Macro examples.


0.6.0
------------------
_2015-04-20_
Expand Down
6 changes: 6 additions & 0 deletions docs/api/config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:mod:`config`
=============

.. automodule:: pyphi.config
:members:
:undoc-members:
2 changes: 2 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ PyPhi API documentation, autogenerated from the source code.
.. toctree::
:maxdepth: 2

config
compute
network
subsystem
macro
convert
examples
models
Expand Down
6 changes: 6 additions & 0 deletions docs/api/macro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:mod:`macro`
============

.. automodule:: pyphi.macro
:members:
:undoc-members:
6 changes: 6 additions & 0 deletions docs/api/validate.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:mod:`validate`
===============

.. automodule:: pyphi.validate
:members:
:undoc-members:
33 changes: 31 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@
.. |CD| replace:: :math:`CD`
.. |ABC| replace:: :math:`ABC`
.. |CDE| replace:: :math:`CDE`
.. |n0| replace:: :math:`n_{0}`
.. |n1| replace:: :math:`n_{1}`
.. |n2| replace:: :math:`n_{2}`
.. |n0, n1| replace:: :math:`n_{0}n_{1}`
.. |n0, n2| replace:: :math:`n_{0}n_{2}`
.. |n1, n2| replace:: :math:`n_{1}n_{2}`
.. |n0, n1, n2| replace:: :math:`n_{0}n_{1}n_{2}`
.. |(AB / DE) x ([] / C)| replace:: :math:`\\frac{AB}{DE} \\times \\frac{\left[\\;\\right]}{C}`
.. |(A / CD) x ([] / E)| replace:: :math:`\\frac{A}{CD} \\times \\frac{\left[\\;\\right]}{E}`
.. |([] / C) x (A / D)| replace:: :math:`\\frac{\\left[\\;\\right]}{C} \\times \\frac{A}{D}`
Expand All @@ -146,8 +153,30 @@
.. |PRECISION| replace:: :const:`constants.PRECISION`
.. |EPSILON| replace:: :const:`constants.EPSILON`
.. |CM[i][j] = 1| replace:: :math:`CM_{i,j} = 1`
.. |BigMip| replace:: :class:`pyphi.models.BigMip`
.. |Concept| replace:: :class:`pyphi.models.Concept`
.. |compute| replace:: :mod:`~pyphi.compute`
.. |network| replace:: :mod:`~pyphi.network`
.. |subsystem| replace:: :mod:`~pyphi.subsystem`
.. |macro| replace:: :mod:`~pyphi.macro`
.. |convert| replace:: :mod:`~pyphi.convert`
.. |examples| replace:: :mod:`~pyphi.examples`
.. |node| replace:: :mod:`~pyphi.node`
.. |concept_caching| replace:: :mod:`~pyphi.concept_caching`
.. |memory| replace:: :mod:`~pyphi.memory`
.. |db| replace:: :mod:`~pyphi.db`
.. |utils| replace:: :mod:`~pyphi.utils`
.. |validate| replace:: :mod:`~pyphi.validate`
.. |config| replace:: :mod:`~pyphi.config`
.. |Subsystem| replace:: :class:`~pyphi.subsystem.Subsystem`
.. |Network| replace:: :class:`~pyphi.network.Network`
.. |BigMip| replace:: :class:`~pyphi.models.BigMip`
.. |Concept| replace:: :class:`~pyphi.models.Concept`
.. |Mip| replace:: :class:`~pyphi.models.Mip`
.. |Mice| replace:: :class:`~pyphi.models.Mice`
.. |find_mip| :func:`~pyphi.subsystem.find_mip`
.. |find_mice| :func:`~pyphi.subsystem.find_mice`
.. |loli_index2state| replace:: :class:`~pyphi.convert.loli_index2state`
.. |holi_index2state| replace:: :class:`~pyphi.convert.holi_index2state`
.. |big_phi > 0| replace:: :math:`\\Phi > 0`
"""

# -- Options for Napoleon (docstring format extension) --------------------
Expand Down
32 changes: 16 additions & 16 deletions docs/examples/2014paper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ been all on is 1:
>>> cr[(1, 1, 1)]
1.0

Now the cause information specified by :math:`A = 1` is 1.5:
Now the cause information specified by :math:`A = 1` is :math:`1.5`:

>>> subsystem.cause_info((A,), (B, C, D))
1.5
Expand Down Expand Up @@ -258,7 +258,7 @@ where :math:`B, C,` and :math:`D` were all on:
And so we have less cause information:

>>> subsystem.cause_info((A,), (B, C, D))
0.21428400000000067
0.214284

Figure 4
~~~~~~~~
Expand Down Expand Up @@ -308,14 +308,14 @@ mechanism; they only take a purview):
The Earth Mover's distance between them gives the cause and effect information:

>>> subsystem.cause_info((A,), (A, B, C))
0.33333191666400036
0.333332
>>> subsystem.effect_info((A,), (A, B, C))
0.24999975000000002
0.25

And the minimum of those gives the cause-effect information:

>>> subsystem.cause_effect_info((A,), (A, B, C))
0.24999975000000002
0.25


Figure 5
Expand All @@ -338,7 +338,7 @@ Figure 5
[[ 0. , 0. ],
[ 0. , 0.5]]])
>>> subsystem.cause_info((A,), (A, B, C))
0.9999997500000001
1.0

But because it has no outputs, its effect repertoire no different from the unconstrained effect repertoire, so it has no effect information:

Expand Down Expand Up @@ -370,7 +370,7 @@ selective and it has effect information:
[[ 0., 0.],
[ 0., 1.]]])
>>> subsystem.effect_info((A,), (A, B, C))
0.4999996875
0.5

But because it now has no inputs, its cause repertoire is no different from the
unconstrained effect repertoire, so it has no cause information:
Expand Down Expand Up @@ -408,11 +408,11 @@ These objects contain the :math:`\varphi^{\textrm{MIP}}_{\textrm{cause}}` and
attributes:

>>> mip_c.phi
0.499998999999
0.499999
>>> mip_c.partition
(Part(mechanism=(n0,), purview=()), Part(mechanism=(n1, n2), purview=(n0, n1, n2)))
>>> mip_e.phi
0.24999975000000002
0.25
>>> mip_e.partition
(Part(mechanism=(), purview=(n1,)), Part(mechanism=(n0, n1, n2), purview=(n0, n2)))

Expand Down Expand Up @@ -548,7 +548,7 @@ Conceptual information can be computed using the function named, as you might
expect, :func:`~pyphi.compute.conceptual_information`:

>>> pyphi.compute.conceptual_information(subsystem)
2.1111091388868752
2.111109


Figure 12
Expand All @@ -574,7 +574,7 @@ We can verify that the :math:`\Phi^{\textrm{MIP}}` value and minimal cut are as
shown in the figure:

>>> big_mip.phi
1.916662694926084
1.916663
>>> big_mip.cut
Cut(severed=(0, 1), intact=(2,))

Expand Down Expand Up @@ -649,18 +649,18 @@ into, use :func:`~pyphi.compute.condensed`:
We find that there are 3 complexes: the major complex :math:`ABC` with
:math:`\Phi \approx 1.92`, and the two minor complexes :math:`DE` with
:math:`\Phi \approx 0.028` and :math:`FG` with :math:`\Phi \approx 0.069` (note
that there is typo in the figure; :math:`\FG`'s :math:`\Phi` value should be
:math:`\0.069`).
that there is typo in the figure; :math:`FG`'s :math:`\Phi` value should be
:math:`0.069`).

>>> len(condensed)
3
>>> ABC, DE, FG = condensed
>>> (ABC.subsystem.nodes, ABC.phi)
((n0, n1, n2), 1.916662694926084)
((n0, n1, n2), 1.916663)
>>> (DE.subsystem.nodes, DE.phi)
((n5, n6), 0.06944459259257413)
((n5, n6), 0.069445)
>>> (FG.subsystem.nodes, FG.phi)
((n3, n4), 0.027777936507761905)
((n3, n4), 0.027778)

There are several other functions available for working with complexes; see the
documentation for :func:`~pyphi.compute.subsystems`,
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Now we use :func:`pyphi.compute.big_phi` function to compute the |big_phi| of
our subsystem:

>>> phi = pyphi.compute.big_phi(subsystem)
>>> round(phi, pyphi.config.PRECISION)
2.312495
>>> phi
2.312496

If we want to take a deeper look at the integrated-information-theoretic
properties of our network, we can access all the intermediate quantities and
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/conditional_independence.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Conditional Independence Example
================================
Conditional Independence
========================

* :mod:`pyphi.examples.cond_depend_tpm()`
* :mod:`pyphi.examples.cond_independ_tpm()`
Expand Down
2 changes: 2 additions & 0 deletions docs/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The relevant functions are listed at the beginning of each example.
basic
residue
conditional_independence
xor
macro
2014paper


Expand Down
Loading

0 comments on commit 9b55b65

Please sign in to comment.