> For the complete documentation index, see [llms.txt](https://token-engineering-balancer.gitbook.io/balancer-simulations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://token-engineering-balancer.gitbook.io/balancer-simulations/additional-code-and-instructions/balancer-the-python-edition/partial_state_update_blocks.py.md).

# partial\_state\_update\_blocks.py

This model has 1 substep, where the result of action decoding will signal several state updates

The blocks are generated from the action json, because we need to calculate the length of the simlation (`steps_number`)

```
def generate_partial_state_update_blocks(path_to_action_json: str) -> dict:
    steps_number = ActionDecoder.load_actions(path_to_action_json)
    return {
        'partial_state_update_blocks': [
            {
                # system_policies.py
                'policies': {
                    'user_action': ActionDecoder.p_action_decoder,
                },
                'variables': {
                    'pool': s_update_pool,
                    'change_datetime': s_update_change_datetime,
                    'token_prices': s_update_external_price_feeds,
                    'action_type': s_update_action_type,
                    'spot_prices': s_update_spot_prices,
                }
            },

        ],
        'steps_number': steps_number,
    }
```
