-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pre-commit hooks, Ruff formatting and linting (#42)
- Loading branch information
Showing
133 changed files
with
6,103 additions
and
3,580 deletions.
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,19 @@ | ||
name: pre-commit hooks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11.5 | ||
|
||
- uses: pre-commit/action@v3.0.0 |
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,17 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
args: [--unsafe] | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.11 | ||
hooks: | ||
- id: ruff | ||
# types_or: [ python, pyi, jupyter ] | ||
|
||
- id: ruff-format | ||
# types_or: [ python, pyi, jupyter ] |
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,34 @@ | ||
# Developer's Guide | ||
|
||
This guide describes how to complete various tasks you'll encounter when working | ||
on the Bayes3D codebase. | ||
|
||
### Commit Hooks | ||
|
||
We use [pre-commit](https://pre-commit.com/) to manage a series of git | ||
pre-commit hooks for the project; for example, each time you commit code, the | ||
hooks will make sure that your python is formatted properly. If your code isn't, | ||
the hook will format it, so when you try to commit the second time you'll get | ||
past the hook. | ||
|
||
All hooks are defined in `.pre-commit-config.yaml`. To install these hooks, | ||
install `pre-commit` if you don't yet have it. I prefer using | ||
[pipx](https://github.com/pipxproject/pipx) so that `pre-commit` stays globally | ||
available. | ||
|
||
```bash | ||
pipx install pre-commit | ||
``` | ||
|
||
Then install the hooks with this command: | ||
|
||
```bash | ||
pre-commit install | ||
``` | ||
|
||
Now they'll run on every commit. If you want to run them manually, run the | ||
following command: | ||
|
||
```bash | ||
pre-commit run --all-files | ||
``` |
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 |
---|---|---|
|
@@ -7469,4 +7469,4 @@ f 2411 1493 2503 | |
f 1493 1487 2503 | ||
f 1487 1318 2503 | ||
f 1318 1320 2503 | ||
f 1320 2443 2503 | ||
f 1320 2443 2503 |
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 |
---|---|---|
|
@@ -13,4 +13,4 @@ f 6 5 4 | |
f 6 4 3 | ||
f 6 3 2 | ||
f 6 2 1 | ||
f 6 1 5 | ||
f 6 1 5 |
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 |
---|---|---|
|
@@ -29,4 +29,4 @@ f 12 11 6 | |
f 10 9 5 | ||
f 8 3 9 | ||
f 10 8 9 | ||
f 2 8 10 | ||
f 2 8 10 |
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 |
---|---|---|
|
@@ -26,4 +26,4 @@ f 4//4 8//8 3//3 | |
f 7//7 5//5 3//3 | ||
f 3//3 8//8 7//7 | ||
f 7//7 6//6 5//5 | ||
f 8//8 6//6 7//7 | ||
f 8//8 6//6 7//7 |
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 |
---|---|---|
|
@@ -9,4 +9,4 @@ f 3 4 2 | |
f 5 2 1 | ||
f 4 5 1 | ||
f 3 5 4 | ||
f 5 3 2 | ||
f 5 3 2 |
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 |
---|---|---|
@@ -1,24 +1,12 @@ | ||
""" | ||
.. include:: ./documentation.md | ||
""" | ||
from .transforms_3d import * | ||
|
||
from .camera import * | ||
from .likelihood import * | ||
from .renderer import * | ||
from .rgbd import * | ||
from .likelihood import * | ||
from .camera import * | ||
from .transforms_3d import * | ||
from .viz import * | ||
from . import utils | ||
from . import distributions | ||
from . import scene_graph | ||
from . import colmap | ||
|
||
try: | ||
import genjax | ||
from .genjax import * | ||
except ImportError as e: | ||
print("GenJAX not installed. Importing bayes3d without genjax dependencies.") | ||
print(e) | ||
|
||
|
||
|
||
RENDERER = None |
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.