Skip to content
Snippets Groups Projects
Commit 19f7803f authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Do not write values set to None

parent aa1983b2
No related branches found
No related tags found
1 merge request!185Do not write values set to None
Pipeline #89635 passed
...@@ -58,9 +58,18 @@ def sfg_to_python( ...@@ -58,9 +58,18 @@ def sfg_to_python(
else f'"{getattr(comp, attr)}"' else f'"{getattr(comp, attr)}"'
for attr in params_filtered for attr in params_filtered
} }
params = {k: v for k, v in params.items() if v}
if params.get("latency_offsets", None) is not None:
params["latency_offsets"] = {
k: v
for k, v in params["latency_offsets"].items()
if v is not None
}
if not params["latency_offsets"]:
del params["latency_offsets"]
return ", ".join( return ", ".join(
[f"{param[0]}={param[1]}" for param in params.items()] [f"{param}={value}" for param, value in params.items()]
) )
# No need to redefined I/Os # No need to redefined I/Os
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment