From b4c66313e6ee9275126bd46cc5a44076cf3b47e0 Mon Sep 17 00:00:00 2001 From: dherrada Date: Sun, 15 Mar 2020 15:14:13 -0400 Subject: [PATCH] Ran black, updated to pylint 2.x --- .github/workflows/build.yml | 2 +- adafruit_lps35hw.py | 70 ++++++++++--------- docs/conf.py | 120 ++++++++++++++++++++------------- examples/lps35hw_data_rate.py | 2 +- examples/lps35hw_simpletest.py | 2 +- setup.py | 56 +++++++-------- 6 files changed, 137 insertions(+), 115 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fff3aa9..1dad804 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: source actions-ci/install.sh - name: Pip install pylint, black, & Sphinx run: | - pip install --force-reinstall pylint==1.9.2 black==19.10b0 Sphinx sphinx-rtd-theme + pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme - name: Library version run: git describe --dirty --always --tags - name: PyLint diff --git a/adafruit_lps35hw.py b/adafruit_lps35hw.py index 6a10d83..57ddc73 100644 --- a/adafruit_lps35hw.py +++ b/adafruit_lps35hw.py @@ -53,33 +53,35 @@ from adafruit_register.i2c_struct import UnaryStruct from adafruit_register.i2c_bits import RWBits, ROBits from adafruit_register.i2c_bit import RWBit + # pylint: disable=bad-whitespace -_INTERRUPT_CFG = const(0x0B) -_THS_P_L = const(0x0C) -_THS_P_H = const(0x0D) -_WHO_AM_I = const(0x0F) -_CTRL_REG1 = const(0x10) -_CTRL_REG2 = const(0x11) -_CTRL_REG3 = const(0x12) -_FIFO_CTRL = const(0x14) -_REF_P_XL = const(0x15) -_REF_P_L = const(0x16) -_REF_P_H = const(0x17) -_RPDS_L = const(0x18) -_RPDS_H = const(0x19) -_RES_CONF = const(0x1A) -_INT_SOURCE = const(0x25) -_FIFO_STATUS = const(0x26) -_STATUS = const(0x27) -_PRESS_OUT_XL = const(0x28) -_PRESS_OUT_L = const(0x29) -_PRESS_OUT_H = const(0x2A) -_TEMP_OUT_L = const(0x2B) -_TEMP_OUT_H = const(0x2C) -_LPFP_RES = const(0x33) +_INTERRUPT_CFG = const(0x0B) +_THS_P_L = const(0x0C) +_THS_P_H = const(0x0D) +_WHO_AM_I = const(0x0F) +_CTRL_REG1 = const(0x10) +_CTRL_REG2 = const(0x11) +_CTRL_REG3 = const(0x12) +_FIFO_CTRL = const(0x14) +_REF_P_XL = const(0x15) +_REF_P_L = const(0x16) +_REF_P_H = const(0x17) +_RPDS_L = const(0x18) +_RPDS_H = const(0x19) +_RES_CONF = const(0x1A) +_INT_SOURCE = const(0x25) +_FIFO_STATUS = const(0x26) +_STATUS = const(0x27) +_PRESS_OUT_XL = const(0x28) +_PRESS_OUT_L = const(0x29) +_PRESS_OUT_H = const(0x2A) +_TEMP_OUT_L = const(0x2B) +_TEMP_OUT_H = const(0x2C) +_LPFP_RES = const(0x33) # pylint: enable=bad-whitespace -class DataRate: # pylint: disable=too-few-public-methods + +class DataRate: # pylint: disable=too-few-public-methods """Options for ``data_rate`` +---------------------------+-------------------------+ @@ -99,6 +101,7 @@ class DataRate: # pylint: disable=too-few-public-methods +---------------------------+-------------------------+ """ + ONE_SHOT = const(0x00) RATE_1_HZ = const(0x01) RATE_10_HZ = const(0x02) @@ -106,7 +109,8 @@ class DataRate: # pylint: disable=too-few-public-methods RATE_50_HZ = const(0x04) RATE_75_HZ = const(0x05) -class LPS35HW: # pylint: disable=too-many-instance-attributes + +class LPS35HW: # pylint: disable=too-many-instance-attributes """Driver for the ST LPS35HW MEMS pressure sensor :param ~busio.I2C i2c_bus: The I2C bus the LPS34HW is connected to. @@ -136,7 +140,7 @@ class LPS35HW: # pylint: disable=too-many-instance-attributes _one_shot = RWBit(_CTRL_REG2, 0) # registers for configuring INT pin behavior - _interrupt_cfg = UnaryStruct(_CTRL_REG3, "