Skip to content

Commit

Permalink
docs: updated contribution guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
kieran-mackle committed Dec 16, 2023
1 parent d49c5b5 commit 61efd16
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 96 deletions.
102 changes: 10 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ defined by hyperpatches. Check out the
</ul>
</li>
<li><a href="#usage">Usage</a></li>
<li><a href="#contributing">Contributing</a></li>
</ol>
</details>

Expand Down Expand Up @@ -61,16 +60,22 @@ python3 -m pip install -e ./
cd ../../../
```

#### PyMesh

Having [PyMesh](https://github.com/PyMesh/PyMesh) installed can greatly enhance the capabilities
offered by `HyperVehicle`. However, it can be difficult to install. Troubleshooting
guide coming soon.


### Installation

First clone the repository, then install via pip as an editable install.
To install `hypervehicle` from source, use the command below.

```
git clone https://github.com/kieran-mackle/hypervehicle
cd hypervehicle
python3 -m pip install -e ./
pip install git+https://github.com/kieran-mackle/hypervehicle
```


<p align="right">[<a href="#readme-top">back to top</a>]</p>


Expand All @@ -79,90 +84,3 @@ Please see the [example geometry generation](docs/source/examples/x43.md)
to generate a mockup of the X-43A, shown above.

<p align="right">[<a href="#readme-top">back to top</a>]</p>



## Contributing

<!-- start contribution guidelines -->

To contribute to `hypervehicle`, please read the instructions below
to maintain the styling of the code.

### Setting up for Development

1. Create a new Python virtual environment to isolate the package. You
can do so using [`venv`](https://docs.python.org/3/library/venv.html) or
[anaconda](https://www.anaconda.com/).

2. Install the code in editable mode using the command below (run from
inside the `hypervehicle` root directory).

```
pip install -e .[all]
```

3. Install the [pre-commit](https://pre-commit.com/) hooks.

```
pre-commit install
```

4. Start developing! After following the steps above, you are ready
to start developing the code. Make sure to follow the guidelines
below.


### Developing *hypervehicle*

- Before making any changes, create a new branch to develop on using
`git checkout -b new-branch-name`.

- Run [black](https://black.readthedocs.io/en/stable/index.html) on any
code you modify. This formats it according to
[PEP8](https://peps.python.org/pep-0008/) standards.

- Document as you go: use
[numpy style](https://numpydoc.readthedocs.io/en/latest/format.html)
docstrings, and add to the docs where relevant.

- Write unit tests for the code you add, and include them in `tests/`.
This project uses [pytest](https://docs.pytest.org/en/7.2.x/).

- Commit code regularly to avoid large commits with many changes.

- Write meaningful commit messages, following the
[Conventional Commits standard](https://www.conventionalcommits.org/en/v1.0.0/).
The python package [commitizen](https://commitizen-tools.github.io/commitizen/)
is a great tool to help with this, and is already configured for this
repo. Simply stage changed code, then use the `cz c` command to make a
commit.

- Open a [Pull Request](https://github.com/kieran-mackle/hypervehicle/pulls)
when your code is complete and ready to be merged.


### Building the Docs
To build the documentation, run the commands below.

```
cd docs/
make html
xdg-open build/html/index.html
```

If you are actively developing the docs, consider using
[sphinx-autobuild](https://pypi.org/project/sphinx-autobuild/).
This will continuosly update the docs for you to see any changes
live, rather than re-building repeatadly. From the `docs/`
directory, run the following command:

```
sphinx-autobuild source/ build/html --open-browser
```

<!-- end contribution guidelines -->

<p align="right">[<a href="#readme-top">back to top</a>]</p>


2 changes: 1 addition & 1 deletion docs/source/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pip install hypervehicle
```

### Installation from source
First clone the repository, then install via pip.
To install `hypervehicle` from source, use the command below.

```
pip install git+https://github.com/kieran-mackle/hypervehicle
Expand Down
86 changes: 83 additions & 3 deletions docs/source/other/contributing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,86 @@
# Contribution Guidelines

```{include} ../../../README.md
:start-after: <!-- start contribution guidelines -->
:end-before: <!-- end contribution guidelines -->
To contribute to `HyperVehicle`, please read the instructions below
to maintain the styling of the code.


## Seek Feedback Early
Please open an [issue](https://github.com/kieran-mackle/hypervehicle/issues) before a
[pull request](https://github.com/kieran-mackle/hypervehicle/pulls) to discuss any
changes you wish to make.


## Setting up for Development

1. Create a new Python virtual environment to isolate the package. You
can do so using [`venv`](https://docs.python.org/3/library/venv.html) or
[anaconda](https://www.anaconda.com/).

2. Install the code in editable mode using the command below (run from
inside the `hypervehicle` root directory).

```
pip install -e .[all]
```

3. Install the [pre-commit](https://pre-commit.com/) hooks. This will check
that your changes are formatted correctly before you make any commits.

```
pre-commit install
```

4. Start developing! After following the steps above, you are ready
to start developing the code. Make sure to follow the guidelines
below.


## Developing *HyperVehicle*

- Before making any changes, fork this repository and clone it to your machine.

- Run [black](https://black.readthedocs.io/en/stable/index.html) on any
code you modify. This formats it according to
[PEP8](https://peps.python.org/pep-0008/) standards.

- Document as you go: use
[numpy style](https://numpydoc.readthedocs.io/en/latest/format.html)
docstrings, and add to the docs where relevant.

- Write unit tests for the code you add, and include them in `tests/`.
This project uses [pytest](https://docs.pytest.org/en/7.2.x/).

- Commit code regularly to avoid large commits with many unrelated changes.

- Write meaningful commit messages, following the
[Conventional Commits standard](https://www.conventionalcommits.org/en/v1.0.0/).
This is used for the purpose of maintaining semantic versioning and automated
[changelogs](../changelog).
The Python package [`commitizen`](https://commitizen-tools.github.io/commitizen/)
is a great tool to help with this, and is already configured for this
repo. Simply stage changed code, then use the `cz c` command to make a
commit. If you do not wish to do this, your commits will be squashed before being
merged into `main`.

- Open a [Pull Request](https://github.com/kieran-mackle/hypervehicle/pulls)
when your code is complete and ready to be merged.


## Building the Docs
To build the documentation, run the commands below.

```
cd docs/
make html
xdg-open build/html/index.html
```

If you are actively developing the docs, consider using
[sphinx-autobuild](https://pypi.org/project/sphinx-autobuild/).
This will continuosly update the docs for you to see any changes
live, rather than re-building repeatadly. From the root
directory, run the following command:

```
sphinx-autobuild docs/source/ docs/build/html --open-browser
```

0 comments on commit 61efd16

Please sign in to comment.