Skip to content

Commit

Permalink
Merge branch 'release/0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
wmayner committed Feb 8, 2016
2 parents 40c5303 + ff0360d commit 057467d
Show file tree
Hide file tree
Showing 115 changed files with 9,754 additions and 3,790 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -9,6 +9,7 @@ node_modules
**/*.egg-info
**/*.log
**/*.BACKUP
pyphi/data/hamming_matrices/10.npy

__pyphi_cache__
dist
Expand All @@ -17,5 +18,6 @@ docs/_build
github-docs
.coverage
htmlcov
profiling
results
html
env
21 changes: 15 additions & 6 deletions .travis.yml
@@ -1,7 +1,11 @@
language: python

# Provide a mongod process on port 27017 (default)
services: mongodb
sudo: false

# Setup databases
services:
- mongodb # port 27017 (default)
- redis-server # port 6379 (default)

python:
- "3.4"
Expand All @@ -16,8 +20,8 @@ before_install:
- conda update --yes conda
# The next couple lines fix a crash with multiprocessing on Travis and are
# not specific to using Miniconda
- sudo rm -rf /dev/shm
- sudo ln -s /run/shm /dev/shm
# - sudo rm -rf /dev/shm
# - sudo ln -s /run/shm /dev/shm

# Install packages
install:
Expand All @@ -27,9 +31,14 @@ install:
- pip freeze

# Run tests
script: coverage run --source=pyphi -m py.test
script: coverage run --source=pyphi -m py.test --slow

after_success: coveralls

notifications:
- email: false
email: false
slack:
rooms:
secure: "C6PSvK/FEmyD+S71VVzS29NZpD9CFI/f3UMjc6i08xYHjFNMZUplfHyUqNLNqgVVBsKR1En4B8ryuriEnM8wwZzCVdxjh7HDsx8aNE2z1XG5tkqoRP4ppNfqNaYRoMcSZFW89DfVNbIVDM11wKXL7/YnRCmlJy0p1NtKzlncXCM="
on_success: never
on_failure: always
144 changes: 143 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,148 @@
Changelog
=========

0.8.0
------------------
_2016-02-06_

### API changes
- Mechanisms and purviews are now passed to all functions and methods in node
index form (e.g. `(0, 1, 3)`). Previously, many functions took these
arguments as `Node` objects. Since nodes belong to a specific `Subsystem` it
was possible to pass nodes from one subsystem to another subsystem's methods,
leading to incorrect results.
- `constellation_distance` no longer takes a `subsystem` argument because
concepts in a constellation already reference their subsystems.
- Moved `utils.cut_mechanism_indices` and `utils.mechanism_split_by_cut` to
to `Cut.all_cut_mechanisms` and `Cut.splits_mechanism`, respectively;
moved `utils.cut_mice` to `Mice.damaged_by_cut`.
- `Concept.__eq__`: when comparing concepts for equality, we no longer directly
check equality of their subsystems. Concept equality is now defined as
follows:
- Same φ
- Same mechanism node indices cause/effect purview node indices
- Same mechanism state
- Same cause/effect repertoires
- Same networks
This allows two concepts to be equal when _e.g._ the only difference between
them is that one's subsystem is a superset of the other's subsystem.
- `Concept.__hash__`: the above notion of concept equality is also implemented
for concept hashing, so two concepts that differ only in that way will have
the same hash value.
- Disabled concept caching; removed the `config.CACHE_CONCEPTS` option.

### API Additions
- Added `config.READABLE_REPRS` to control whether `__reprs__` of PyPhi models
default to using pretty string formatting.
- Added a `Constellation` object.
- Added `utils.submatrix` and `utils.relevant_connections` functions.
- Added the `macro.effective_info` function.
- Added the `utils.state_of` function.
- Added the `Subsystem.proper_state` attribute. This is the state of the
subsystem's nodes, rather than the entire network state.
- Added an optional Redis-backed cache for Mice objects. This is enabled with
`config.REDIS_CACHE` and configured with `config.REDIS_CONFIG`.
- Enabled parallel concept evaluation with `config.PARALLEL_CONCEPT_EVALUATION`.

### Fixes
- `Concept.eq_repertoires` no longer fails when the concept has no cause or
effect.
- Fixed the `Subsystem.proper_state` attribute.

### Refactor
- Subsystem Mice and cause/effect repertoire caches; Network purview caches.
Cache logic is now handled by decorators and custom cache objects.
- Block reducibility tests and Mice connection computations.
- Rich object comparisons on phi-objects.

### Documentation
- Updated documentation and examples to reflect node-to-index conversion.


0.7.5
------------------
_2015-11-02_

### API changes
- Subsystem states are now validated rather than network states. Previously,
network states were validated, but in some cases there can be a
globally-impossible network state that is locally possible for a subsystem
(or vice versa) when considering the subsystem's TPM, which is conditioned
on the external nodes (i.e., background conditions). It is now impossible to
create a subsystem in an impossible state (a `StateUnreachableError` is
thrown), and accordingly no 𝚽 values are calculated for such subsystems; this
may change results from older versions, since in some cases the calculated
main complex was in fact in an impossible. This functionality is enabled by
default but can be disabled via the `VALIDATE_SUBSYSTEM_STATES` option.


0.7.4
------------------
_2015-10-12_

### Fixes
- Fixed a caching bug where the subsystem's state was not included in its hash
value, leading to collisions.


0.7.3
------------------
_2015-09-08_

### API changes
- Heavily refactored the `pyphi.json` module and renamed it to `pyphi.jsonify`.


0.7.2
------------------
_2015-07-01_

### API additions
- Added `convert.nodes2state` function.
- Added `constrained_nodes` keyword argument to `validate.state_reachable`.

### API changes
- Concept equality is now more permissive. For two concepts to be considered
equal, they must only have the same φ, the same mechanism and purviews (in
the same state), and the same repertoires.


0.7.1
------------------
_2015-06-30_

### API additions
- Added `purviews`, `past_purviews`, `future_purviews` keyword arguments to
various concept-calculating methods. With these, the purviews that are
considered in the concept calculation can be restricted.

### API changes
- States are now associated with subsystems rather than networks. Functions in
the `compute` module that operate on networks now also take a state.

### Fixes
- Fixed a bug in `compute._constellation_distance_emd` where partitioned
concepts were unable to be moved to the null concept for the EMD calculation.
In some cases, the partitioned system has *greater* ∑φ than the unpartitioned
system; therefore it must be possible for the φ of partitioned-constellation
concepts to be moved to the null concept, not just vice versa.
- Fixed a bug in `compute._constellation_distance_emd` where it was possible to
move concepts around within their own constellation; the distance matrix now
disallows any such intraconstellation paths. This is important because in
some cases paths from a concept in one constellation to a concept the other
can actually be shorter if a detour is taken through a different concept in
the same constellation.
- Fixed a bug in `validate.state_reachable` where network states were
incorrectly validated.
- `macro.emergence` now always returns a macro-network, even when 𝚽 = 0.
- Fixed a bug in `repr(Network)` where the perturbation vector and connectivity
matrix were switched.

### Documentation
- Added example describing “magic cuts” that, counterintuitively, can create
more concepts.
- Updated existing documentation to the new subsystem-state association.


0.7.0
------------------
Expand All @@ -9,7 +151,7 @@ _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
- `convert.conditionally_independent(tpm)` checks if a TPM is conditionally
independent.

### API changes
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
@@ -1 +1 @@
include README.rst LICENSE.md requirements.txt pyphi_config.yml
include README.rst LICENSE.md requirements.txt pyphi_config.yml redis.conf
39 changes: 30 additions & 9 deletions README.rst
@@ -1,18 +1,18 @@
.. image:: https://zenodo.org/badge/4651/wmayner/pyphi.png
:target: http://dx.doi.org/10.5281/zenodo.15787
:alt: Zenodo DOI
:alt: Zenodo DOI badge

.. image:: https://travis-ci.org/wmayner/pyphi.svg?branch=master
:target: https://travis-ci.org/wmayner/pyphi
:alt: Travis build
:alt: Travis build badge

.. image:: https://coveralls.io/repos/wmayner/pyphi/badge.png?branch=master
.. image:: https://coveralls.io/repos/wmayner/pyphi/badge.svg?branch=master&service=github
:target: https://coveralls.io/r/wmayner/pyphi?branch=master
:alt: Coveralls.io
:alt: Coveralls.io badge

*************************
PyPhi: |phi| for Python 3
*************************
***********************
PyPhi: |phi| for Python
***********************

PyPhi is a Python 3 library for computing integrated information (|phi|), and
the associated quantities and objects.
Expand Down Expand Up @@ -62,12 +62,12 @@ Detailed installation guide for Mac OS X
`See here <https://github.com/wmayner/pyphi/blob/develop/INSTALLATION.md>`_.


Optional: caching with a database
Optional: caching with MongoDb
`````````````````````````````````

PyPhi stores the results of |Phi| calculations as they're computed in order to
avoid expensive re-computation. These results can be stored locally on the
filesystem (the default setting), or in a full-fledged database.
filesystem (the default setting), or in a full-fledged database.

Using the default caching system is easier and works out of the box, but using
a database is more robust.
Expand All @@ -87,6 +87,27 @@ You can also check out MongoDB's `Getting Started guide
`manual <http://docs.mongodb.org/manual/>`_.


Optional: caching with Redis
`````````````````````````````

PyPhi can also use Redis as a fast in-memory global LRU cache to store Mice
objects, reducing the memory load on PyPhi processes.

`Install Redis <http://redis.io/download>`_. The `redis.conf` file provided with
PyPhi includes the minimum settings needed to run Redis as an LRU cache:

.. code:: bash
redis-server /path/to/pyphi/redis.conf
Once the server is running you can enable Redis caching by setting
``REDIS_CACHE: true`` in your ``pyphi_config.yml``.

**Note:** PyPhi currently flushes the connected Redis database at the start of
every execution. If you are running Redis for another application be sure PyPhi
connects to its own Redis server.


Contributing
~~~~~~~~~~~~

Expand Down
72 changes: 72 additions & 0 deletions benchmarks/asv.conf.json
@@ -0,0 +1,72 @@
{
// The version of the config file format. Do not change, unless
// you know what you are doing.
"version": 1,

// The name of the project being benchmarked
"project": "PyPhi",

// The project's homepage
"project_url": "https://github.com/wmayner/pyphi",

// The URL or local path of the source code repository for the
// project being benchmarked
"repo": "..",

// List of branches to benchmark. If not provided, defaults to "master"
// (for git) or "tip" (for mercurial).
"branches": ["develop"], // for git

// The DVCS being used. If not set, it will be automatically
// determined from "repo" by looking at the protocol in the URL
// (if remote), or by looking for special directories, such as
// ".git" (if local).
"dvcs": "git",

// The tool to use to create environments. May be "conda",
// "virtualenv" or other value depending on the plugins in use.
// If missing or the empty string, the tool will be automatically
// determined by looking for tools on the PATH environment
// variable.
"environment_type": "virtualenv",

// the base URL to show a commit for the project.
"show_commit_url": "http://github.com/wmayner/pyphi/",

// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
// "pythons": ["2.7", "3.3"],

// The matrix of dependencies to test. Each key is the name of a
// package (in PyPI) and the values are version numbers. An empty
// list indicates to just test against the default (latest)
// version.
// "matrix": {
// "numpy": ["1.6", "1.7"]
// },

// The directory (relative to the current directory) that benchmarks are
// stored in. If not provided, defaults to "benchmarks"
"benchmark_dir": "benchmarks",

// The directory (relative to the current directory) to cache the Python
// environments in. If not provided, defaults to "env"
"env_dir": "env",


// The directory (relative to the current directory) that raw benchmark
// results are stored in. If not provided, defaults to "results".
"results_dir": "results",

// The directory (relative to the current directory) that the html tree
// should be written to. If not provided, defaults to "html".
//"html_dir": "html",

// The number of characters to retain in the commit hashes.
// "hash_length": 8,

// `asv` will cache wheels of the recent builds in each
// environment, making them faster to install next time. This is
// number of builds to keep, per environment.
// "wheel_cache_size": 0
}
Empty file.

0 comments on commit 057467d

Please sign in to comment.