Releases: wmayner/pyphi
Releases · wmayner/pyphi
1.2.0
Fixes
- Fixed a bug introduced into
pyphi.utils.load_data()
by a breaking change
in recent versions of NumPy that caused an error on import. - Fixed a bug where changing
config.PRECISION
dynamically did not change
constants.EPSILON
, causing some comparisons that relied on
constants.EPSILON
to not reflect the new precision. - Changing
config.FS_CACHE_DIRECTORY
andconfig.FS_CACHE_VERBOSITY
now
causes a newjoblib.Memory
cache to be created. Previously, changing these
options dynamically had no effect. - Made test suite compatible with stricter usage of
pytest
fixtures
required by recent versions ofpytest
.
API additions
- Added
pyphi.tpm.reconstitute_tpm()
.
API changes
- Renamed
pyphi.partition.partition_registry
to
pyphi.partition.partition_types
. - Renamed
pyphi.distance.bld()
topyphi.distance.klm()
. - Fixed the connectivity matrix of the
disjunction_conjunction_network()
. - Removed
'expanded_*_reperotire'
attributes of JSON-serializedConcept
s.
Config
- Added the
WELCOME_OFF
option to turn off the new welcome message.
Documentation
- Added documentation for the
partition_types
registry. - Added documentation for the filesystem and database caches.
1.1.0
Fixes
- Fixed a memory leaked when concepts returned by parallel CES computations
were returned with distinct subsystem objects. Now all objects in a CES
share the same subsystem reference. - Fixed a race condition caused by newly introduced
tqdm
synchronization.
Removed the existingProgressBar
implementation and pinnedtqdm
to
version >= 4.20.0. - Made model hashes deterministic (6b59061). This fixes an issue with the
Redis MICE cache in which cached values were not shared between processes
and program invokations.
API additions
- Added a
NodeLabels
object for managing the labels of network elements.
Most models now carry aNodeLabels
instance that is used for string
formatting. - Added the
cut_node_labels
property toSubsystem
andMacroSubsystem
. - Added
utils.time_annotated
decorator to measure execution speed.
API changes
- Specifying the nodes of a
Subsystem
is now optional. If not provided, the
subsystem will cover the entire network. - Removed the
labels2indices
,indices2labels
andparse_node_indices
methods fromNetwork
, and theindices2labels
method fromSubsystem
. - Renamed
config.load_config_file
toconfig.load_file
, and
config.load_config_dict
toconfig.load_dict
- Removed backwards-compatible
Direction
import fromconstants
module. - Renamed
macro.coarse_grain
tocoarse_graining
. - Exposed
coarse_grain
,blackbox
,time_scale
,network_state
and
micro_node_indices
as attributes ofMacroSubsystem
.
Config
- Removed the
LOG_CONFIG_ON_IMPORT
configuration option.
1.0.0
API changes
Modules
- Renamed:
compute.big_phi
tocompute.network
compute.concept
tocompute.subsystem
models.big_phi
tomodels.subsystem
models.concept
tomodels.mechanism
Functions
- Renamed:
compute.main_complex()
tocompute.major_complex()
compute.big_mip()
tocompute.sia()
compute.big_phi()
tocompute.phi()
compute.constellation()
tocompute.ces()
compute.conceptual_information()
tocompute.conceptual_info()
subsystem.core_cause()
tosubsystem.mic()
subsystem.core_effect()
tosubsystem.mie()
subsystem.mip_past()
tosubsystem.cause_mip()
subsystem.phi_mip_past()
tosubsystem.phi_cause_mip()
subsystem.phi_mip_future()
tosubsystem.phi_effect_mip()
distance.small_phi_measure()
todistance.repertoire_distance()
distance.big_phi_measure()
todistance.system_repertoire_distance()
- For all functions in
convert
:loli
tole
(little-endian)holi
tobe
(big-endian)
- Removed
compute.concept()
; useSubsystem.concept()
instead.
Arguments
- Renamed
connectivity_matrix
keyword argument ofNetwork()
tocm
Objects
-
Renamed
BigMip
toSystemIrreducibilityAnalysis
- Renamed the
unpartitioned_constellation
attribute toces
sia
is used throughout for attributes, variables, and function names
instead ofbig_mip
- Renamed the
-
Renamed
Mip
toRepertoireIrreducibilityAnalysis
- Renamed the
unpartitioned_repertoire
attribute torepertoire
ria
is used throughout for attributes, variables, and function names
instead ofmip
- Renamed the
-
Renamed
Constellation
toCauseEffectStructure
ces
is used throughout for attributes, variables, and function names
instead ofconstellation
-
Renamed
Mice
toMaximallyIrreducibleCauseOrEffect
mic
ormie
are used throughout for attributes, variables, and function
names instead ofmip
-
Similar changes were made to the
actual
andmodels.actual_causation
modules.
Configuration settings
- Changed configuration settings as necessary to use the new object names.
Constants
- Renamed
Direction.PAST
toDirection.CAUSE
- Renamed
Direction.CAUSE
toDirection.EFFECT
API additions
Configuration settings
- Added
CACHE_REPERTOIRES
to control whether cause/effect repertoires are
cached. Single-node cause/effect repertoires are always cached. - Added
CLEAR_SUBSYSTEM_CACHES_AFTER_COMPUTING_SIA
to control whether
subsystem caches are cleared after callingcompute.sia()
.
Objects
- Added two new objects,
MaximallyIrreducibleCause
and
MaximallyIrreducibleEffect
, that are subclasses of
MaximallyIrreducibleCauseOrEffect
with a fixed direction.
Refactor
- Moved network-level functions in
compute.big_phi
to
pyphi.compute.network
- Moved subsystem-level functions in
compute.big_phi
andcompute.concept
to
compute.subsystem
Documentation
- Added a description of TPM representations.
- Improved the explanation of conditional independence and updated the example
to reflect that PyPhi now raises an error if a conditionally-dependent TPM is
provided. - Added detailed installation instructions.
- Little-endian and big-endian replace LOLI and HOLI terminology
- Added documentation for the following modules:
distribution
cache
compute.parallel
compute
top-level modulemodule
top-level module
0.9.1
0.9.0
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
andmacro.list_all_groupings
toall_partitions
andall_groupings
. Both are now generators and return nested tuples instead of lists. - Moved
macro.make_mapping
toCoarseGrain.make_mapping
. - Moved
macro.make_macro_tpm
toCoarseGrain.macro_tpm
. - Added blackbox functionality to
macro.emergence
. Blackboxing and coarse- graining are now parametrized with theblackbox
andcoarse_grain
arguments. - Removed
utils.submatrix
. - Made
Network.tpm
andNetwork.cm
immutable properties. - Removed the
purview
argument fromSubsystem.expand_repertoire
. - Moved
validate.StateUnreachableError
andmacro.ConditionallyDependentError
to theexceptions
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
, andconstants.FUTURE
with a properEnum
class:constants.Direction
. Past and future are now represented byconstants.Direction.PAST
andconstants.Direction.FUTURE
. - Simplifed logging config to use
config.LOG_STDOUT_LEVEL
,config.LOG_FILE_LEVEL
andconfig.LOG_FILE
. - Removed the
location
property ofConcept
.
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 ofSubsystem
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
andvalidate.coarse_grain
. - Added
macro.all_coarse_grains
andmacro.all_blackboxes
generators. - Added
Subsystem.cut_indices
property. - Added
Subsystem.cm
connectivity matrix alias. - Added
utils.all_states
, a generator over all states of ann
-element system. - Added
tpm.is_state_by_state
for testing whether a TPM is in state-by-state format. Network
now takes an optionalnode_labels
argument, allowing nodes to be referenced by a canonical name other than their indices. The nodes of aSubsystem
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
andloli2holi
convert decimal indices between HOLI and LOLI formats.holi2loli_state_by_state
andloli2holi_state_by_state
convert between HOLI and LOLI formats for state-by-state TPMs.- Added short aliases for some functions:
h2l
isholi2loli
l2h
isloli2holi
l2s
isloli_index2state
h2s
isholi_index2state
s2h
isstate2loli_index
s2l
isstate2holi_index
h2l_sbs
isholi2loli_state_by_state
l2h_sbs
isloli2holi_state_by_state
sbn2sbs
isstate_by_node2state_by_state
sbs2sbn
isstate_by_state2state_by_node
- Added the
Constellation.mechanisms
,Constellation.labeled_mechanisms
, andConstellation.phis
properties. - Add
BigMip.print
method with optionalconstellations
argument that allows omitting the constellations.
Refactor
- Refactored the
utils
module into theconnectivity
,distance
,distribution
,partition
,timescale
, andtpm
modules. - Existing macro coarse-grain logic to use
MacroSubsystem
andCoarseGrain
. - 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
0.8.0
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 asNode
objects. Since nodes belong to a specificSubsystem
it
was possible to pass nodes from one subsystem to another subsystem's methods,
leading to incorrect results. constellation_distance
no longer takes asubsystem
argument because
concepts in a constellation already reference their subsystems.- Moved
utils.cut_mechanism_indices
andutils.mechanism_split_by_cut
to
toCut.all_cut_mechanisms
andCut.splits_mechanism
, respectively;
movedutils.cut_mice
toMice.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
andutils.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 withconfig.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.1
Fixes
- Fixed a bug in
compute.constellation_distance
where 𝛗 from partitioned concepts was not allowed to move to the null concepts; it was assumed that the unpartitioned constellation would always have greater 𝚺𝛗. In some cases, the partitioned system will actually have greater 𝚺𝛗 than the unpartitioned constellation, in which case some of that 𝛗 needs to move to the null concept during the EMD calculation. This fix changes the distance matrix so that can happen.
0.7.0
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
andSubsystem_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
Optimizations
- Pre-compute and cache possible purviews.
- Compute concept distance over least-common-purview rather than whole system.
- Store
relevant_connections
on MICE objects for MICE cache checking. - Only recheck concepts and cut mechanisms after a system cut.
API additions
- The new configuration option
CUT_ONE_APPROXIMATION
gives an approximation
of 𝚽 by only considering cuts that cut off a single node. - Formerly, the configuration was always printed when PyPhi was imported. Now
this can be suppressed by setting theLOG_CONFIG_ON_IMPORT
option to
false
in thepyphi_config.yml
file.
Fixes
- Bipartition function.
- MICE caching.