Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing a function with 4 args instead of 5 for SUF throws a hard to debug message #258

Closed
danlessa opened this issue Mar 15, 2021 · 1 comment

Comments

@danlessa
Copy link
Member

If a run a simulation with the following definition, I'll get a TypeError: cannot convert dictionary update sequence element #0 to a sequence error, which can be difficult for point what's the problem with the code.

My suggestion is that we throw a different error, like TypeError: State Update Functions must have 5 positional arguments. The provided function has N positional arguments

f = lambda a, b, c, d: ('variable', None)

partial_state_update_blocks = [
    {
        'policies': {
        },
        'variables': {
            'variable': f
        }
    }
]
@danlessa
Copy link
Member Author

Note: ideally this should be handled before the sim starts. Maybe on the Experiment.append_model method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants