Skip to content

Commit 74c3a45

Browse files
committed
Merge branch 'release/0.9.0'
2 parents 4098629 + 35d848d commit 74c3a45

183 files changed

Lines changed: 14508 additions & 6560 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ branch = True
66
[report]
77
# Regexes for lines to exclude from consideration
88
exclude_lines =
9+
# Match pylint syntax
10+
coverage: disable
11+
912
# Have to re-enable the standard pragma
1013
pragma: no cover
1114

@@ -18,7 +21,6 @@ exclude_lines =
1821
def print_
1922
def dprint
2023

21-
2224
# Don't complain if tests don't hit defensive assertion code:
2325
raise AssertionError
2426
raise NotImplementedError

.flake8

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[flake8]
2+
3+
ignore = F401
4+
5+
exclude =
6+
__pycache__,
7+
__pyphi_cache__,
8+
.cache,
9+
.git,
10+
.coverage,
11+
build,
12+
dist,
13+
docs,
14+
htmlcov,
15+
benchmarks,

.gitignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
__pycache__
2+
.cache
23
.ropeproject
3-
node_modules
44
.venv
55
.env
66
.pythonrc*
77
.agignore
8+
.projectile
89
**/*.pyc
910
**/*.egg-info
1011
**/*.log
1112
**/*.BACKUP
1213
pyphi/data/hamming_matrices/10.npy
13-
1414
__pyphi_cache__
1515
dist
1616
build
17+
profiling
1718
docs/_build
18-
github-docs
1919
.coverage
2020
htmlcov
2121
results
2222
html
2323
env
24+
benchmarks/pyphi_config.yml
25+
profiling/pyphi_config.yml
26+
ignore
27+
.ignore
28+
startup.py
29+
my_requirements.txt

.pylintrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[MASTER]
2+
3+
ignore=
4+
__pycache__,
5+
__pyphi_cache__,
6+
.cache,
7+
.git,
8+
.coverage,
9+
build,
10+
dist,
11+
docs,
12+
htmlcov,
13+
benchmarks,
14+
15+
[MESSAGES CONTROL]
16+
17+
disable=
18+
no-member,
19+
invalid-name

.travis.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,22 @@ services:
1414

1515
python:
1616
- "3.4"
17+
- "3.5"
18+
- "3.6"
1719

1820
# Setup miniconda
1921
before_install:
20-
- wget http://repo.continuum.io/miniconda/Miniconda3-3.3.0-Linux-x86_64.sh -O miniconda.sh
22+
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
2123
- chmod +x miniconda.sh
2224
- ./miniconda.sh -b
2325
- export PATH=/home/travis/miniconda3/bin:$PATH
2426
# Update conda itself
2527
- conda update --yes conda
26-
# The next couple lines fix a crash with multiprocessing on Travis and are
27-
# not specific to using Miniconda
28-
# - sudo rm -rf /dev/shm
29-
# - sudo ln -s /run/shm /dev/shm
3028

3129
# Install packages
3230
install:
33-
- conda install --yes python=$TRAVIS_PYTHON_VERSION pip numpy scipy
31+
- conda create --yes --name=$TRAVIS_PYTHON_VERSION python=$TRAVIS_PYTHON_VERSION numpy scipy
32+
- source activate $TRAVIS_PYTHON_VERSION
3433
- pip install -r requirements.txt
3534
- pip install coveralls
3635
- pip freeze

CACHING.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Caching
2+
~~~~~~~
3+
4+
PyPhi can optionally store the results of |Phi| calculations as they're
5+
computed in order to avoid expensive re-computation. These results can be
6+
stored locally on the filesystem (the default setting), or in a full-fledged
7+
database.
8+
9+
Caching is configured either in the ``pyphi_config.yml`` file or at runtime by
10+
modifying ``pyphi.config``. See the `configuration documentation
11+
<http://pyphi.readthedocs.io/en/stable/configuration.html>`_ for more
12+
information.
13+
14+
15+
Caching with MongoDb
16+
````````````````````
17+
18+
Using the default caching system is easier and works out of the box, but using
19+
a database is more robust.
20+
21+
To use the database-backed caching system, you must install `MongoDB
22+
<http://www.mongodb.org/>`_. Please see their `installation guide
23+
<http://docs.mongodb.org/manual/installation/>`_ for instructions.
24+
25+
Once you have MongoDB installed, use ``mongod`` to start the MongoDB server.
26+
Make sure the ``mongod`` configuration matches the PyPhi's database
27+
configuration settings in ``pyphi_config.yml`` (see the `configuration section
28+
<https://pythonhosted.org/pyphi/index.html#configuration>`_ of PyPhi's
29+
documentation).
30+
31+
You can also check out MongoDB's `Getting Started guide
32+
<http://docs.mongodb.org/manual/tutorial/getting-started/>`_ or the full
33+
`manual <http://docs.mongodb.org/manual/>`_.
34+
35+
36+
Caching with Redis
37+
``````````````````
38+
39+
PyPhi can also use Redis as a fast in-memory global LRU cache to store Mice
40+
objects, reducing the memory load on PyPhi processes.
41+
42+
`Install Redis <http://redis.io/download>`_. The `redis.conf` file provided
43+
with PyPhi includes the minimum settings needed to run Redis as an LRU cache:
44+
45+
.. code:: bash
46+
47+
redis-server /path/to/pyphi/redis.conf
48+
49+
Once the server is running you can enable Redis caching by setting
50+
``REDIS_CACHE: true`` in your ``pyphi_config.yml``.
51+
52+
**Note:** PyPhi currently flushes the connected Redis database at the start of
53+
every execution. If you are running Redis for another application be sure PyPhi
54+
connects to its own Redis server.
55+
56+
57+
.. |phi| unicode:: U+1D6BD .. mathematical bold capital phi

CHANGELOG.md

Lines changed: 110 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,110 @@
11
Changelog
22
=========
33

4+
0.9.0
5+
-----
6+
_2017-12-04_
7+
8+
### API changes:
9+
- Many functions have been refactored to different modules; see the "Refactor"
10+
section for details.
11+
- `compute.possible_complexes` no longer includes the empty subsystem.
12+
- Made `is_cut` a property.
13+
- Renamed `macro.list_all_partitions` and `macro.list_all_groupings` to
14+
`all_partitions` and `all_groupings`. Both are now generators and return
15+
nested tuples instead of lists.
16+
- Moved `macro.make_mapping` to `CoarseGrain.make_mapping`.
17+
- Moved `macro.make_macro_tpm` to `CoarseGrain.macro_tpm`.
18+
- Added blackbox functionality to `macro.emergence`. Blackboxing and coarse-
19+
graining are now parametrized with the `blackbox` and `coarse_grain`
20+
arguments.
21+
- Removed `utils.submatrix`.
22+
- Made `Network.tpm` and `Network.cm` immutable properties.
23+
- Removed the `purview` argument from `Subsystem.expand_repertoire`.
24+
- Moved `validate.StateUnreachableError` and `macro.ConditionallyDependentError`
25+
to the `exceptions` module.
26+
- Removed perturbation vector support.
27+
- Changed `tpm.marginalize_out` to take a list of indices.
28+
- Fixed `macro.effective_info` to use the algorithm from the macro-micro paper.
29+
- Replace `constants.DIRECTIONS`, `constants.PAST`, and `constants.FUTURE` with
30+
a proper `Enum` class: `constants.Direction`. Past and future are now
31+
represented by `constants.Direction.PAST` and `constants.Direction.FUTURE`.
32+
- Simplifed logging config to use `config.LOG_STDOUT_LEVEL`,
33+
`config.LOG_FILE_LEVEL` and `config.LOG_FILE`.
34+
- Removed the `location` property of `Concept`.
35+
36+
### API Additions
37+
- Added `subsystem.evaluate_partition`. This returns the φ for a particular
38+
partition.
39+
- Added `config.MEASURE` to choose between EMD, KLD, or L1 for distance
40+
computations.
41+
- Added `macro.MacroSubsystem`. This subclass of `Subsystem` is used to performs
42+
macro computations.
43+
- Added `macro.CoarseGrain` to represent coarse-grainings of a system.
44+
- Added `macro.Blackbox` to represent system blackboxes.
45+
- Added `validate.blackbox` and `validate.coarse_grain`.
46+
- Added `macro.all_coarse_grains` and `macro.all_blackboxes` generators.
47+
- Added `Subsystem.cut_indices` property.
48+
- Added `Subsystem.cm` connectivity matrix alias.
49+
- Added `utils.all_states`, a generator over all states of an `n`-element
50+
system.
51+
- Added `tpm.is_state_by_state` for testing whether a TPM is in state-by-state
52+
format.
53+
- `Network` now takes an optional `node_labels` argument, allowing nodes to be
54+
referenced by a canonical name other than their indices. The nodes of a
55+
`Subsystem` can now be specified by either their index or their label.
56+
- Added `models.normalize_constellation` for deterministically ordering a
57+
constellation.
58+
- Added a `Makefile`.
59+
- Added an `exceptions` module.
60+
- Added `distribution.purview` for computing the purview of a repertoire.
61+
- Added `distribution.repertoire_shape`.
62+
- Added `config.PARTITION_TYPE` to control the ways in which φ-partitions are
63+
generated.
64+
- Added more functions to the `convert` module:
65+
- `holi2loli` and `loli2holi` convert decimal indices between **HOLI** and
66+
**LOLI** formats.
67+
- `holi2loli_state_by_state` and `loli2holi_state_by_state` convert between
68+
**HOLI** and **LOLI** formats for state-by-state TPMs.
69+
- Added short aliases for some functions:
70+
- `h2l` is `holi2loli`
71+
- `l2h` is `loli2holi`
72+
- `l2s` is `loli_index2state`
73+
- `h2s` is `holi_index2state`
74+
- `s2h` is `state2loli_index`
75+
- `s2l` is `state2holi_index`
76+
- `h2l_sbs` is `holi2loli_state_by_state`
77+
- `l2h_sbs` is `loli2holi_state_by_state`
78+
- `sbn2sbs` is `state_by_node2state_by_state`
79+
- `sbs2sbn` is `state_by_state2state_by_node`
80+
- Added the `Constellation.mechanisms`, `Constellation.labeled_mechanisms`, and
81+
`Constellation.phis` properties.
82+
- Add `BigMip.print` method with optional `constellations` argument that allows
83+
omitting the constellations.
84+
85+
### Refactor
86+
- Refactored the `utils` module into the `connectivity`, `distance`,
87+
`distribution`, `partition`, `timescale`, and `tpm` modules.
88+
- Existing macro coarse-grain logic to use `MacroSubsystem` and `CoarseGrain`.
89+
- Improved string representations of PyPhi objects.
90+
- Refactored JSON support. The `jsonify` module now dumps PyPhi models to a
91+
a format which can be loaded to reproduce the full object graph of PyPhi
92+
objects. This causes backwards incompatible changes to the JSON format of
93+
some model representations.
94+
- Refactored `pyphi.config` to be an object. Added validation and callbacks for
95+
config options.
96+
97+
### Optimizations
98+
- Added an analytic solution for the EMD computation between effect
99+
repertoires.
100+
- Improved the time complexity of `directed_bipartition_of_one` from
101+
exponential to linear.
102+
103+
### Documentation
104+
- Updated documentation and examples to reflect changes made to the `macro` API
105+
and usage.
106+
- Added documentation pages for new modules.
107+
4108

5109
0.8.1
6110
------------------
@@ -41,8 +145,8 @@ _2016-02-06_
41145
- Disabled concept caching; removed the `config.CACHE_CONCEPTS` option.
42146

43147
### API Additions
44-
- Added `config.READABLE_REPRS` to control whether `__reprs__` of PyPhi models
45-
default to using pretty string formatting.
148+
- Added `config.REPR_VERBOSITY` to control whether `__reprs__` of PyPhi models
149+
use pretty string formatting and control the verbosity of the output.
46150
- Added a `Constellation` object.
47151
- Added `utils.submatrix` and `utils.relevant_connections` functions.
48152
- Added the `macro.effective_info` function.
@@ -68,7 +172,7 @@ _2016-02-06_
68172
- Updated documentation and examples to reflect node-to-index conversion.
69173

70174

71-
0.7.5
175+
0.7.5 [unreleased]
72176
------------------
73177
_2015-11-02_
74178

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

87191

88-
0.7.4
192+
0.7.4 [unreleased]
89193
------------------
90194
_2015-10-12_
91195

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

96200

97-
0.7.3
201+
0.7.3 [unreleased]
98202
------------------
99203
_2015-09-08_
100204

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

104208

105-
0.7.2
209+
0.7.2 [unreleased]
106210
------------------
107211
_2015-07-01_
108212

0 commit comments

Comments
 (0)