From 97d91b597adf9dac52ac759588de8283d356d2f1 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 27 Feb 2018 21:24:54 -0600 Subject: [PATCH 01/11] renamed simple example; no learn guides are affected --- examples/{simple.py => is31fl3731_simpletest.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{simple.py => is31fl3731_simpletest.py} (100%) diff --git a/examples/simple.py b/examples/is31fl3731_simpletest.py similarity index 100% rename from examples/simple.py rename to examples/is31fl3731_simpletest.py From 8d1632f7e30c40d0961b67f632bfce4440015f88 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 27 Feb 2018 21:34:06 -0600 Subject: [PATCH 02/11] setup docs folder --- docs/_static/favicon.ico | Bin 0 -> 4414 bytes api.rst => docs/api.rst | 0 conf.py => docs/conf.py | 15 ++++++++++--- docs/examples.rst | 11 +++++++++ docs/index.rst | 47 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 docs/_static/favicon.ico rename api.rst => docs/api.rst (100%) rename conf.py => docs/conf.py (90%) create mode 100644 docs/examples.rst create mode 100644 docs/index.rst diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5aca98376a1f7e593ebd9cf41a808512c2135635 GIT binary patch literal 4414 zcmd^BX;4#F6n=SG-XmlONeGrD5E6J{RVh+e928U#MG!$jWvO+UsvWh`x&VqGNx*en zx=qox7Dqv{kPwo%fZC$dDwVpRtz{HzTkSs8QhG0)%Y=-3@Kt!4ag|JcIo?$-F|?bXVS9UDUyev>MVZQ(H8K4#;BQW-t2CPorj8^KJrMX}QK zp+e<;4ldpXz~=)2GxNy811&)gt-}Q*yVQpsxr@VMoA##{)$1~=bZ1MmjeFw?uT(`8 z^g=09<=zW%r%buwN%iHtuKSg|+r7HkT0PYN*_u9k1;^Ss-Z!RBfJ?Un4w(awqp2b3 z%+myoFis_lTlCrGx2z$0BQdh+7?!JK#9K9@Z!V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2e`C$1I5ML5U0Qs0C1GAp^?!*`=|Nm(vWz3j*j*8ucum2;r0^-6Aca=Gv) zc%}&;!+_*S2tlnnJnz0EKeRmw-Y!@9ob!XQBwiv}^u9MkaXHvM=!<3YX;+2#5Cj5pp?FEK750S3BgeSDtaE^ zXUM@xoV6yBFKfzvY20V&Lr0yC`_. \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..1c32e9a --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,47 @@ +.. include:: ../README.rst + +Table of Contents +================= + +.. toctree:: + :maxdepth: 4 + :hidden: + + self + +.. toctree:: + :caption: Examples + + examples + +.. toctree:: + :caption: API Reference + :maxdepth: 3 + + api + +.. toctree:: + :caption: Tutorials + +.. toctree:: + :caption: Related Products + + Charlieplex Devices + +.. toctree:: + :caption: Other Links + + Download + CircuitPython Reference Documentation + CircuitPython Support Forum + Discord Chat + Adafruit Learning System + Adafruit Blog + Adafruit Store + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` From 679c764ffc40ca8e0b55fe5e40853dc0ff6f7787 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 27 Feb 2018 21:35:38 -0600 Subject: [PATCH 03/11] updated .travis & .readthedocs yml --- readthedocs.yml => .readthedocs.yml | 0 .travis.yml | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename readthedocs.yml => .readthedocs.yml (100%) diff --git a/readthedocs.yml b/.readthedocs.yml similarity index 100% rename from readthedocs.yml rename to .readthedocs.yml diff --git a/.travis.yml b/.travis.yml index 9a50ef8..508d24a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,16 +16,17 @@ deploy: provider: releases api_key: $GITHUB_TOKEN file_glob: true - file: bundles/* + file: $TRAVIS_BUILD_DIR/bundles/* skip_cleanup: true overwrite: true on: tags: true install: - - pip install pylint circuitpython-build-tools + - pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme script: - pylint adafruit_is31fl3731.py - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-is31fl3731 --library_location . + - cd docs && sphinx-build -E -W -b html . _build/html From 44a591717d9bfafeef169c4b5f8b53d163ef0ed1 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 27 Feb 2018 21:39:02 -0600 Subject: [PATCH 04/11] updated README --- README.rst | 55 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 4edaa4a..2d9a7ff 100644 --- a/README.rst +++ b/README.rst @@ -5,9 +5,9 @@ Introduction :target: https://circuitpython.readthedocs.io/projects/is31fl3731/en/latest/ :alt: Documentation Status -.. image :: https://badges.gitter.im/adafruit/circuitpython.svg - :target: https://gitter.im/adafruit/circuitpython?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge - :alt: Gitter +.. image :: https://img.shields.io/discord/327254708534116352.svg + :target: https://discord.gg/nBQh6qu + :alt: Discord CircuitPython driver for the IS31FL3731 charlieplex IC. @@ -64,10 +64,49 @@ Contributions are welcome! Please read our `Code of Conduct `_ before contributing to help this project stay welcoming. -API Reference -============= +Building locally +================ + +To build this library locally you'll need to install the +`circuitpython-build-tools `_ package. + +.. code-block:: shell + + python3 -m venv .env + source .env/bin/activate + pip install circuitpython-build-tools + +Once installed, make sure you are in the virtual environment: + +.. code-block:: shell + + source .env/bin/activate + +Then run the build: + +.. code-block:: shell + + circuitpython-build-bundles --filename_prefix adafruit-circuitpython-is31fl3731 --library_location . + +Sphinx documentation +----------------------- + +Sphinx is used to build the documentation based on rST files and comments in the code. First, +install dependencies (feel free to reuse the virtual environment from above): + +.. code-block:: shell + + python3 -m venv .env + source .env/bin/activate + pip install Sphinx sphinx-rtd-theme + +Now, once you have the virtual environment activated: + +.. code-block:: shell -.. toctree:: - :maxdepth: 2 + cd docs + sphinx-build -E -W -b html . _build/html - api +This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to +view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to +locally verify it will pass. From f81a9fc36b6ee1c8287c2c271aafb5b053c411a1 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 27 Feb 2018 21:41:48 -0600 Subject: [PATCH 05/11] removed extraneous sphinx file; setup.py --- setup.py | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 430f044..0000000 --- a/setup.py +++ /dev/null @@ -1,18 +0,0 @@ -from distutils.core import setup - - -setup( - name='adafruit-is31fl3731', - py_modules=['adafruit_is31fl3731'], - version="1.0.1", - description="Driver for CircuitPython for the IS31FL3731 LED matrix.", - long_description="""\ -Driver for the IS31FL3731-based charlieplexed LED matrices and CharlieWing.""", - author='Radomir Dopieralski', - author_email='micropython@sheep.art.pl', - classifiers = [ - 'Development Status :: 6 - Mature', - 'Programming Language :: Python :: 3', - 'License :: OSI Approved :: MIT License', - ], -) From 1c6257214f35519ed523024a9ef67943dde22953 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 27 Feb 2018 21:45:01 -0600 Subject: [PATCH 06/11] updated info docstring --- adafruit_is31fl3731.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index 597d455..7559b38 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -26,14 +26,23 @@ CircuitPython driver for the IS31FL3731 charlieplex IC. -This driver supports the following hardware: + +* Author(s): Tony DiCola + +Implementation Notes +-------------------- + +**Hardware:** * `Adafruit 16x9 Charlieplexed PWM LED Matrix Driver - IS31FL3731 `_ * `Adafruit 15x7 CharliePlex LED Matrix Display FeatherWings `_ -* Author(s): Tony DiCola +**Software and Dependencies:** + +* Adafruit CircuitPython firmware (2.2.0+) for the ESP8622 and M0-based boards: + https://github.com/adafruit/circuitpython/releases """ # imports From 06a9595dbdc8d240e06b42e74eed216fb9d4ea90 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 27 Feb 2018 21:48:44 -0600 Subject: [PATCH 07/11] sphinx fix --- adafruit_is31fl3731.py | 1 + 1 file changed, 1 insertion(+) diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index 7559b38..14d59c2 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -36,6 +36,7 @@ * `Adafruit 16x9 Charlieplexed PWM LED Matrix Driver - IS31FL3731 `_ + * `Adafruit 15x7 CharliePlex LED Matrix Display FeatherWings `_ From 647d2de0d2e1722c4befa191639f526108ae5b13 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 27 Feb 2018 21:51:23 -0600 Subject: [PATCH 08/11] sphinx fix2 --- adafruit_is31fl3731.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index 14d59c2..a2e4f68 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -35,10 +35,10 @@ **Hardware:** * `Adafruit 16x9 Charlieplexed PWM LED Matrix Driver - IS31FL3731 -`_ + `_ * `Adafruit 15x7 CharliePlex LED Matrix Display FeatherWings -`_ + `_ **Software and Dependencies:** From 0007a205500b6e68f400334c61227b8bd3858964 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 27 Feb 2018 21:57:15 -0600 Subject: [PATCH 09/11] sphinx indentation fixes --- adafruit_is31fl3731.py | 66 +++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index a2e4f68..885105d 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -78,9 +78,11 @@ _COLOR_OFFSET = const(0x24) class Matrix: - """The Matrix class support the main function for driving the 16x9 matrix Display - :param ~adafruit_bus_device.i2c_device i2c_device: the connected i2c bus i2c_device - :param address: the device address; defaults to 0x74 + """ + The Matrix class support the main function for driving the 16x9 matrix Display + + :param ~adafruit_bus_device.i2c_device i2c_device: the connected i2c bus i2c_device + :param address: the device address; defaults to 0x74 """ width = 16 height = 9 @@ -154,16 +156,20 @@ def reset(self): self.sleep(False) def sleep(self, value): - """Set the Software Shutdown Register bit - :param value: True to set software shutdown bit; False unset + """ + Set the Software Shutdown Register bit + + :param value: True to set software shutdown bit; False unset """ return self._register(_CONFIG_BANK, _SHUTDOWN_REGISTER, not value) def autoplay(self, delay=0, loops=0, frames=0): - """Start autoplay - :param delay: in ms - :param loops: number of loops - 0->7 - :param frames: number of frames: 0->7 + """ + Start autoplay + + :param delay: in ms + :param loops: number of loops - 0->7 + :param frames: number of frames: 0->7 """ if delay == 0: self._mode(_PICTURE_MODE) @@ -181,12 +187,14 @@ def autoplay(self, delay=0, loops=0, frames=0): def fade(self, fade_in=None, fade_out=None, pause=0): - """Start and stop the fade feature. If both fade_in and fade_out are None (the + """ + Start and stop the fade feature. If both fade_in and fade_out are None (the default), the breath feature is used for fading. if fade_in is None, then fade_in = fade_out. If fade_out is None, then fade_out = fade_in - :param fade_in: positive number; 0->100 - :param fade-out: positive number; 0->100 - :param pause: breath register 2 pause value + + :param fade_in: positive number; 0->100 + :param fade-out: positive number; 0->100 + :param pause: breath register 2 pause value """ if fade_in is None and fade_out is None: self._register(_CONFIG_BANK, _BREATH2_REGISTER, 0) @@ -207,9 +215,11 @@ def fade(self, fade_in=None, fade_out=None, pause=0): self._register(_CONFIG_BANK, _BREATH2_REGISTER, 1 << 4 | pause) def frame(self, frame=None, show=True): - """Set the current frame - :param frame: frame number; 0-7 or None. If None function returns current frame - :param show: True to show the frame; False to don't force a show + """ + Set the current frame + + :param frame: frame number; 0-7 or None. If None function returns current frame + :param show: True to show the frame; False to don't force a show """ if frame is None: return self._frame @@ -256,10 +266,12 @@ def blink(self, rate=None): return None def fill(self, color=None, blink=None, frame=None): - """Fill the display with a brightness level - :param color: brightness 0->255 - :param blink: True if blinking is required - :param frame: which frame to fill 0->7 + """ + Fill the display with a brightness level + + :param color: brightness 0->255 + :param blink: True if blinking is required + :param frame: which frame to fill 0->7 """ if frame is None: frame = self._frame @@ -289,12 +301,14 @@ def pixel_addr(x, y): #pylint: disable-msg=too-many-arguments def pixel(self, x, y, color=None, blink=None, frame=None): - """Set blink or brightness for an x,y pixel - :param x: horizontal pixel position - :param y: vertical pixel position - :param color: brightness value 0->255 - :param blink: True to blink - :param frame: the frame to set the pixel + """ + Set blink or brightness for an x,y pixel + + :param x: horizontal pixel position + :param y: vertical pixel position + :param color: brightness value 0->255 + :param blink: True to blink + :param frame: the frame to set the pixel """ if not 0 <= x <= self.width: return None From 94f50039aceb17f2893fd618d16c4ba7662ba219 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 27 Feb 2018 21:59:40 -0600 Subject: [PATCH 10/11] pylint fix; sneaky whitespace is sneaky --- adafruit_is31fl3731.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index 885105d..82b46c8 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -191,7 +191,7 @@ def fade(self, fade_in=None, fade_out=None, pause=0): Start and stop the fade feature. If both fade_in and fade_out are None (the default), the breath feature is used for fading. if fade_in is None, then fade_in = fade_out. If fade_out is None, then fade_out = fade_in - + :param fade_in: positive number; 0->100 :param fade-out: positive number; 0->100 :param pause: breath register 2 pause value From cf4191f9beb51007cb066f702aabba376a22de30 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 28 Feb 2018 19:43:24 -0600 Subject: [PATCH 11/11] docstring fixes --- adafruit_is31fl3731.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index 82b46c8..932a9c2 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -219,7 +219,7 @@ def frame(self, frame=None, show=True): Set the current frame :param frame: frame number; 0-7 or None. If None function returns current frame - :param show: True to show the frame; False to don't force a show + :param show: True to show the frame; False to not show. """ if frame is None: return self._frame @@ -302,7 +302,7 @@ def pixel_addr(x, y): #pylint: disable-msg=too-many-arguments def pixel(self, x, y, color=None, blink=None, frame=None): """ - Set blink or brightness for an x,y pixel + Blink or brightness for x-, y-pixel :param x: horizontal pixel position :param y: vertical pixel position