Skip to content
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

Lsm6ds refactor #2

Merged
merged 7 commits into from Jan 15, 2020
Merged

Lsm6ds refactor #2

merged 7 commits into from Jan 15, 2020

Conversation

siddacious
Copy link
Contributor

This refactor makes subclasses for each sensor and pulls unique code into each subclass


self._accel_range = AccelRange.RANGE_4G #pylint: disable=no-member
self._cached_accel_range = self._accel_range
Copy link
Member

Choose a reason for hiding this comment

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

why is this line here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I usually have lines like these to set the default values to something more useful, though 250dps should change then as it's already the default.

Copy link
Member

Choose a reason for hiding this comment

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

self._cached_accel_range = self._accel_range
should be handled within the property/setter right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, you're right. I misunderstood

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pylint just reminded me that it doesn't like when you do that because it ends up getting defined outside of __init__
image

Copy link
Member

Choose a reason for hiding this comment

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

set it to None at the top of init

self._cached_accel_range = self._accel_range
self._gyro_range = GyroRange.RANGE_250_DPS #pylint: disable=no-member
self._cached_gyro_range = self._gyro_range
Copy link
Member

Choose a reason for hiding this comment

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

ditto

examples/lsm6ds33_simpletest.py Outdated Show resolved Hide resolved
examples/lsm6ds_full_test.py Outdated Show resolved Hide resolved
@ladyada
Copy link
Member

ladyada commented Jan 15, 2020

can merge once passing

@siddacious siddacious merged commit 42e454e into master Jan 15, 2020
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jan 15, 2020
Updating https://github.com/adafruit/Adafruit_CircuitPython_HT16K33 to 2.6.0 from 2.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#47 from makermelissa/marquee
  > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#49 from makermelissa/matrix_scroll
  > update pylint examples directive
  > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#41 from vdehors/master
  > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#46 from adafruit/dherrada-patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS to 2.0.0 from 1.0.0:
  > Update README.rst
  > Update README.rst
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#2 from adafruit/lsm6ds_refactor
  > update pylint examples directive
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#1 from adafruit/dherrada-patch-1
  > added additional rates & sensor identifier

Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90640 to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#7 from dglaude/patch-1
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#8 from caternuson/iss2
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#5 from dglaude/patch-1
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#4 from adafruit/dherrada-patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing to 1.9.4 from 1.9.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_FeatherWing#51 from makermelissa/master
  > update pylint examples directive
  > Merge pull request adafruit/Adafruit_CircuitPython_FeatherWing#50 from adafruit/dherrada-patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_MotorKit to 1.3.3 from 1.3.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MotorKit#24 from caternuson/iss23

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_LSM6DS
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.

None yet

2 participants