Skip to content

Commit

Permalink
remove clean_float which is not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Dec 21, 2023
1 parent 2a7d214 commit 001c9a2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions test/percy/compare-pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@
os.chdir(os.path.dirname(__file__))


def clean_float(numstr):
# round numbers to 3 digits, to remove floating-point differences
return round(float(numstr), 3)


def get_fig(html):
# strip off all the rest of the html and js
fig_str = html[html.index("[{", html.rindex("Plotly.newPlot(")) :]
fig_str = fig_str[: fig_str.index("} ") + 1]
data, layout, config = json.loads(f"[{fig_str}]", parse_float=clean_float)
data, layout, config = json.loads(f"[{fig_str}]")
fig_dict = dict(data=data, layout=layout, config=config)
return json.dumps(fig_dict, indent=2).splitlines(keepends=True)

Expand Down

0 comments on commit 001c9a2

Please sign in to comment.