Skip to content

Commit

Permalink
refactor(base_agents): change type checks to isinstance()
Browse files Browse the repository at this point in the history
  • Loading branch information
BjoernLudwigPTB committed May 14, 2024
1 parent 3f25f43 commit f9d3f3b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions agentMET4FOF/agents/base_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,14 +875,16 @@ def get_all_attr(self):
if key not in excludes and type(val).__name__ != "function"
}
filtered_attr = {
key: val
if (
type(val) == float
or type(val) == int
or type(val) == str
or key == "output_channels_info"
key: (
val
if (
isinstance(val, float)
or isinstance(val, int)
or isinstance(val, str)
or key == "output_channels_info"
)
else str(val)
)
else str(val)
for key, val in filtered_attr.items()
}
filtered_attr = {
Expand Down

0 comments on commit f9d3f3b

Please sign in to comment.