Talos reporting Lambda memory address - Suggestion
See original GitHub issueCurrently a parameter dictionary with arbitrary Lambdas simply spits out Lambda Object <mem address>
for any reporting. This is perhaps not the nicest way of expressing this.
Perhaps a simple approach would be, if there’s no decent (defined or otherwise) string conversion to reference them as the parameter entry key, and the index.
So "my_param_key": [Lambda x: x**2, Lambda x: x**3]
would then report “my_param_key_0” and “my_param_key_1” in the reporting tables.
I haven’t delved too deep into the Talos codebase to see the feasibility of this. Was just wanting to report this behaviour, as it’s somewhat annoying to the user as they are unsure which lambda was selected.
PS - I’m aware that a richer object could be used to wrap this, which has its own __repr__
method defined. But as far as baked in implementations go, this could be a small tweak to bring more user friendly output.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
I can have a look at it. Not sure when I’d get the time with work ramping up in the New Year. Is there an easy way to contact you? I believe I have my e-mail address on my profile if that works.
I was thinking perhaps use of a dictionary. At the moment we have Lists for discrete selections, and tuples for ranges. Dictionaries seems to me to be the perfect entry.
E.g
Enables a check to see if the params values within List are of type dict, then we can go to assign a special label, otherwise it will use
__repr__
?In addition, this will allow people to use a lot more custom code, and have more flexibility in wrapping things via Lambdas, such as specific argument invokations.