posit-dev / posit-dev/shinylive
`Example Page`: Pyllusion example app is unable to render due to `Typeerror`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 251
- Forks
- 25
- Avg merge
- 19m
- Merged PRs (30d)
- 2
Description
If you navigate to the PyIllusion Example app, once the app is rendered you will observe a 'float' object cannot be interpreted as an integer
The server logs show this error
File "/lib/python3.10/site-packages/pyllusion/Delboeuf/delboeuf_image.py", line 21, in _delboeuf_image
image = PIL.Image.new("RGB", (width, height), color=background)
File "/lib/python3.10/site-packages/PIL/Image.py", line 2785, in new
return im._new(core.fill(mode, size, color))
TypeError: 'float' object cannot be interpreted as an integer
This error is caused because img.to_image (Line 129) does not convert the float object to Integer before returning.
This can be fixed by adding an explicit type conversion as shown below:
return img.to_image(width=int(width), height=int(height))
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the img.to_image call on line 129 described in the issue and reproduce the PyIllusion example app at the linked PyShiny example page. Verify that the returned image dimensions are integers and that the app renders without the logged TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100