Skip to content

Add missing type annotations #63

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 3 commits into from
May 12, 2023

Conversation

pedrovs16
Copy link

Fixing to issue #50

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.

Thanks for working on this. I've noted a few places where there are function arguments that we can add types for.

@pedrovs16 pedrovs16 force-pushed the add-missing-type-annotations branch 2 times, most recently from cc9a8fc to e4631db Compare April 25, 2023 16:56
@pedrovs16
Copy link
Author

Already add missing types

@pedrovs16 pedrovs16 requested a review from FoamyGuy April 25, 2023 17:15
@pedrovs16
Copy link
Author

@kattni problem with docs and imports?

@kattni
Copy link
Contributor

kattni commented Apr 25, 2023

Thanks @pedrovs16! I requested to be tagged so I can verify the documentation still looks right on RTD with the imports before the initial docstring. I'll look into it following the merge and release.

@tekktrik tekktrik linked an issue Apr 27, 2023 that may be closed by this pull request
9 tasks
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.

Thanks for following up.

I've noted a few more changes after having another look over this.

The rest is looking good to me beyond the things noted.

self, input_pulses, max_pulse=10000, pulse_window=0.10
): # pylint: disable=no-self-use
def _read_pulses_non_blocking( # pylint: disable=no-self-use
self, input_pulses: List, max_pulse: int = 10000, pulse_window: int = 0.10
Copy link
Contributor

Choose a reason for hiding this comment

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

pulse_window looks like float I think instead of int

max_pulse: int = 10000,
blocking: bool = True,
pulse_window: bool = 0.10,
blocking_delay: bool = 0.10,
Copy link
Contributor

Choose a reason for hiding this comment

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

both pulse_window and blocking_delay look like they can be float instead of bool

@@ -341,14 +351,24 @@ class GenericTransmit:
:param bool debug: Enable debug output, default False
"""

def __init__(self, header, one, zero, trail, *, debug=False):
def __init__(
self, header: int, one: int, zero: int, trail: int, *, debug=False
Copy link
Contributor

Choose a reason for hiding this comment

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

debug can be typed as bool

*,
repeat: int = 0,
delay: int = 0,
nbits: int = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

for nbits since the default value is None I think it can be Optional[int]

@pedrovs16 pedrovs16 force-pushed the add-missing-type-annotations branch from 7fa7d72 to 2f4f7e7 Compare May 5, 2023 16:30
@pedrovs16 pedrovs16 requested a review from FoamyGuy May 5, 2023 16:31
@pedrovs16 pedrovs16 force-pushed the add-missing-type-annotations branch from 2f4f7e7 to 42a046e Compare May 5, 2023 16:35
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.

This looks good to me now. Thanks again for working on it @pedrovs16!

I made one commit with a tweak to us float instead of int for delay. It was typed as float in the sphinx docstring already and I confirmed on a device that passing floats is acceptable.

@FoamyGuy FoamyGuy merged commit d92f942 into adafruit:main May 12, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 13, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_IRRemote to 4.1.15 from 4.1.14:
  > Merge pull request adafruit/Adafruit_CircuitPython_IRRemote#63 from pedrovs16/add-missing-type-annotations
  > Update pre-commit hooks

Updating https://github.com/adafruit/Adafruit_CircuitPython_Logging to 5.2.3 from 5.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#50 from FoamyGuy/jquery_fix
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#49 from tyeth/patch-1
  > Update pre-commit hooks
  > Add upload url to release action

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
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.

Missing Type Annotations
3 participants