2019-06-21
- 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.PRECISIONdynamically did not changeconstants.EPSILON, causing some comparisons that relied onconstants.EPSILONto not reflect the new precision. - Changing
config.FS_CACHE_DIRECTORYandconfig.FS_CACHE_VERBOSITYnow causes a newjoblib.Memorycache to be created. Previously, changing these options dynamically had no effect. - Made test suite compatible with stricter usage of
pytestfixtures required by recent versions ofpytest.
- Added
pyphi.tpm.reconstitute_tpm().
- Renamed
pyphi.partition.partition_registrytopyphi.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-serializedConcepts.
- Added the
WELCOME_OFFoption to turn off the new welcome message.
- Added documentation for the
partition_typesregistry. - Added documentation for the filesystem and database caches.
2018-05-30
- 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
tqdmsynchronization. Removed the existingProgressBarimplementation and pinnedtqdmto 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.
- Fixed the connectivity matrix in
examples.disjunction_conjunction.network().
- Added a
NodeLabelsobject for managing the labels of network elements. Most models now carry aNodeLabelsinstance that is used for string formatting. - Added the
cut_node_labelsproperty toSubsystemandMacroSubsystem. - Added
utils.time_annotateddecorator to measure execution speed.
- Specifying the nodes of a
Subsystemis now optional. If not provided, the subsystem will cover the entire network. - Removed the
labels2indices,indices2labelsandparse_node_indicesmethods fromNetwork, and theindices2labelsmethod fromSubsystem. - Renamed
config.load_config_filetoconfig.load_file, andconfig.load_config_dicttoconfig.load_dict - Removed backwards-compatible
Directionimport fromconstantsmodule. - Renamed
macro.coarse_graintocoarse_graining. - Exposed
coarse_grain,blackbox,time_scale,network_stateandmicro_node_indicesas attributes ofMacroSubsystem.
- Removed the
LOG_CONFIG_ON_IMPORTconfiguration option.
2017-12-21
- Renamed:
compute.big_phitocompute.networkcompute.concepttocompute.subsystemmodels.big_phitomodels.subsystemmodels.concepttomodels.mechanism
- 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:lolitole(little-endian)holitobe(big-endian)
- Removed
compute.concept(); useSubsystem.concept()instead.
- Renamed
connectivity_matrixkeyword argument ofNetwork()tocm
-
Renamed
BigMiptoSystemIrreducibilityAnalysis- Renamed the
unpartitioned_constellationattribute toces siais used throughout for attributes, variables, and function names instead ofbig_mip
- Renamed the
-
Renamed
MiptoRepertoireIrreducibilityAnalysis- Renamed the
unpartitioned_repertoireattribute torepertoire riais used throughout for attributes, variables, and function names instead ofmip
- Renamed the
-
Renamed
ConstellationtoCauseEffectStructurecesis used throughout for attributes, variables, and function names instead ofconstellation
-
Renamed
MicetoMaximallyIrreducibleCauseOrEffectmicormieare used throughout for attributes, variables, and function names instead ofmip
-
Similar changes were made to the
actualandmodels.actual_causationmodules.
- Changed configuration settings as necessary to use the new object names.
- Renamed
Direction.PASTtoDirection.CAUSE - Renamed
Direction.FUTUREtoDirection.EFFECT
- Added
CACHE_REPERTOIRESto control whether cause/effect repertoires are cached. Single-node cause/effect repertoires are always cached. - Added
CLEAR_SUBSYSTEM_CACHES_AFTER_COMPUTING_SIAto control whether subsystem caches are cleared after callingcompute.sia().
- Added two new objects,
MaximallyIrreducibleCauseandMaximallyIrreducibleEffect, that are subclasses ofMaximallyIrreducibleCauseOrEffectwith a fixed direction.
- Moved network-level functions in
compute.big_phitopyphi.compute.network - Moved subsystem-level functions in
compute.big_phiandcompute.concepttocompute.subsystem
- 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:
distributioncachecompute.parallelcomputetop-level modulemoduletop-level module
2017-12-21
- Refactored parallel processing support to fix an intermittent deadlock.
2017-12-04
- Many functions have been refactored to different modules; see the "Refactor" section for details.
compute.possible_complexesno longer includes the empty subsystem.- Made
is_cuta property. - Renamed
macro.list_all_partitionsandmacro.list_all_groupingstoall_partitionsandall_groupings. Both are now generators and return nested tuples instead of lists. - Moved
macro.make_mappingtoCoarseGrain.make_mapping. - Moved
macro.make_macro_tpmtoCoarseGrain.macro_tpm. - Added blackbox functionality to
macro.emergence. Blackboxing and coarse- graining are now parametrized with theblackboxandcoarse_grainarguments. - Removed
utils.submatrix. - Made
Network.tpmandNetwork.cmimmutable properties. - Removed the
purviewargument fromSubsystem.expand_repertoire. - Moved
validate.StateUnreachableErrorandmacro.ConditionallyDependentErrorto theexceptionsmodule. - Removed perturbation vector support.
- Changed
tpm.marginalize_outto take a list of indices. - Fixed
macro.effective_infoto use the algorithm from the macro-micro paper. - Replace
constants.DIRECTIONS,constants.PAST, andconstants.FUTUREwith a properEnumclass:constants.Direction. Past and future are now represented byconstants.Direction.PASTandconstants.Direction.FUTURE. - Simplifed logging config to use
config.LOG_STDOUT_LEVEL,config.LOG_FILE_LEVELandconfig.LOG_FILE. - Removed the
locationproperty ofConcept.
- Added
subsystem.evaluate_partition. This returns the φ for a particular partition. - Added
config.MEASUREto choose between EMD, KLD, or L1 for distance computations. - Added
macro.MacroSubsystem. This subclass ofSubsystemis used to performs macro computations. - Added
macro.CoarseGrainto represent coarse-grainings of a system. - Added
macro.Blackboxto represent system blackboxes. - Added
validate.blackboxandvalidate.coarse_grain. - Added
macro.all_coarse_grainsandmacro.all_blackboxesgenerators. - Added
Subsystem.cut_indicesproperty. - Added
Subsystem.cmconnectivity matrix alias. - Added
utils.all_states, a generator over all states of ann-element system. - Added
tpm.is_state_by_statefor testing whether a TPM is in state-by-state format. Networknow takes an optionalnode_labelsargument, allowing nodes to be referenced by a canonical name other than their indices. The nodes of aSubsystemcan now be specified by either their index or their label.- Added
models.normalize_constellationfor deterministically ordering a constellation. - Added a
Makefile. - Added an
exceptionsmodule. - Added
distribution.purviewfor computing the purview of a repertoire. - Added
distribution.repertoire_shape. - Added
config.PARTITION_TYPEto control the ways in which φ-partitions are generated. - Added more functions to the
convertmodule:holi2loliandloli2holiconvert decimal indices between HOLI and LOLI formats.holi2loli_state_by_stateandloli2holi_state_by_stateconvert between HOLI and LOLI formats for state-by-state TPMs.- Added short aliases for some functions:
h2lisholi2lolil2hisloli2holil2sisloli_index2stateh2sisholi_index2states2hisstate2loli_indexs2lisstate2holi_indexh2l_sbsisholi2loli_state_by_statel2h_sbsisloli2holi_state_by_statesbn2sbsisstate_by_node2state_by_statesbs2sbnisstate_by_state2state_by_node
- Added the
Constellation.mechanisms,Constellation.labeled_mechanisms, andConstellation.phisproperties. - Add
BigMip.printmethod with optionalconstellationsargument that allows omitting the constellations.
- Refactored the
utilsmodule into theconnectivity,distance,distribution,partition,timescale, andtpmmodules. - Existing macro coarse-grain logic to use
MacroSubsystemandCoarseGrain. - Improved string representations of PyPhi objects.
- Refactored JSON support. The
jsonifymodule 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.configto be an object. Added validation and callbacks for config options.
- Added an analytic solution for the EMD computation between effect repertoires.
- Improved the time complexity of
directed_bipartition_of_onefrom exponential to linear.
- Updated documentation and examples to reflect changes made to the
macroAPI and usage. - Added documentation pages for new modules.
2016-02-11
- Fixed a bug in
setup.pythat prevented installation.
2016-02-06
- 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 asNodeobjects. Since nodes belong to a specificSubsystemit was possible to pass nodes from one subsystem to another subsystem's methods, leading to incorrect results. constellation_distanceno longer takes asubsystemargument because concepts in a constellation already reference their subsystems.- Moved
utils.cut_mechanism_indicesandutils.mechanism_split_by_cutto toCut.all_cut_mechanismsandCut.splits_mechanism, respectively; movedutils.cut_micetoMice.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_CONCEPTSoption.
- Added
config.REPR_VERBOSITYto control whether__reprs__of PyPhi models use pretty string formatting and control the verbosity of the output. - Added a
Constellationobject. - Added
utils.submatrixandutils.relevant_connectionsfunctions. - Added the
macro.effective_infofunction. - Added the
utils.state_offunction. - Added the
Subsystem.proper_stateattribute. 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_CACHEand configured withconfig.REDIS_CONFIG. - Enabled parallel concept evaluation with
config.PARALLEL_CONCEPT_EVALUATION.
Concept.eq_repertoiresno longer fails when the concept has no cause or effect.- Fixed the
Subsystem.proper_stateattribute.
- 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.
- Updated documentation and examples to reflect node-to-index conversion.
2015-11-02
- 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
StateUnreachableErroris 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 theVALIDATE_SUBSYSTEM_STATESoption.
2015-10-12
- Fixed a caching bug where the subsystem's state was not included in its hash value, leading to collisions.
2015-09-08
- Heavily refactored the
pyphi.jsonmodule and renamed it topyphi.jsonify.
2015-07-01
- Added
convert.nodes2statefunction. - Added
constrained_nodeskeyword argument tovalidate.state_reachable.
- 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.
2015-06-30
- Added
purviews,past_purviews,future_purviewskeyword arguments to various concept-calculating methods. With these, the purviews that are considered in the concept calculation can be restricted.
- States are now associated with subsystems rather than networks. Functions in
the
computemodule that operate on networks now also take a state.
- Fixed a bug in
compute._constellation_distance_emdwhere 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_emdwhere 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_reachablewhere network states were incorrectly validated. macro.emergencenow always returns a macro-network, even when 𝚽 = 0.- Fixed a bug in
repr(Network)where the perturbation vector and connectivity matrix were switched.
- Added example describing “magic cuts” that, counterintuitively, can create more concepts.
- Updated existing documentation to the new subsystem-state association.
2015-05-08
pyphi.macroprovides several functions to analyze networks over different spatial scales.convert.conditionally_independent(tpm)checks if a TPM is conditionally independent.
- Φ and φ values are now rounded to
config.PRECISIONwhen stored on objects.
- Tests for
Subsystem_find_mip_parallelandSubsystem_find_mip_sequential. - Slow tests for
compute.big_mip.
- Subsystem cause and effect repertoire caching.
- Added XOR and Macro examples.
2015-04-20
- Pre-compute and cache possible purviews.
- Compute concept distance over least-common-purview rather than whole system.
- Store
relevant_connectionson MICE objects for MICE cache checking. - Only recheck concepts and cut mechanisms after a system cut.
- The new configuration option
CUT_ONE_APPROXIMATIONgives 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 the
LOG_CONFIG_ON_IMPORToption tofalsein thepyphi_config.ymlfile.
- Bipartition function.
- MICE caching.
2015-03-02
- Concepts are only recomputed if they could have been changed by a cut.
- Cuts are evaluated individually, rather than in bidirectional pairs, which allows for better parallel performance.
- Removed the unused
validate.nodelistfunction.
- The new configuration option
ASSUME_CUTS_CANNOT_CREATE_NEW_CONCEPTSgives an approximation of Φ by only recomputing concepts that exist in the unpartitioned constellation. This is much faster in certain cases. - The methods used in determining whether a cut could effect a concept are
exposed via the
utilsmodule as:utils.cut_mechanism_indicesutils.cut_conceptsutils.uncut_concepts
- Added the
pyphi.Subsystem.connections_relevant_for_conceptmethod. - Added the
pyphi.Subsystem.cut_matrixproperty.
pyphi.compute.main_complexnow returns an emptyBigMipif there are no proper complexes.- No longer using LRU-caches implemented as a circular, doubly-linked list;
this was causing a huge number of recursive calls when pickling a
Subsystemobject (since caches are stored on subsystems since v0.3.6) aspickletraversed the (potentially very large) cache. pyphi.json.make_encodablenow properly handles NumPy numeric types.
2015-02-23
compute.big_mipis faster for reducible networks when executed in parallel; it returns immediately upon finding a reducible cut, rather than evaluating all cuts. NOTE: This introduces a race condition in cases where there is more than one reducible cut; there is no guarantee as to which cut will be found first and returned.compute.complexesprunes out subsystems that contain nodes without either inputs or outputs (any subsystem containing such a node must necessarily have zero Φ).
compute.complexes: returns only irreducible MIPs; see optimizations.compute.big_mip- New race condition with cuts; see optimizations.
- The single-node and null
BigMip's constellations are now empty tuples instead of empty lists andNone, respectively.
models.Concept.eq_repertoiresno longer ensures that the networks of each concept are equal; it only checks if the repertoires are the same.
compute.all_complexesreturns theBigMipof every subsystem in the network's powerset (including reducible ones).compute.possible_main_complexesreturns the subsystems that survived the pruning described above.
- Network tests.
- Network attributes. They're now implemented as properties (with getters and setters) to facilitate changing them properly. It should be possible to use the same network object with different states.
- Network state validation.
utils.phi_eqis used wherever possible instead of direct comparisons toconstants.EPSILON.