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.PRECISIONdynamically did not change
constants.EPSILON, causing some comparisons that relied on
constants.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.
API additions
- Added
pyphi.tpm.reconstitute_tpm().
API changes
- Renamed
pyphi.partition.partition_registryto
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-serializedConcepts.
Config
- Added the
WELCOME_OFFoption to turn off the new welcome message.
Documentation
- Added documentation for the
partition_typesregistry. - 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
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.
API additions
- 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.
API changes
- Specifying the nodes of a
Subsystemis now optional. If not provided, the
subsystem will cover the entire network. - Removed the
labels2indices,indices2labelsandparse_node_indices
methods fromNetwork, and theindices2labelsmethod fromSubsystem. - Renamed
config.load_config_filetoconfig.load_file, and
config.load_config_dicttoconfig.load_dict - Removed backwards-compatible
Directionimport fromconstantsmodule. - Renamed
macro.coarse_graintocoarse_graining. - Exposed
coarse_grain,blackbox,time_scale,network_stateand
micro_node_indicesas attributes ofMacroSubsystem.
Config
- Removed the
LOG_CONFIG_ON_IMPORTconfiguration option.
1.0.0
API changes
Modules
- Renamed:
compute.big_phitocompute.networkcompute.concepttocompute.subsystemmodels.big_phitomodels.subsystemmodels.concepttomodels.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:lolitole(little-endian)holitobe(big-endian)
- Removed
compute.concept(); useSubsystem.concept()instead.
Arguments
- Renamed
connectivity_matrixkeyword argument ofNetwork()tocm
Objects
-
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_causation
modules.
Configuration settings
- Changed configuration settings as necessary to use the new object names.
Constants
- Renamed
Direction.PASTtoDirection.CAUSE - Renamed
Direction.CAUSEtoDirection.EFFECT
API additions
Configuration settings
- 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().
Objects
- Added two new objects,
MaximallyIrreducibleCauseand
MaximallyIrreducibleEffect, that are subclasses of
MaximallyIrreducibleCauseOrEffectwith a fixed direction.
Refactor
- Moved network-level functions in
compute.big_phito
pyphi.compute.network - Moved subsystem-level functions in
compute.big_phiandcompute.conceptto
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:
distributioncachecompute.parallelcomputetop-level modulemoduletop-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_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.
API Additions
- 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.
Refactor
- 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.
Optimizations
- Added an analytic solution for the EMD computation between effect repertoires.
- Improved the time complexity of
directed_bipartition_of_onefrom exponential to linear.
Documentation
- Updated documentation and examples to reflect changes made to the
macroAPI 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 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.
API Additions
- Added
config.READABLE_REPRSto control whether__reprs__of PyPhi models
default to using pretty string formatting. - 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.
Fixes
Concept.eq_repertoiresno longer fails when the concept has no cause or
effect.- Fixed the
Subsystem.proper_stateattribute.
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_distancewhere π 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.macroprovides 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.PRECISIONwhen stored on objects.
Fixes
- Tests for
Subsystem_find_mip_parallelandSubsystem_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_connectionson MICE objects for MICE cache checking. - Only recheck concepts and cut mechanisms after a system cut.
API additions
- 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 theLOG_CONFIG_ON_IMPORToption to
falsein thepyphi_config.ymlfile.
Fixes
- Bipartition function.
- MICE caching.