FINCH Predictive Coder Neural Network.
A full end-to-end implementation of the CSNN state-of-the-art compression algorithm for hyperspectral image data. Developed by the University of Toronto Aerospace Team 🌌.
Check out the interactive Google Colab notebooks to start tinkering.
This section will take you through the procedure to configure your development environment. At a glance:
- Install project's python version
- Install git
- Install poetry
- Clone repository
- Run poetry install
- Configure IDE virtual environment
- Install pre-commit hooks
Begin by installing the project's python version. See the badges at the top of the README for the version number.
If not already installed, install git.
The repo employs poetry as its dependency and environment manager. Poetry can be installed through the Windows Powershell via:
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python -
Clone the repo using Github Desktop or the commandline via:
git clone https://github.com/DM1122/fpcnn.git
From within the cloned repo, run poetry's install command to install all the dependencies in one go:
poetry install
Configure your IDE to use the virtual environment poetry has created at C:\Users\<USERNAME>\AppData\Local\pypoetry\Cache\virtualenvs
. In the case of VSCode , enter the command pallet by going to View>Command Palette
and search for Python:Select Interpreter
. Select the appropriate poetry virtual environment for the repo. Restart VSCode if you do not see it listed.
Install the pre-commit script and hooks using:
pre-commit install --install-hooks
You're now ready to start contributing!
To add a new package to the poetry virtual environment, install it via:
poetry add <package>
This is poetry's version of pip install <package>
.
This repo uses pytest for unit testing. To run all unit tests, call:
pytest -v
You can find an interactive report of test results in ./logs/pytest/pytest-report.html
. Individual tests can also be specified as follows:
pytest tests/test_<filename>.py::<function name>
Groups of tests can be run using markers. Assign a marker decorator to the group of functions you want to test like this:
@pytest.mark.foo
def my_test_function():
# some test
To use the custom marker foo
, it must be added to the list of custom pytest markers in pyproject.toml>[tool.pytest.ini_options]>markers
. The tests marked with foo
can then be run by calling:
pytest -v -m foo
Or to avoid all tests with a particular marker, call:
pytest -v -m "not foo"
This repo is configured to use pre-commit hooks. The pre-commit pipeline is as follows:
- Isort: Sorts imports, so you don't have to.
- Black: The uncompromising code autoformatter.
- Pylint: It's not just a linter that annoys you!
Pre-commit will run the hooks on commit, but when a hook fails, they can be run manually to delint using:
isort . & black . & pylint_runner
To improve the organization of this repository and reduce conflicts, branches will be organized as follow:
main
- the branch containing the most recent working release. All code in this branch should run perfectly without any errors.dev
- branched off ofmain
; the most updated version of the project with the newest features and bug fixes.features/<feature-name>
- branched off ofdev
; a feature branch. Features must be tested thoroughly before being merged into dev
For more information check out: https://gist.github.com/digitaljhelms/4287848
You can create a new task as follows:
- Navigate to the "Projects" tab
- Create a new task in the "To Do" column
- Click on the three dots in the top right corner of the card and select "Convert to issue"
- [Optional] Assign yourself or somebody else to the issue
- [Optional] Add the issue to a milestone (useful for breaking a large task into smaller tickets)
- Select your issue (either on Projects board or through the "Issues" tab)
- Change the status of the issue to "In Progress" (either slide the card to the "In Progress" column in the Projects board, or change the status on the issue's page)
- Create a new branch of the form
features/<feature-name>
, do some ✨ m a g i c ✨, and create a Pull Request (make sure you assign our Project board to the PR) - Request a teammate for code review, and link your PR to its respective issue
- If all goes well, merge it in :D