Skip to content

Commit

Permalink
Merge branch 'release/0.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
wmayner committed Dec 4, 2017
2 parents 4098629 + 35d848d commit 74c3a45
Show file tree
Hide file tree
Showing 183 changed files with 14,508 additions and 6,560 deletions.
4 changes: 3 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ branch = True
[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Match pylint syntax
coverage: disable

# Have to re-enable the standard pragma
pragma: no cover

Expand All @@ -18,7 +21,6 @@ exclude_lines =
def print_
def dprint


# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
Expand Down
15 changes: 15 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[flake8]

ignore = F401

exclude =
__pycache__,
__pyphi_cache__,
.cache,
.git,
.coverage,
build,
dist,
docs,
htmlcov,
benchmarks,
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
__pycache__
.cache
.ropeproject
node_modules
.venv
.env
.pythonrc*
.agignore
.projectile
**/*.pyc
**/*.egg-info
**/*.log
**/*.BACKUP
pyphi/data/hamming_matrices/10.npy

__pyphi_cache__
dist
build
profiling
docs/_build
github-docs
.coverage
htmlcov
results
html
env
benchmarks/pyphi_config.yml
profiling/pyphi_config.yml
ignore
.ignore
startup.py
my_requirements.txt
19 changes: 19 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[MASTER]

ignore=
__pycache__,
__pyphi_cache__,
.cache,
.git,
.coverage,
build,
dist,
docs,
htmlcov,
benchmarks,

[MESSAGES CONTROL]

disable=
no-member,
invalid-name
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@ services:

python:
- "3.4"
- "3.5"
- "3.6"

# Setup miniconda
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda3-3.3.0-Linux-x86_64.sh -O miniconda.sh
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/miniconda3/bin:$PATH
# Update conda itself
- 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

# Install packages
install:
- conda install --yes python=$TRAVIS_PYTHON_VERSION pip numpy scipy
- conda create --yes --name=$TRAVIS_PYTHON_VERSION python=$TRAVIS_PYTHON_VERSION numpy scipy
- source activate $TRAVIS_PYTHON_VERSION
- pip install -r requirements.txt
- pip install coveralls
- pip freeze
Expand Down
57 changes: 57 additions & 0 deletions CACHING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Caching
~~~~~~~

PyPhi can optionally store 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.

Caching is configured either in the ``pyphi_config.yml`` file or at runtime by
modifying ``pyphi.config``. See the `configuration documentation
<http://pyphi.readthedocs.io/en/stable/configuration.html>`_ for more
information.


Caching with MongoDb
````````````````````

Using the default caching system is easier and works out of the box, but using
a database is more robust.

To use the database-backed caching system, you must install `MongoDB
<http://www.mongodb.org/>`_. Please see their `installation guide
<http://docs.mongodb.org/manual/installation/>`_ for instructions.

Once you have MongoDB installed, use ``mongod`` to start the MongoDB server.
Make sure the ``mongod`` configuration matches the PyPhi's database
configuration settings in ``pyphi_config.yml`` (see the `configuration section
<https://pythonhosted.org/pyphi/index.html#configuration>`_ of PyPhi's
documentation).

You can also check out MongoDB's `Getting Started guide
<http://docs.mongodb.org/manual/tutorial/getting-started/>`_ or the full
`manual <http://docs.mongodb.org/manual/>`_.


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.


.. |phi| unicode:: U+1D6BD .. mathematical bold capital phi
116 changes: 110 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,110 @@
Changelog
=========

0.9.0
-----
_2017-12-04_

### API changes:
- Many functions have been refactored to different modules; see the "Refactor"
section for details.
- `compute.possible_complexes` no longer includes the empty subsystem.
- Made `is_cut` a property.
- Renamed `macro.list_all_partitions` and `macro.list_all_groupings` to
`all_partitions` and `all_groupings`. Both are now generators and return
nested tuples instead of lists.
- Moved `macro.make_mapping` to `CoarseGrain.make_mapping`.
- Moved `macro.make_macro_tpm` to `CoarseGrain.macro_tpm`.
- Added blackbox functionality to `macro.emergence`. Blackboxing and coarse-
graining are now parametrized with the `blackbox` and `coarse_grain`
arguments.
- Removed `utils.submatrix`.
- Made `Network.tpm` and `Network.cm` immutable properties.
- Removed the `purview` argument from `Subsystem.expand_repertoire`.
- Moved `validate.StateUnreachableError` and `macro.ConditionallyDependentError`
to the `exceptions` module.
- Removed perturbation vector support.
- Changed `tpm.marginalize_out` to take a list of indices.
- Fixed `macro.effective_info` to use the algorithm from the macro-micro paper.
- Replace `constants.DIRECTIONS`, `constants.PAST`, and `constants.FUTURE` with
a proper `Enum` class: `constants.Direction`. Past and future are now
represented by `constants.Direction.PAST` and `constants.Direction.FUTURE`.
- Simplifed logging config to use `config.LOG_STDOUT_LEVEL`,
`config.LOG_FILE_LEVEL` and `config.LOG_FILE`.
- Removed the `location` property of `Concept`.

### API Additions
- Added `subsystem.evaluate_partition`. This returns the φ for a particular
partition.
- Added `config.MEASURE` to choose between EMD, KLD, or L1 for distance
computations.
- Added `macro.MacroSubsystem`. This subclass of `Subsystem` is used to performs
macro computations.
- Added `macro.CoarseGrain` to represent coarse-grainings of a system.
- Added `macro.Blackbox` to represent system blackboxes.
- Added `validate.blackbox` and `validate.coarse_grain`.
- Added `macro.all_coarse_grains` and `macro.all_blackboxes` generators.
- Added `Subsystem.cut_indices` property.
- Added `Subsystem.cm` connectivity matrix alias.
- Added `utils.all_states`, a generator over all states of an `n`-element
system.
- Added `tpm.is_state_by_state` for testing whether a TPM is in state-by-state
format.
- `Network` now takes an optional `node_labels` argument, allowing nodes to be
referenced by a canonical name other than their indices. The nodes of a
`Subsystem` can now be specified by either their index or their label.
- Added `models.normalize_constellation` for deterministically ordering a
constellation.
- Added a `Makefile`.
- Added an `exceptions` module.
- Added `distribution.purview` for computing the purview of a repertoire.
- Added `distribution.repertoire_shape`.
- Added `config.PARTITION_TYPE` to control the ways in which φ-partitions are
generated.
- Added more functions to the `convert` module:
- `holi2loli` and `loli2holi` convert decimal indices between **HOLI** and
**LOLI** formats.
- `holi2loli_state_by_state` and `loli2holi_state_by_state` convert between
**HOLI** and **LOLI** formats for state-by-state TPMs.
- Added short aliases for some functions:
- `h2l` is `holi2loli`
- `l2h` is `loli2holi`
- `l2s` is `loli_index2state`
- `h2s` is `holi_index2state`
- `s2h` is `state2loli_index`
- `s2l` is `state2holi_index`
- `h2l_sbs` is `holi2loli_state_by_state`
- `l2h_sbs` is `loli2holi_state_by_state`
- `sbn2sbs` is `state_by_node2state_by_state`
- `sbs2sbn` is `state_by_state2state_by_node`
- Added the `Constellation.mechanisms`, `Constellation.labeled_mechanisms`, and
`Constellation.phis` properties.
- Add `BigMip.print` method with optional `constellations` argument that allows
omitting the constellations.

### Refactor
- Refactored the `utils` module into the `connectivity`, `distance`,
`distribution`, `partition`, `timescale`, and `tpm` modules.
- Existing macro coarse-grain logic to use `MacroSubsystem` and `CoarseGrain`.
- Improved string representations of PyPhi objects.
- Refactored JSON support. The `jsonify` module now dumps PyPhi models to a
a format which can be loaded to reproduce the full object graph of PyPhi
objects. This causes backwards incompatible changes to the JSON format of
some model representations.
- Refactored `pyphi.config` to be an object. Added validation and callbacks for
config options.

### Optimizations
- Added an analytic solution for the EMD computation between effect
repertoires.
- Improved the time complexity of `directed_bipartition_of_one` from
exponential to linear.

### Documentation
- Updated documentation and examples to reflect changes made to the `macro` API
and usage.
- Added documentation pages for new modules.


0.8.1
------------------
Expand Down Expand Up @@ -41,8 +145,8 @@ _2016-02-06_
- 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 `config.REPR_VERBOSITY` to control whether `__reprs__` of PyPhi models
use pretty string formatting and control the verbosity of the output.
- Added a `Constellation` object.
- Added `utils.submatrix` and `utils.relevant_connections` functions.
- Added the `macro.effective_info` function.
Expand All @@ -68,7 +172,7 @@ _2016-02-06_
- Updated documentation and examples to reflect node-to-index conversion.


0.7.5
0.7.5 [unreleased]
------------------
_2015-11-02_

Expand All @@ -85,7 +189,7 @@ _2015-11-02_
default but can be disabled via the `VALIDATE_SUBSYSTEM_STATES` option.


0.7.4
0.7.4 [unreleased]
------------------
_2015-10-12_

Expand All @@ -94,15 +198,15 @@ _2015-10-12_
value, leading to collisions.


0.7.3
0.7.3 [unreleased]
------------------
_2015-09-08_

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


0.7.2
0.7.2 [unreleased]
------------------
_2015-07-01_

Expand Down
Loading

0 comments on commit 74c3a45

Please sign in to comment.