-
Notifications
You must be signed in to change notification settings - Fork 43
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
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
757c505
Fix python formatting everywhere
npentrel 3484bd9
Add python test github action
npentrel cd2cf1e
Add pre-commit hook info to readme
npentrel 545e64a
test
npentrel 9682f87
Merge branch 'main' into test-flake8
npentrel e9e1c49
Merge branch 'main' into test-flake8
npentrel 09b1cf0
Merge branch 'main' into test-flake8
npentrel 7af5f4b
Merge branch 'main' into test-flake8
npentrel 675c171
Update docs/tutorials/services/color-detection-scuttle.md
npentrel dedeb57
Apply suggestions from code review
npentrel a58d05d
Merge branch 'main' into test-flake8
npentrel 6e3895f
Update _index.md
npentrel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[flake8] | ||
extend-ignore = F704, F821, F401, F841 | ||
exclude = .git,build,dist | ||
max-complexity = 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Lint Python Code Snippets | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
python_lint: | ||
name: Check Python snippets in Markdown files | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Flake8 Markdown linter | ||
run: pip3 install flake8-markdown | ||
|
||
- name: Markdown Lint | ||
run: flake8-markdown "docs/**/*.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This too! Surely this is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. flake8 says error - naomi fixes |
||
``` | ||
|
||
{{% alert title="Tip" color="tip" %}} | ||
|
@@ -253,7 +253,7 @@ To deserialize the returned information into a numpy array, use the Open3D libra | |
import numpy as np | ||
import open3d as o3d | ||
|
||
my_camera= Camera.from_robot(robot=robot, name="my_camera") | ||
my_camera = Camera.from_robot(robot=robot, name="my_camera") | ||
|
||
data, _ = await my_camera.get_point_cloud() | ||
|
||
|
@@ -306,7 +306,7 @@ Get the camera intrinsic parameters and camera distortion, as well as whether th | |
- [(Properties)](https://python.viam.dev/autoapi/viam/components/camera/index.html#viam.components.camera.Camera.Properties): The properties of the camera. | ||
|
||
```python {class="line-numbers linkable-line-numbers"} | ||
my_camera= Camera.from_robot(robot=robot, name="my_camera") | ||
my_camera = Camera.from_robot(robot=robot, name="my_camera") | ||
|
||
properties = await my_camera.get_properties() | ||
``` | ||
|
@@ -356,7 +356,7 @@ If you are implementing your own camera and adding features that have no native | |
- [(Dict[str, Any])](https://docs.python.org/3/library/stdtypes.html#typesmapping): Result of the executed command. | ||
|
||
```python {class="line-numbers linkable-line-numbers"} | ||
my_camera= Camera.from_robot(robot, "my_camera") | ||
my_camera = Camera.from_robot(robot, "my_camera") | ||
|
||
command = {"cmd": "test", "data1": 500} | ||
result = my_camera.do(command) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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???There was a problem hiding this comment.
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