cadCAD-org / cadCAD

Design, simulate, validate, and operate within complex systems
https://cadcad.org
MIT License
557 stars 271 forks source link

pass `params` as a dict into policy and state update functions #303

Closed cavaunpeu closed 11 months ago

cavaunpeu commented 2 years ago

In my code, system parameters are passed (as params) into policy and state update functions as a list with a single dictionary item. For example, params might look like:

[
  {
    'a': 1,
    'b': 2,
    ...
  }
]

This feels unintuitive, and necessitates something like params, = params (shorthand for params = params[0]) at the top of each function.

Separately, this issue was discussed here.

This PR may fixes this issue for me, in EXEC_MODE.single_proc mode, version 0.4.28.

Before considering a merge, a discussion should be had about whether this is expected to work across the gamut of execution modes.

danlessa commented 11 months ago

This is solved by PR #315