Пример #1
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import pytest
from itertools import chain

from pyphi import Subsystem
from pyphi.models import Mice, Cut
from pyphi.utils import phi_eq

import example_networks

# Expected results {{{
# ====================

s = example_networks.s()
directions = ('past', 'future')
cuts = (None, Cut((1, 2), (0, )))
subsystem = {
    cut: Subsystem(s.node_indices, s.network, cut=cut)
    for cut in cuts
}

expected_purview_indices = {
    cuts[0]: {
        'past': {
            (1, ): (2, ),
            (2, ): (0, 1),
            (0, 1): (1, 2),
            (0, 1, 2): (0, 1, 2)
        },
Пример #2
0
# -*- coding: utf-8 -*-

import pytest
from itertools import chain

from pyphi import Subsystem
from pyphi.models import Mice, Cut
from pyphi.utils import phi_eq

import example_networks


# Expected results {{{
# ====================

s = example_networks.s()
directions = ('past', 'future')
cuts = (None, Cut((1, 2), (0,)))
subsystem = {
    cut: Subsystem(s.node_indices, s.network, cut=cut)
    for cut in cuts
}

expected_purview_indices = {
    cuts[0]: {
        'past': {
            (1,): (2,),
            (2,): (0, 1),
            (0, 1): (1, 2),
            (0, 1, 2): (0, 1, 2)
        },
Пример #3
0
def s():
    return example_networks.s()
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# test_subsystem_cause_and_effect_repertoire.py

import numpy as np
import pytest

import example_networks
from pyphi import Direction, Subsystem
from pyphi.models import Cut

# Get example networks
standard = example_networks.standard()

# Get example subsystems
standard_subsystem = example_networks.s()
simple_all_off = example_networks.simple_subsys_all_off()
simple_a_just_on = example_networks.simple_subsys_all_a_just_on()


full = tuple(range(standard.size))


# Set up test scenarios
# =====================
# Scenario structure:
# (
#     function to test,
#     subsystem,
#     mechanism,
#     purview,
Пример #5
0
def s():
    return example_networks.s()