Kozea / Kozea/pygal

pygal.Line() render_to_file: OverflowError: cannot convert float infinity to integer

Open
#459 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.8k
Forks
419
PR merge metrics
No merged PRs in 30d

Description

I'm still trying to isolate a testcase, but I'm seeing this with a particular dataset:

File "/opt/local/python-3.6.1/lib/python3.6/site-packages/pygal/graph/public.py", line 114, in render_to_file

f.write(self.render(is_unicode=True, **kwargs))
File "/opt/local/python-3.6.1/lib/python3.6/site-packages/pygal/graph/public.py", line 52, in render
self.setup(**kwargs)
File "/opt/local/python-3.6.1/lib/python3.6/site-packages/pygal/graph/base.py", line 217, in setup
self._draw()
File "/opt/local/python-3.6.1/lib/python3.6/site-packages/pygal/graph/graph.py", line 926, in _draw
self._compute_y_labels()
File "/opt/local/python-3.6.1/lib/python3.6/site-packages/pygal/graph/graph.py", line 853, in _compute_y_labels
self.order_min, self.min_scale, self.max_scale
File "/opt/local/python-3.6.1/lib/python3.6/site-packages/pygal/util.py", line 163, in compute_scale
order = round(log10(max(abs(min_), abs(max_)))) - 1
OverflowError: cannot convert float infinity to integer

Contributor guide

Open the contributing guide

Research direction

Start in pygal/graph/graph.py at _compute_y_labels and follow the call to pygal/util.py compute_scale shown in the traceback. First isolate a reproducible testcase from the reported dataset, then run the rendering path and verify that render_to_file completes without the OverflowError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.