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

Fix python formatting everywhere #1837

Merged
merged 12 commits into from
Sep 21, 2023
Merged

Conversation

npentrel
Copy link
Collaborator

No description provided.

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Sep 14, 2023
@viambot
Copy link
Member

viambot commented Sep 14, 2023

Overall readability score: 54.45 (🟢 +0)

File Readability
_index.md 63.65 (🟢 +0)
_index.md 68.02 (🟢 +0)
_index.md 61.61 (🟢 +0)
_index.md 59.52 (🟢 +0)
_index.md 67.5 (🟢 +0)
_index.md 54.45 (🟢 +0)
_index.md 57.24 (🟢 +0)
_index.md 58.6 (🟢 +0)
_index.md 25.86 (🟢 +0)
cloud.md 54.2 (🟢 +0)
robot.md 52.63 (🟢 +0)
sessions.md 53.07 (🟢 +0)
run.md 49.05 (🟢 +0)
_index.md 49.93 (🟢 +0)
_index.md 61.44 (🟢 +0)
constraints.md 26.17 (🟢 +0)
_index.md 61.84 (🟢 +0)
_index.md 60.04 (🟢 +0)
_index.md 59 (🟢 +0)
classification.md 60.43 (🟢 +0)
build-a-mock-robot.md 68.28 (🟢 +0)
custom-base-dog.md 52.65 (🟢 +0)
confetti-bot.md 78.07 (🟢 +0)
lazy-susan.md 74.04 (🟢 +0)
try-viam-sdk.md 62.95 (🟢 +0)
claw-game.md 72.46 (🟢 +0)
guardian.md 72.12 (🟢 +0)
make-a-plant-watering-robot.md 69.2 (🟢 +0)
pet-treat-dispenser.md 75.11 (🟢 +0)
send-security-photo.md 69.78 (🟢 +0)
tipsy.md 69.36 (🟢 +0)
accessing-and-moving-robot-arm.md 58.47 (🟢 +0)
color-detection-scuttle.md 68.36 (🟢 +0)
constrain-motion.md 56.09 (🟢 +0)
plan-motion-with-arm-gripper.md 54.91 (🟢 +0)
webcam-line-follower-robot.md 75.02 (🟢 +0)
README.md 78.8 (🔴 -1.09)
View detailed metrics

🟢 - Shows an increase in readability
🔴 - Shows a decrease in readability

File Readability FRE GF ARI CLI DCRS
_index.md 63.65 45.66 8.71 13.8 11.77 5.91
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 68.02 49.11 7.25 13 12.11 5.72
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 61.61 44.75 8.81 15.1 12.29 5.63
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 59.52 40.04 8.61 13.2 12.46 6.93
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 67.5 47.99 7.57 13 11.48 5.93
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 54.45 38.52 9.18 14.9 14.09 6.64
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 57.24 44.44 9.26 15.7 13.23 6.05
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 58.6 38.32 8.55 14.9 13.28 6.03
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 25.86 31.85 15.75 22 14.57 8.27
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
cloud.md 54.2 30.36 7.97 16.7 14.96 5.75
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
robot.md 52.63 32.29 7.95 16.7 15.48 6.12
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
sessions.md 53.07 41.7 12 13.8 11.78 7.24
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
run.md 49.05 43.43 11.46 15.5 12.94 7.59
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 49.93 40.28 11.92 15.6 12.77 6.94
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 61.44 46.57 8.67 13.8 13.34 5.98
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
constraints.md 26.17 30.74 15.55 22 15.62 7.76
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 61.84 38.21 8.25 13.7 13.05 5.82
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 60.04 46.78 8.97 13.9 12.29 6.68
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
_index.md 59 37.81 8.33 15.2 13.63 5.71
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
classification.md 60.43 52.39 10.13 13.4 11.37 6.86
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
build-a-mock-robot.md 68.28 60.24 9.84 12.4 9.86 6.09
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
custom-base-dog.md 52.65 44.58 12.82 15.6 10.86 6.67
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
confetti-bot.md 78.07 69.52 8.96 9.7 8.24 5.92
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
lazy-susan.md 74.04 62.27 9.02 10 8.93 6.33
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
try-viam-sdk.md 62.95 56.89 10.73 14.2 10.33 6.08
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
claw-game.md 72.46 60.95 9.23 10.8 9.46 6.05
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
guardian.md 72.12 60.75 9.44 10.9 9.34 6.04
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
make-a-plant-watering-robot.md 69.2 61.16 9.44 11.7 10.27 6.2
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
pet-treat-dispenser.md 75.11 62.38 8.89 9.8 9.05 6.11
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
send-security-photo.md 69.78 54.83 8.64 10.8 10.38 6.48
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
tipsy.md 69.36 54.52 8.62 11.4 10.96 6.08
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
accessing-and-moving-robot-arm.md 58.47 49.55 11.17 14.1 10.85 6.68
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
color-detection-scuttle.md 68.36 55.03 9.23 10.6 10.26 6.76
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
constrain-motion.md 56.09 47.32 12.11 14.2 10.8 6.78
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
plan-motion-with-arm-gripper.md 54.91 48.74 11.69 15 11.49 6.78
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
webcam-line-follower-robot.md 75.02 63.29 8.78 9.7 9.28 6.19
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
README.md 78.8 66.84 7.98 7.9 8.63 6.72
  🔴 -1.09 🔴 -0.2 🔴 -0.04 🔴 -0.4 🔴 -0.29 🟢 +0

Averages:

  Readability FRE GF ARI CLI DCRS
Average 54.45 45.92 10.86 13.37 11.9 7.78
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
View metric targets
Metric Range Ideal score
Flesch Reading Ease 100 (very easy read) to 0 (extremely difficult read) 60
Gunning Fog 6 (very easy read) to 17 (extremely difficult read) 8 or less
Auto. Read. Index 6 (very easy read) to 14 (extremely difficult read) 8 or less
Coleman Liau Index 6 (very easy read) to 17 (extremely difficult read) 8 or less
Dale-Chall Readability 4.9 (very easy read) to 9.9 (extremely difficult read) 6.9 or less

@npentrel npentrel requested a review from andf-viam September 15, 2023 16:16
Copy link
Contributor

@andf-viam andf-viam left a comment

Choose a reason for hiding this comment

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

Wow this is amazing!! LGTM with just one concern about multi-line credential placeholders.

Fantastic job on this, this will help so much!!

@@ -448,10 +448,11 @@ Get an [`DigitalInterrupt`](#digital_interrupts) by `name.`
For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/board/index.html#viam.components.board.Board.digital_interrupt_by_name).

```python
my_board = Board.from_robot(robot=robot, name=)
my_board = Board.from_robot(robot=robot, name="my_board")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch! No way flake8 caught this one???

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it did tell me there was an error - I did manually have to fix it though

@@ -133,7 +133,7 @@ frame = await my_cam.get_image()

# Convert "frame" to a standard 2D image representation.
# Remove the 1st 3x8 bytes and reshape the raw bytes to List[List[Int]].
standard_frame frame.bytes_to_depth_array()
standard_frame = frame.bytes_to_depth_array()
Copy link
Contributor

Choose a reason for hiding this comment

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

This too! Surely this is naomi8 ??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

flake8 says error - naomi fixes

await start.set_power(.8)
await asyncio.sleep(0.1)
if (await GPIO.get()) == False:
if not (await GPIO.get()):
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I like this tool!

@@ -294,10 +295,10 @@ Copy this code and add it to your own code within the main function block:
```python {class="line-numbers linkable-line-numbers"}
while True:
print(party_return_value.get())
while (await party_return_value.get()) == True:
while (await party_return_value.get()):
Copy link
Contributor

Choose a reason for hiding this comment

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

😂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the word is pythonic

docs/tutorials/services/color-detection-scuttle.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@viambot
Copy link
Member

viambot commented Sep 21, 2023

You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/6e3895f90a52b7a412659a363e57d2fc243cf83f/public

@npentrel npentrel merged commit 8e389c5 into viamrobotics:main Sep 21, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to build This pull request is marked safe to build from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants