-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ControlAI/docs/initial-docs
docs: current docs state in prep for release. still missing concepts …
- Loading branch information
Showing
51 changed files
with
721 additions
and
233 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,25 @@ | ||
name: docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- uses: actions/cache@v2 | ||
with: | ||
key: ${{ github.ref }} | ||
path: .cache | ||
|
||
- run: pip install -r requirements-docs.txt | ||
- run: mkdocs gh-deploy --force |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# classifier | ||
|
||
::: pytorch_lattice.classifier.Classifier |
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,3 @@ | ||
# constrained_module | ||
|
||
::: pytorch_lattice.constrained_module.ConstrainedModule |
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,3 @@ | ||
# datasets | ||
|
||
::: pytorch_lattice.datasets |
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,3 @@ | ||
# enums | ||
|
||
::: pytorch_lattice.enums |
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,3 @@ | ||
# feature_config | ||
|
||
::: pytorch_lattice.feature_config |
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,9 @@ | ||
# layers | ||
|
||
::: pytorch_lattice.layers.CategoricalCalibrator | ||
|
||
::: pytorch_lattice.layers.Lattice | ||
|
||
::: pytorch_lattice.layers.Linear | ||
|
||
::: pytorch_lattice.layers.NumericalCalibrator |
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,3 @@ | ||
# model_configs | ||
|
||
::: pytorch_lattice.model_configs |
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,9 @@ | ||
# models | ||
|
||
::: pytorch_lattice.models.CalibratedLattice | ||
|
||
::: pytorch_lattice.models.CalibratedLinear | ||
|
||
::: pytorch_lattice.models.features.CategoricalFeature | ||
|
||
::: pytorch_lattice.models.features.NumericalFeature |
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,3 @@ | ||
# plots | ||
|
||
::: pytorch_lattice.plots |
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,5 @@ | ||
# utils | ||
|
||
::: pytorch_lattice.utils.data | ||
|
||
::: pytorch_lattice.utils.models |
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
# Calibrators | ||
|
||
Coming soon... |
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,3 @@ | ||
# Classifier | ||
|
||
Coming soon... |
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,3 @@ | ||
# Model Types | ||
|
||
Coming soon... |
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,3 @@ | ||
# Plotting | ||
|
||
Coming soon... |
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,3 @@ | ||
# Shape Constraints | ||
|
||
Coming soon... |
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,102 @@ | ||
# Contributing | ||
|
||
## Setting Up Development Environment | ||
|
||
First, [install pyenv](https://github.com/pyenv/pyenv#installation) so you can run the code under all of the supported environments. Also make sure to [install pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv#installation) so you can create python environments with the correct versions. | ||
|
||
To install a specific version of python, you can run e.g. `pyenv install 3.10.9`. You can then create a virtual environment to run and test code locally during development by running the following code from the base directory: | ||
|
||
```sh | ||
pyenv virtualenv {python_version} env-name | ||
pyenv activate env-name | ||
pip install poetry | ||
poetry install | ||
``` | ||
|
||
If you'd prefer, you can also use conda to manage your python versions and environments. For installing conda, see their [installation guide](https://conda.io/projects/conda/en/latest/user-guide/install/index.html). | ||
|
||
The following code is an example of how to set up such an environment: | ||
|
||
```sh | ||
conda create -n env-name pip poetry python={python_version} | ||
conda activate env-name | ||
poetry install | ||
``` | ||
|
||
Make sure to replace `{python_version}` in the above snippets with the version you want the environment to use (e.g. 3.10.9) and name the environment accordingly (e.g. env-name-3.10). | ||
|
||
## Development Workflow | ||
|
||
1. Search through existing [GitHub Issues](https://github.com/ControlAI/pytorch-lattice/issues) to see if what you want to work on has already been added. | ||
|
||
- If not, please create a new issue. This will help to reduce duplicated work. | ||
|
||
2. For first-time contributors, visit [https://github.com/ControlAI/pytorch-lattice](https://github.com/ControlAI/pytorch-lattice) and "Fork" the repository (see the button in the top right corner). | ||
|
||
- You'll need to set up [SSH authentication](https://docs.github.com/en/authentication/connecting-to-github-with-ssh). | ||
|
||
- Clone the forked project and point it to the main project: | ||
|
||
```shell | ||
git clone https://github.com/<your-username>/pytorch-lattice.git | ||
git remote add upstream https://github.com/ControlAI/pytorch-lattice.git | ||
``` | ||
|
||
3. Development. | ||
|
||
- Make sure you are in sync with the main repo: | ||
|
||
```shell | ||
git checkout dev | ||
git pull upstream dev | ||
``` | ||
|
||
- Create a `git` feature branch with a meaningful name where you will add your contributions. | ||
|
||
```shell | ||
git checkout -b meaningful-branch-name | ||
``` | ||
|
||
- Start coding! commit your changes locally as you work: | ||
|
||
```shell | ||
git add pytorch-lattice/modified_file.py tests/test_modified_file.py | ||
git commit -m "feat: specific description of changes contained in commit" | ||
``` | ||
|
||
- Format your code! | ||
|
||
```shell | ||
poetry run ruff format . | ||
``` | ||
|
||
- Lint and test your code! From the base directory, run: | ||
|
||
```shell | ||
poetry run ruff check . | ||
poetry run mypy . | ||
``` | ||
|
||
4. Contributions are submitted through [GitHub Pull Requests](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) | ||
|
||
- When you are ready to submit your contribution for review, push your branch: | ||
|
||
```shell | ||
git push origin meaningful-branch-name | ||
``` | ||
|
||
- Open the printed URL to open a PR. Make sure to fill in a detailed title and description. Submit your PR for review. | ||
|
||
- Link the issue you selected or created under "Development" | ||
|
||
- We will review your contribution and add any comments to the PR. Commit any updates you make in response to comments and push them to the branch (they will be automatically included in the PR) | ||
|
||
### Pull Requests | ||
|
||
Please conform to the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for all PR titles and commits. | ||
|
||
## Formatting & Linting | ||
|
||
In an effort to keep the codebase clean and easy to work with, we use `ruff` for formatting and both `ruff` and `mypy` for linting. Before sending any PR for review, make sure to run both `ruff` and `mypy`. | ||
|
||
If you are using VS Code, then install the extensions in `.vscode/extensions.json` and the workspace settings should automatically run `ruff` formatting on save and show `ruff` and `mypy` errors. |
Oops, something went wrong.