mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-04-22 17:42:55 +02:00
3.6 KiB
3.6 KiB
Contribution guidelines
Dev Setup
- Install Python 3.11
- Install Poetry
- Install GiT
- Configure GiT
- Generate an SSH Key & Add SSH Key to GitHub
- Clone the Project (IDE Specific)
- Install the python Project
Repository structure
-
src/
aki_prj23_transparenzregister
:- This sub-folder/
package
contains several subdirectories:ai
:- Houses AI models and pipelines, including NER and sentiment analysis.
config
:- Contains configuration files such as database connection strings and model files.
models
:- Stores data models.
ui
:- Manages the user interface and dash interface.
utils
:- Contains general tooling functions, including database access and other miscellaneous functions.
- This sub-folder/
-
tests:
- Test files organized in a mirrored structure of the 'src' folder. Please at least import every python file you add. Please Try to test every function with a test that compares with an example result. If that is not possible it would be best to find a big consensus that only limited testing is required.
Code style
We defined to use the following formats:
- Whitespace Formatting by Black
- Docstrings Style see the examples provided by sphinx napoleon Types in the docstrings are optional but should be consistent per module.
- Import Order by isort
- Strict Typing of function headers see the examples provided by the mypy documentation.
- The generell linting is done by ruff but since ruff is a reimplementation of ruff of many different linters the old documentations are still valid.
- Ruff can be executed with the
ruff .
command. May errors are auto-fixable withruff --fix .
if they are straight forward changes.
Language
We decided to use english on everything close to code but will write longer texts that are not close to the code in german.
Pre-Commit Usage
-
Install pre-commit
pre-commit install --install-hooks -t post-checkout -t post-merge -t pre-commit
-
the following code format rules are so enforced:
-
for more information read Python Pre-Commit