Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 21.5b1
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
rev: v1.10.0
hooks:
- id: mypy
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
hooks:
- id: pycln
args: [--config=pyproject.toml]
8 changes: 8 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- id: pdoc
name: pdoc
description: 'pdoc: Auto-generate API documentation for Python projects'
entry: pdoc
language: python
language_version: python3
require_serial: true
types: [python]
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2021 Qiangqiang Huang
Copyright (c) 2024 Alan Papalia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Manhattan Simulator

This is a repository for generating random Manhattan-World-style 2D experiments.
This is a repository for generating random Manhattan-World-style 2D experiments.

While custom measurements are easy to add, currently supported measurement types include:

Expand All @@ -19,37 +19,37 @@ you will need to install PyFactorGraph via:
```bash
git clone [email protected]:MarineRoboticsGroup/PyFactorGraph.git
cd PyFactorGraph
pip install .
pip3 install .
```

## Contributing

This repo is set up so that contributions will have consistent style and pass
some static type checks. The code styling is enforced through `black`, and helps
to improve the cleanliness, consistency, and readability of commits.
If you want to contribute a new feature to this package please read this brief section.

The static type checking is performed by `mypy` and helps to prevent bugs by
ensuring that object type expectations are being maintained. In addition, it
requires thoughtful type-annotation to improve the readability and
maintainability of the code in the future.
### Code Standards

We run these through both `Github Actions` and the `pre-commit` framework, which
allow us to check our code before committing and then perform some quality tests
on the code once it has been committed. `Github Actions` does not require any
further setup to be used, the tests will be run when the code is pushed.
Any necessary coding standards are enforced through `pre-commit`. This will run
a series of `hooks` when attempting to commit code to this repo. Additionally,
we run a `pre-commit` hook to auto-generate the documentation of this library to
make sure it is always up to date.

The [`pre-commit`](https://pre-commit.com/#intro) framework lets you make sure
the tests will pass before pushing the code. To set it up and use it all you
need to do is run the following commands:
To set up `pre-commit`

``` Bash
# install pre-commit
```bash
cd ~/manhattan-world-sim
pip3 install pre-commit
pre-commit install # must run this command in the root of this repo
pre-commit install
```

### Testing

If you want to develop this package and test it from an external package you can
also install via

```bash
cd ~/manhattan-world-sim
pip3 install -e .
```

Now, when you try to make a commit, pre-commit will run a series of tests that
must be passed. In the event that the code can be easily changed, mostly in the
case of reformatting, `pre-commit` will often make the change for you. From here
you can just run `git diff` to see the changes made, verify they're correct, add
the changes, and attempt the recommit.
The `-e` flag will make sure that any changes you make here are automatically
translated to the external library you are working in.
Empty file added py.typed
Empty file.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Pre-commit hooks related config.
[tool.pycln]
all = true
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ classifiers =

[options.packages.find]
exclude = examples*

[options.package_data]
manhattan = py.typed