adafruit / adafruit/Adafruit_CircuitPython_LED_Animation

Missing Type Annotations

Aperta
#83 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
documentation Hacktoberfest
Lingua principale
Python
Stelle
62
Fork
46
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

There are missing type annotations for some functions in this library.

The `typing` module does not exist on CircuitPython devices so the import needs to be wrapped in try/except to catch the error for missing import. There is an example of how that is done here:

```python
try:
from typing import List, Tuple
except ImportError:
pass
```

Once imported the typing annotations for the argument type(s), and return type(s) can be added to the function signature. Here is an example of a function that has had this done already:

```python
def wrap_text_to_pixels(
string: str, max_width: int, font=None, indent0: str = "", indent1: str = ""
) -> List[str]:
```
If you are new to Git or Github we have a guide about contributing to our projects here: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

There is also a guide that covers our CI utilities and how to run them locally to ensure they will pass in Github Actions here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code In particular the pages: `Sharing docs on ReadTheDocs` and `Check your code with pre-commit` contain the tools to install and commands to run locally to run the checks.

If you are attempting to resolve this issue and need help, you can post a comment on this issue and tag both @foamyguy and @kattni or reach out to us on Discord: https://adafru.it/discord in the `#circuitpython-dev` channel.

The following locations are reported by mypy to be missing type annotations:

- [ ] adafruit_led_animation/\_\_init\_\_.py:15
- [ ] adafruit_led_animation/color.py:77
- [ ] adafruit_led_animation/animation/\_\_init\_\_.py:42
- [ ] adafruit_led_animation/animation/\_\_init\_\_.py:66
- [ ] adafruit_led_animation/animation/\_\_init\_\_.py:129
- [ ] adafruit_led_animation/animation/\_\_init\_\_.py:152
- [ ] adafruit_led_animation/animation/\_\_init\_\_.py:167
- [ ] adafruit_led_animation/animation/\_\_init\_\_.py:174
- [ ] adafruit_led_animation/animation/\_\_init\_\_.py:189
- [ ] adafruit_led_animation/animation/\_\_init\_\_.py:203
- [ ] adafruit_led_animation/sequence.py:77
- [ ] adafruit_led_animation/sequence.py:131
- [ ] adafruit_led_animation/sequence.py:135
- [ ] adafruit_led_animation/sequence.py:162
- [ ] adafruit_led_animation/sequence.py:188
- [ ] adafruit_led_animation/sequence.py:214
- [ ] adafruit_led_animation/sequence.py:218
- [ ] adafruit_led_animation/sequence.py:291
- [ ] adafruit_led_animation/sequence.py:301
- [ ] adafruit_led_animation/helper.py:107
- [ ] adafruit_led_animation/helper.py:127
- [ ] adafruit_led_animation/helper.py:131
- [ ] adafruit_led_animation/helper.py:147
- [ ] adafruit_led_animation/helper.py:170
- [ ] adafruit_led_animation/helper.py:174
- [ ] adafruit_led_animation/helper.py:198
- [ ] adafruit_led_animation/helper.py:202
- [ ] adafruit_led_animation/helper.py:229
- [ ] adafruit_led_animation/helper.py:255
- [ ] adafruit_led_animation/helper.py:264
- [ ] adafruit_led_animation/helper.py:272
- [ ] adafruit_led_animation/helper.py:281
- [ ] adafruit_led_animation/helper.py:310
- [ ] adafruit_led_animation/group.py:87
- [ ] adafruit_led_animation/group.py:112
- [ ] adafruit_led_animation/group.py:126
- [ ] adafruit_led_animation/group.py:135
- [ ] adafruit_led_animation/group.py:165
- [ ] adafruit_led_animation/group.py:169
- [ ] adafruit_led_animation/animation/sparkle.py:46
- [ ] adafruit_led_animation/animation/sparkle.py:57
- [ ] adafruit_led_animation/animation/rainbow.py:50
- [ ] adafruit_led_animation/animation/rainbow.py:102
- [ ] adafruit_led_animation/animation/grid_rain.py:50
- [ ] adafruit_led_animation/animation/grid_rain.py:86
- [ ] adafruit_led_animation/animation/grid_rain.py:95
- [ ] adafruit_led_animation/animation/grid_rain.py:100
- [ ] adafruit_led_animation/animation/grid_rain.py:113
- [ ] adafruit_led_animation/animation/grid_rain.py:125
- [ ] adafruit_led_animation/animation/comet.py:49
- [ ] adafruit_led_animation/animation/comet.py:84
- [ ] adafruit_led_animation/animation/colorcycle.py:43
- [ ] adafruit_led_animation/animation/chase.py:47
- [ ] adafruit_led_animation/animation/chase.py:78
- [ ] adafruit_led_animation/animation/chase.py:105
- [ ] adafruit_led_animation/animation/chase.py:114
- [ ] adafruit_led_animation/grid.py:71
- [ ] adafruit_led_animation/grid.py:124
- [ ] adafruit_led_animation/grid.py:136
- [ ] adafruit_led_animation/grid.py:156
- [ ] adafruit_led_animation/grid.py:160
- [ ] adafruit_led_animation/grid.py:183
- [ ] adafruit_led_animation/grid.py:187
- [ ] adafruit_led_animation/grid.py:197
- [ ] adafruit_led_animation/grid.py:203
- [ ] adafruit_led_animation/grid.py:213
- [ ] adafruit_led_animation/animation/sparklepulse.py:46
- [ ] adafruit_led_animation/animation/sparklepulse.py:65
- [ ] adafruit_led_animation/animation/solid.py:40
- [ ] adafruit_led_animation/animation/solid.py:43
- [ ] adafruit_led_animation/animation/rainbowsparkle.py:49
- [ ] adafruit_led_animation/animation/rainbowcomet.py:50
- [ ] adafruit_led_animation/animation/rainbowcomet.py:71
- [ ] adafruit_led_animation/animation/rainbowchase.py:47
- [ ] adafruit_led_animation/animation/rainbowchase.py:62

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con le posizioni mypy elencate in adafruit_led_animation/, in particolare __init__.py, color.py, sequence.py, helper.py, group.py, grid.py e i moduli di animazione. Esamina l’esempio wrap_text_to_pixels esistente e il modello di importazione di typing sicuro per CircuitPython, quindi esegui i controlli CI e mypy documentati. Il lavoro è completato quando tutte le annotazioni mancanti elencate sono state aggiunte e i controlli hanno esito positivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
embedded-iot
Tipo di issue
Refactoring
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.