Skip to content

Type Annotations #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 2, 2021
Merged

Type Annotations #35

merged 4 commits into from
Oct 2, 2021

Conversation

FlantasticDan
Copy link
Contributor

Implements type annotations as described by #34:

  • adafruit_max7219/max7219.py:67
  • adafruit_max7219/max7219.py:89
  • adafruit_max7219/max7219.py:106
  • adafruit_max7219/max7219.py:114
  • adafruit_max7219/max7219.py:125
  • adafruit_max7219/max7219.py:129
  • adafruit_max7219/matrices.py:29
  • adafruit_max7219/matrices.py:45
  • adafruit_max7219/bcddigits.py:31
  • adafruit_max7219/bcddigits.py:49
  • adafruit_max7219/bcddigits.py:62
  • adafruit_max7219/bcddigits.py:74
  • adafruit_max7219/bcddigits.py:93
  • adafruit_max7219/bcddigits.py:114

As I was going through adding types, I also updated the docstrings to match the function call.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-running mypy on this branch I found one set of arguments missed.

Beyond that, things are looking pretty good to me.
I was able to successfully import from the library on a Feather S2:

from adafruit_max7219 import matrices

But have not performed more in depth testing. I did find one of these chips in my parts bin though so I'll try to get everything wired up to test it in the next few days.

@FoamyGuy
Copy link
Contributor

Thank you for updating the docstrings and fixing the comment that referenced the wrong chip / device!

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me. Tested successfully on:

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Feather RP2040 with rp2040
Board ID:adafruit_feather_rp2040

Thanks again for working on this @FlantasticDan

@FoamyGuy FoamyGuy merged commit 9e55281 into adafruit:main Oct 2, 2021
@FoamyGuy FoamyGuy mentioned this pull request Oct 2, 2021
14 tasks
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 3, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX7219 to 1.4.0 from 1.3.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_MAX7219#35 from FlantasticDan/type-annotations
  > Globally disabled consider-using-f-string pylint check
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_SGP40 to 1.3.1 from 1.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_SGP40#13 from caternuson/iss12_pypi
  > Globally disabled consider-using-f-string pylint check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants