Skip to content

Commit ce97999

Browse files
authored
Merge pull request #67 from jposada202020/fixing_short_names
Fixing Pylint Short Names
2 parents 5dee063 + ed8aec4 commit ce97999

File tree

5 files changed

+66
-63
lines changed

5 files changed

+66
-63
lines changed

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
279279

280280
# Good variable names which should always be accepted, separated by a comma
281281
# good-names=i,j,k,ex,Run,_
282-
good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_
282+
good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_,cs
283283

284284
# Include a hint for the correct naming format with invalid-name
285285
include-naming-hint=no

adafruit_bme280/advanced.py

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -284,36 +284,36 @@ class Adafruit_BME280_I2C(Adafruit_BME280_Advanced):
284284
285285
**Quickstart: Importing and using the BME280**
286286
287-
Here is an example of using the :class:`Adafruit_BME280_I2C`.
288-
First you will need to import the libraries to use the sensor
287+
Here is an example of using the :class:`Adafruit_BME280_I2C`.
288+
First you will need to import the libraries to use the sensor
289289
290-
.. code-block:: python
290+
.. code-block:: python
291291
292-
import board
293-
import adafruit_bme280.advanced as adafruit_bme280
292+
import board
293+
import adafruit_bme280.advanced as adafruit_bme280
294294
295-
Once this is done you can define your `board.I2C` object and define your sensor object
295+
Once this is done you can define your `board.I2C` object and define your sensor object
296296
297-
.. code-block:: python
297+
.. code-block:: python
298298
299-
i2c = board.I2C() # uses board.SCL and board.SDA
300-
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
299+
i2c = board.I2C() # uses board.SCL and board.SDA
300+
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
301301
302-
You need to setup the pressure at sea level
302+
You need to setup the pressure at sea level
303303
304-
.. code-block:: python
304+
.. code-block:: python
305305
306-
bme280.sea_level_pressure = 1013.25
306+
bme280.sea_level_pressure = 1013.25
307307
308-
Now you have access to the :attr:`temperature`, :attr:`relative_humidity`
309-
:attr:`pressure` and :attr:`altitude` attributes
308+
Now you have access to the :attr:`temperature`, :attr:`relative_humidity`
309+
:attr:`pressure` and :attr:`altitude` attributes
310310
311-
.. code-block:: python
311+
.. code-block:: python
312312
313-
temperature = bme280.temperature
314-
relative_humidity = bme280.relative_humidity
315-
pressure = bme280.pressure
316-
altitude = bme280.altitude
313+
temperature = bme280.temperature
314+
relative_humidity = bme280.relative_humidity
315+
pressure = bme280.pressure
316+
altitude = bme280.altitude
317317
318318
"""
319319

@@ -334,38 +334,38 @@ class Adafruit_BME280_SPI(Adafruit_BME280_Advanced):
334334
335335
**Quickstart: Importing and using the BME280**
336336
337-
Here is an example of using the :class:`Adafruit_BME280_SPI` class.
338-
First you will need to import the libraries to use the sensor
337+
Here is an example of using the :class:`Adafruit_BME280_SPI` class.
338+
First you will need to import the libraries to use the sensor
339339
340-
.. code-block:: python
340+
.. code-block:: python
341341
342-
import board
343-
from digitalio import DigitalInOut
344-
import adafruit_bme280.advanced as adafruit_bme280
342+
import board
343+
from digitalio import DigitalInOut
344+
import adafruit_bme280.advanced as adafruit_bme280
345345
346-
Once this is done you can define your `board.SPI` object and define your sensor object
346+
Once this is done you can define your `board.SPI` object and define your sensor object
347347
348-
.. code-block:: python
348+
.. code-block:: python
349349
350-
cs = digitalio.DigitalInOut(board.D10)
351-
spi = board.SPI()
352-
bme280 = adafruit_bme280.Adafruit_BME280_SPI(spi, cs)
350+
cs = digitalio.DigitalInOut(board.D10)
351+
spi = board.SPI()
352+
bme280 = adafruit_bme280.Adafruit_BME280_SPI(spi, cs)
353353
354-
You need to setup the pressure at sea level
354+
You need to setup the pressure at sea level
355355
356-
.. code-block:: python
356+
.. code-block:: python
357357
358-
bme280.sea_level_pressure = 1013.25
358+
bme280.sea_level_pressure = 1013.25
359359
360-
Now you have access to the :attr:`temperature`, :attr:`relative_humidity`
361-
:attr:`pressure` and :attr:`altitude` attributes
360+
Now you have access to the :attr:`temperature`, :attr:`relative_humidity`
361+
:attr:`pressure` and :attr:`altitude` attributes
362362
363-
.. code-block:: python
363+
.. code-block:: python
364364
365-
temperature = bme280.temperature
366-
relative_humidity = bme280.relative_humidity
367-
pressure = bme280.pressure
368-
altitude = bme280.altitude
365+
temperature = bme280.temperature
366+
relative_humidity = bme280.relative_humidity
367+
pressure = bme280.pressure
368+
altitude = bme280.altitude
369369
370370
"""
371371

adafruit_bme280/basic.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -331,36 +331,36 @@ class Adafruit_BME280_I2C(Adafruit_BME280):
331331
332332
**Quickstart: Importing and using the BME280**
333333
334-
Here is an example of using the :class:`Adafruit_BME280_I2C`.
335-
First you will need to import the libraries to use the sensor
334+
Here is an example of using the :class:`Adafruit_BME280_I2C`.
335+
First you will need to import the libraries to use the sensor
336336
337-
.. code-block:: python
337+
.. code-block:: python
338338
339-
import board
340-
from adafruit_bme280 import basic as adafruit_bme280
339+
import board
340+
from adafruit_bme280 import basic as adafruit_bme280
341341
342-
Once this is done you can define your `board.I2C` object and define your sensor object
342+
Once this is done you can define your `board.I2C` object and define your sensor object
343343
344-
.. code-block:: python
344+
.. code-block:: python
345345
346-
i2c = board.I2C() # uses board.SCL and board.SDA
347-
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
346+
i2c = board.I2C() # uses board.SCL and board.SDA
347+
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
348348
349-
You need to setup the pressure at sea level
349+
You need to setup the pressure at sea level
350350
351-
.. code-block:: python
351+
.. code-block:: python
352352
353-
bme280.sea_level_pressure = 1013.25
353+
bme280.sea_level_pressure = 1013.25
354354
355-
Now you have access to the :attr:`temperature`, :attr:`relative_humidity`
356-
:attr:`pressure` and :attr:`altitude` attributes
355+
Now you have access to the :attr:`temperature`, :attr:`relative_humidity`
356+
:attr:`pressure` and :attr:`altitude` attributes
357357
358-
.. code-block:: python
358+
.. code-block:: python
359359
360-
temperature = bme280.temperature
361-
relative_humidity = bme280.relative_humidity
362-
pressure = bme280.pressure
363-
altitude = bme280.altitude
360+
temperature = bme280.temperature
361+
relative_humidity = bme280.relative_humidity
362+
pressure = bme280.pressure
363+
altitude = bme280.altitude
364364
365365
"""
366366

adafruit_bme280/protocol.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ def read_register(self, register: int, length: int) -> bytearray:
2626
return result
2727

2828
def write_register_byte(self, register: int, value: int) -> None:
29-
"Write to the device register."
29+
"""Write to the device register"""
3030
with self._i2c as i2c:
3131
i2c.write(bytes([register & 0xFF, value & 0xFF]))
3232

3333

3434
class SPI_Impl:
35-
"Protocol implemenation for the SPI bus."
35+
"""Protocol implemenation for the SPI bus."""
3636

3737
def __init__(
3838
self,
3939
spi: SPI,
40-
cs: DigitalInOut, # pylint: disable=invalid-name
40+
cs: DigitalInOut,
4141
baudrate: int = 100000,
4242
) -> None:
4343
from adafruit_bus_device import ( # pylint: disable=import-outside-toplevel

docs/api.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99

1010
.. automodule:: adafruit_bme280.advanced
1111
:members:
12+
13+
.. automodule:: adafruit_bme280.protocol
14+
:members:

0 commit comments

Comments
 (0)