Skip to content

Fix readme example #25

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
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,23 @@ Usage Example

.. code-block:: python

import time
import board
import digitalio
# import digitalio # For use with SPI
import busio
import time
from adafruit_bmp280 import adafruit_bmp280
import adafruit_bmp280

# Create library object using our Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)
i2c = busio.I2C(board.SCL, board.SDA) # pylint: disable=invalid-name
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c) # pylint: disable=invalid-name

# OR create library object using our Bus SPI port
#spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
#bmp_cs = digitalio.DigitalInOut(board.D10)
#bmp280 = adafruit_bmp280.Adafruit_BMP280_SPI(spi, bmp_cs)
# spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
# bmp_cs = digitalio.DigitalInOut(board.D10)
# bmp280 = adafruit_bmp280.Adafruit_BMP280_SPI(spi, bmp_cs)

# change this to match the location's pressure (hPa) at sea level
bmp280.seaLevelhPa = 1013.25
bmp280.sea_level_pressure = 1013.25

while True:
print("\nTemperature: %0.1f C" % bmp280.temperature)
Expand Down
8 changes: 4 additions & 4 deletions examples/bmp280_simpletest.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""Simpletest Example that shows how to get temperature,
pressure, and altitude readings from a BMP280"""
import time

import board

# import digitalio # For use with SPI
import busio

import adafruit_bmp280

# Create library object using our Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)
i2c = busio.I2C(board.SCL, board.SDA) # pylint: disable=invalid-name
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c) # pylint: disable=invalid-name
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you Scott
When I check pylint locally I use a command like this:

pylint --rcfile .pylintrc path\to\somefile.py

I don't have much experience with the github workflows like this forgive me if it's obvious, but I don't see any reference to the .pylintrc file around that section you linked to.

Is the command like I've used here the correct way for me to check pylint locally?

Is there a different .pylintrc for the examples? or do they skip pylinting entirely?

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I think I get it now, there are a few extra things disabled via the flag --disable=missing-docstring,invalid-name,bad-whitespace passed in when it's run. Thank you Jerry.

I pushed a change to remove them from the example script the other day. But I just noticed that I've left them in the readme. I'll push another commit to fix that shortly.


# OR create library object using our Bus SPI port
# spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
Expand Down