Skip to content

Commit

Permalink
Started new plot impl
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Oct 13, 2023
1 parent e9d0f54 commit d91c785
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions plot/scripts/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,6 @@
import plotly.graph_objects as go


def remove_empty_keys(d):
"""
Recursively remove empty keys (both keys with empty values
and empty lists/dictionaries).
If a key is empty, it is removed from the dictionary.
If a key is a list/dictionary, it is recursively processed.
"""
result = d
for k in list(result.keys()):
if isinstance(result[k], dict):
result[k] = remove_empty_keys(result[k])
if not len(result[k]):
result.pop(k)
elif isinstance(result[k], list):
if not len(result[k]):
result.pop(k)
else:
if not result[k]:
result.pop(k)
return result


def is_valid_file(parser, arg):
"""
Check if the provided file path exists.
Expand Down Expand Up @@ -82,8 +60,6 @@ def process_trace(trace):
if k not in accepted:
trace.pop(k)

trace = remove_empty_keys(trace)

return map_trace_type_to_plotly_object(trace_type)(trace)


Expand Down

0 comments on commit d91c785

Please sign in to comment.