question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

params provided as list with parameter of single value

See original GitHub issue

When setting the initial parameters of the system to a single value, i.e. no parameter sweep, the params are provided as a list to the state update and policy functions rather than a dictionary. This isn’t expected correct?

The following error is thrown TypeError: list indices must be integers or slices, not str which is simply solved by accessing the specific parameter after selecting the first list index:

m = {
    'a': [2]
}

...

def policy_function_1(_params, substep, sH, s, **kwargs):
    a = _params[0]['a']
    return {'a': a}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
aclarkDatacommented, Aug 20, 2020

Using the hot_fix, it’s working

0reactions
JEJodestycommented, Aug 20, 2020

Hot fix #183

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python, allowing passing single string and list of string to a ...
Now, I could force the user to enter a list with only one value ( names=['ERRI'] or names=('ERII',) . I would prefer to...
Read more >
10.19. Using Lists as Parameters - Runestone Academy
Functions which take lists as arguments and change them during execution are called modifiers and the changes they make are called side effects....
Read more >
params keyword for parameter arrays - C# reference
The parameter type must be a single-dimensional array. ... A comma-separated list of arguments of the type of the array elements.
Read more >
Parameter types — param v1.12.3 - HoloViz
Selector accepts a list or dictionary of objects , and has a single default (current) value that must be one of those objects....
Read more >
Python Passing a List as an Argument - W3Schools
Passing a List as an Argument. You can send any data types of argument to a function (string, number, list, dictionary etc.), and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found