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

improving docs and varia #12

Merged
merged 7 commits into from
Apr 26, 2021
Merged

improving docs and varia #12

merged 7 commits into from
Apr 26, 2021

Conversation

jposada202020
Copy link
Contributor

@jposada202020 jposada202020 commented Apr 18, 2021

improving docs
including learning guides, and ICM20948 breakout in hardware API.
Including all examples in API.
Re-arranging class doc order in api.rst

Built locally to verify

…ardware API. Including all examples in API. Re-arranging doc order in api.rst
@jposada202020 jposada202020 added the documentation Improvements or additions to documentation label Apr 18, 2021
@jposada202020 jposada202020 requested a review from a team April 18, 2021 03:37
Copy link
Contributor

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

@jposada202020 Thank you for doing these improvements to multiple libraries.

A couple of comments which apply to most of these PR's:

The phrasing "Here is one way of importing the MCP9600 class so you can use it with the name mcp", and similar sort of suggest to me there's something special about the name mcp. I might rewrite this as "Here is an example of creating and using an MCP9600 object, assigning it to the variable mcp." Or even just "Here is an example of using the MCP9600 class."

We often recommend people use board.I2C() instead of busio.I2C(board.SCL, board, SDA). It's a common support issue that people try to create multiple instances of busio.I2C(board.SCL, board, SDA) and are confused by the errors on the second try. The advantage of using board.I2C() is that this problem is avoided. The disadvantage is that it's not clear which pins are being used, though that could be in a comment, e.g.:

i2c = board.I2C()    # Uses board.SCL and board.SDA

Many of the simpletests were written before board.I2C() existed. @kattni, do you have a comment about whether board.I2C() or busio.I2C() would be preferred for these simple examples?

@jposada202020
Copy link
Contributor Author

@dhalbert Thanks for the comments. good points

  1. I will modify the phrasing according to your recommendations. Thanks
  2. Regarding the use of busio. A lot of the examples use busio. A lot of learning guides use it also in the example code.

One Example

https://learn.adafruit.com/lsm6ds33-6-dof-imu=accelerometer-gyro/python-circuitpython
Let me know what will be the correct way and I will use it.
Questions?
Would this imply to correct the simpletest_code also?. (I do not have all these hardware to test if after the changes, the library will work)

I would wait until guidance is given before continuing the update. Thanks

@dhalbert
Copy link
Contributor

I would wait until guidance is given before continuing the update.

We could discuss this In the Weeds in the weekly meeting tomorrow.

@jposada202020
Copy link
Contributor Author

Yes good Idea 😃 I was hearing our meeting on feb 8th. regarding a similar topic. That was regarding this issue adafruit/circuitpython#4121. I will add this to the offtopic to the meeting thanks Dan

@jposada202020
Copy link
Contributor Author

@dhalbert as discussed in our meeting I made the changes. Hope everything is in there, if not please comment and I will correct accordingly. Thanks again for the support

@jposada202020
Copy link
Contributor Author

After reflecting on this on the param descriptio we could use

:param ~busio.I2C i2c_bus:`

when I use ~board.I2C it does not show as a Hyperlink in the documentation, do you know a way to make the correct reference?

@jposada202020
Copy link
Contributor Author

@dhalbert I went through the Sphinx documentation twice? trying to find a solution for the parameter..no luck also tried different things, it seems that when we try to get the objects.inv from the documentation in readthedocs while building the api docs we could not get the correct information from the class objects. (I suppose, this is because board.I2C are not a class, could be way wrong). So I am returning to the parameter definition as ~busio.I2C. The examples and the readme.rst for sure I would change to board.I2C().
Anyway if you have some time to review this, it would be really appreciate it, I would like to get this ball rolling over the weekend Thanks 😃

Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

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

Please check through this and correct the use of slave to peripheral where used. Thanks!

@@ -140,7 +140,7 @@ class ICM20X: # pylint:disable=too-many-instance-attributes


:param ~busio.I2C i2c_bus: The I2C bus the ICM20X is connected to.
:param address: The I2C slave address of the sensor
:param int address: The I2C slave address of the sensor
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the use of the word slave here to peripheral to match the CircuitPython Design Guide terminology.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do thanks :)

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 will go back and correct this and all the busio designations in previous PRs. Thanks @kattni

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kattni I updated this according to your suggestion and will continue to use the design guide for the comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is solved in 5c27ce9

adafruit_icm20x.py Outdated Show resolved Hide resolved
@kattni kattni merged commit 8a34894 into adafruit:master Apr 26, 2021
@jposada202020 jposada202020 deleted the improving_docs branch April 26, 2021 20:57
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Apr 30, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADXL34x to 1.11.8 from 1.11.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_ADXL34x#29 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_APDS9960 to 2.2.7 from 2.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_APDS9960#29 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_AS726x to 2.0.5 from 2.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_AS726x#16 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 5.3.1 from 5.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO055#81 from jposada202020/improving_docs
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO055#80 from GuenterQ/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_FXAS21002C to 2.1.8 from 2.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_FXAS21002C#22 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_FXOS8700 to 2.1.7 from 2.1.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_FXOS8700#23 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.9.0 from 3.8.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_GPS#62 from lesamouraipourpre/minimum_sentence_size
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_ICM20X to 2.0.7 from 2.0.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_ICM20X#12 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_L3GD20 to 2.3.5 from 2.3.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_L3GD20#22 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL to 2.1.9 from 2.1.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS2MDL#13 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS331 to 1.0.5 from 1.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS331#3 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH to 5.1.10 from 5.1.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS3DH#68 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3MDL to 1.1.10 from 1.1.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS3MDL#16 from jposada202020/master
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM303_Accel to 1.1.7 from 1.1.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM303_Accel#11 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag to 1.1.8 from 1.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM303DLH_Mag#13 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM9DS1 to 2.1.8 from 2.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM9DS1#29 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90393 to 2.0.6 from 2.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90393#28 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_MMA8451 to 1.3.7 from 1.3.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_MMA8451#17 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_MPU6050 to 1.1.7 from 1.1.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_MPU6050#16 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_MSA301 to 1.2.7 from 1.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_MSA301#15 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_TCS34725 to 3.3.7 from 3.3.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_TCS34725#35 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC59711 to 2.0.0 from 1.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC59711#17 from jposada202020/master
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC59711#5 from s-light/multi
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4010 to 0.10.8 from 0.10.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4010#18 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4040 to 1.2.6 from 1.2.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4040#13 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT to 2.4.0 from 2.3.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_AzureIoT#31 from jimbobbennett/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font to 1.5.0 from 1.4.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#46 from jposada202020/master
  > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#43 from jposada202020/raise_error_no_boundingbox
  > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#45 from FoamyGuy/simpletest_example

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes to 2.1.0 from 2.0.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#37 from jposada202020/new_example_circle
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#36 from empirical-dan/patch-2

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout to 1.9.2 from 1.9.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#36 from jposada202020/solving_parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants