Skip to content

Commit

Permalink
prefer initial state from processes
Browse files Browse the repository at this point in the history
  • Loading branch information
prismofeverything committed Jun 6, 2024
1 parent 48390ff commit 13893c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion process_bigraph/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def __init__(self, config=None, core=None):
raise Exception(
f'initial state from edge does not match initial state from other edges:\n{path}\n{edge}\n{edge_state}')

state = deep_merge(edge_state, state)
state = deep_merge(state, edge_state)

self.state = self.core.deserialize(
self.composition,
Expand Down
1 change: 1 addition & 0 deletions process_bigraph/experiments/growth_division.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def test_grow_divide(core):
core=core)

updates = composite.update({}, 100.0)
assert '0_0_0_0_0' in composite.state['environment']


@pytest.fixture
Expand Down
5 changes: 2 additions & 3 deletions process_bigraph/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def outputs(self):

def initial_state(self):
return {
'inputs': {
'level': 11.0}}
'level': 4.4}


def update(self, state, interval):
Expand Down Expand Up @@ -132,7 +131,7 @@ def test_infer(core):
'value': '11.11'}}, core=core)

assert composite.composition['value']['_type'] == 'float'
assert composite.state['value'] == 11.11
assert composite.state['value'] == 4.4


def test_process_type(core):
Expand Down

0 comments on commit 13893c0

Please sign in to comment.