Skip to content
Merged
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: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
exclude: (^.pixi/)
repos:
- repo: local
hooks:
- id: ruff-format
name: Ruff format
entry: pixi run style
language: system
types_or: [python, pyi]
require_serial: true
stages: [pre-push, manual]
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Standaard setup voor python-projects bij HHNK. In de repo staan een aantal voorb

Onderstaand staat uitgewerkt welke software wordt gebruikt, hoe testen opgezet kunnen worden, projectopzet en meer.

# Installatie
Om deze repo goed neer te zetten moeten een aantal stappen worden genomen:
- `git clone` -> Clone de repo
- `pixi install` -> installeer de python environment (draai dit in de repo;`cd python-workflow-demo`)
- `pixi run postinstall`

# IDE
Voor de developer environment zijn er veel opties, we gebruiken [Visual Studio Code](https://code.visualstudio.com/download). Dit biedt goede integratie van notebooks en tal van andere extensions. Uiteindelijk zal persoonlijke voorkeur ook meespelen in de keuze. Om samenwerking binnen het team te bevorderen maken we alleen gebruik van vs-code.

Expand Down Expand Up @@ -38,6 +44,7 @@ Bij een mamba installatie kan het zijn dat de mamba installer niet in het window

# Env management
Meerdere opties. Zelf zijn we over aan het gaan naar Pixi vanaf Mamba.
Zie [pixi FAQ](https://pixi.sh/dev/misc/FAQ/) voor overview verschillende install methods.

### Conda

Expand Down Expand Up @@ -129,6 +136,12 @@ convention = "numpy"
disable = ["W1203"]
```


# Git Hooks
We installeren Git Hooks om automatisch bepaalde controles te doen voordat we code naar GitHub mogen pushen. Installatie gaat mee met `pixi run postinstall` of kan achteraf bijgewerkt worden met `pixi run pre-commit-install`.

De hooks staan in de `.pre-commit-config.yaml`. In deze repo wordt bij een Push naar de remote gecontrolleerd op formatting door Ruff.

# Jupyter
We gebruiken de python interactive window, zie https://code.visualstudio.com/docs/python/jupyter-support-py voor uitleg. Komt erop neer dat we geen `.ipynb` nodig hebben en alles in `.py` kunnen ontwikkelen door middel van code cells gescheiden door: `# %%`. Dit is voor versiebeheer een must omdat `.ipynb` veel andere dingen dan code opslaat. Mocht je nog in een [juypterlab](https://jupyter.org/) omgeving in de browser werken, dan is de [jupytext](https://jupytext.readthedocs.io/en/latest/) een oplossing.

Expand Down
9 changes: 9 additions & 0 deletions bin/install_hrt.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@ECHO OFF

@REM IF NOT EXISTS "..\hhnk-theedi-tools"
@REM htt = "pip install --no-build-isolation --no-deps --disable-pip-version-check -e ../hhnk-threedi-tools"

IF NOT EXIST "..\hhnk-research-tools" (
git clone https://github.com/HHNK/hhnk-research-tools/ ..\hhnk-research-tools
)
pip install --no-deps -e ..\hhnk-research-tools
7 changes: 7 additions & 0 deletions bin/install_htt.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@REM IF NOT EXISTS "..\hhnk-theedi-tools"
@REM htt = "pip install --no-build-isolation --no-deps --disable-pip-version-check -e ../hhnk-threedi-tools"

IF NOT EXIST "..\hhnk-threedi-tools" (
git clone https://github.com/threedi/hhnk-threedi-tools/ ..\hhnk-threedi-tools
)
pip install --no-build-isolation --no-deps --disable-pip-version-check -e ../hhnk-threedi-tools
Loading
Loading