lordmauve / lordmauve/pgzero

Is `numpy` a necessary dependency?

Open
#270 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
611
Forks
211
PR merge metrics
No merged PRs in 30d

Description

`numpy` is a required dependency but it only appears to be used in one place in the code:
https://github.com/lordmauve/pgzero/blob/38cb6021496bd2f9dae0b37ef3ee6304dee71e2f/pgzero/ptext.py#L348

`numpy` is a rather large package. Is the dependency really necessary? The same could be implemented in pure Python is there is no significant loss of performance as a result, or a minimal C-extension would just do the job (and could eventually be pushed upstream to `pygame` if this is something general for writing games in Python).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pgzero/ptext.py around line 348 and inspect the project’s dependency declarations to determine exactly how numpy is used. Compare the current behavior and performance with a pure-Python alternative, then verify the project remains functional without numpy. Done means the dependency is either removed without unacceptable regression or its necessity is documented with evidence.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
performance, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 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.