diff --git a/.gitattributes b/.gitattributes index fc0357825..6313b56c5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1 @@ -* text=auto - -**/Project.toml eol=lf -**/Manifest.toml eol=lf -**/*.json eol=lf +* text=auto eol=lf diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e2e198a22..5fbd04046 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,36 +1 @@ Fixes # - -# Description - - - - ---- -text below is for instruction and can be removed - -# New node types -Typically new node types require an update of: - -- `core/src/create.jl` -- `core/src/validation.jl` -- `core/src/solve.jl` - -Updating other julia files may be required. - - -## ribasim_python -- `new_node_type.py` with associated implementation in `python/ribasim/ribasim`. -- add/update nodetype to `python/ribasim/ribasim/model.py` -- add/update nodetype to `python/ribasim/tests/conftest.py` -- add/update nodetype to `python/ribasim_api/tests/conftest.py` - -## documentation - -- update `docs/core/equations.qmd` -- update `docs/core/usage.qmd` -- update `docs/python/examples.ipynb` # or start a new example model -- update `docs/schema*.json` by running `julia --project=docs docs/gen_schema.jl` and `datamodel-codegen --use-title-as-name --input docs/schema/root.schema.json --output python/ribasim/ribasim/models.py` -- update the instructions in `docs/contribute/*.qmd` if something changes there, e.g. something changes in how a new node type must be defined. - -## QGIS -- update `qgis/core/nodes.py` diff --git a/.github/workflows/core_tests.yml b/.github/workflows/core_tests.yml index 8b3367920..4a840f735 100644 --- a/.github/workflows/core_tests.yml +++ b/.github/workflows/core_tests.yml @@ -13,9 +13,6 @@ jobs: test: name: Julia ${{ matrix.julia_version }} - ${{ matrix.os }} - ${{ matrix.arch }} runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} strategy: fail-fast: false matrix: @@ -28,19 +25,16 @@ jobs: arch: - x64 steps: - - uses: actions/checkout@v3 - - name: Setup Micromamba - uses: mamba-org/setup-micromamba@v1 + - uses: actions/checkout@v4 + - uses: prefix-dev/setup-pixi@v0.2.1 with: - cache-downloads: true - cache-environment: true - environment-file: ./environment.yml - - name: Install ribasim - run: pip install --editable python/ribasim - - name: Install ribasim_testmodels - run: pip install --editable python/ribasim_testmodels + pixi-version: "v0.3.0" + cache: true + - name: Prepare pixi + run: pixi run post-install-without-pre-commit - name: Prepare model input - run: python python/ribasim/tests/conftest.py + run: | + pixi run generate-testmodels - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.julia_version }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e4dc493ed..566187765 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,9 +14,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - defaults: - run: - shell: bash -l {0} strategy: matrix: julia_version: @@ -24,7 +21,7 @@ jobs: arch: - x64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: @@ -40,38 +37,24 @@ jobs: cache-compiled: "true" cache-registries: "true" - - name: Setup Micromamba - uses: mamba-org/setup-micromamba@v1 + - uses: prefix-dev/setup-pixi@v0.2.1 with: - cache-downloads: true - cache-environment: true - environment-file: ./environment.yml - - - name: Install ribasim-python - run: pip install --editable python/ribasim - - - name: Set up Quarto - uses: quarto-dev/quarto-actions/setup@v2 + pixi-version: "v0.3.0" + cache: true + - name: Prepare pixi + run: pixi run post-install-without-pre-commit - name: Check Quarto installation and all engines - run: quarto check all - - - name: Generate API pages - working-directory: docs - # objects.json: https://github.com/machow/quartodoc/issues/63 - run: | - quartodoc build - rm objects.json + run: pixi run quarto-check - name: Generate Julia docs - working-directory: docs - run: | - julia --project -e "using Pkg; Pkg.instantiate()" - julia --project make.jl + run: pixi run build-julia-docs - name: Render Quarto Project - run: "quarto render docs --to html --execute" + run: pixi run quarto-render + - name: Set up Quarto for publish + uses: quarto-dev/quarto-actions/setup@v2 - name: Publish Quarto Project if: github.ref == 'refs/heads/main' uses: quarto-dev/quarto-actions/publish@v2 diff --git a/.github/workflows/pre-commit_auto_update.yml b/.github/workflows/pre-commit_auto_update.yml index bf4d418ae..bfe8f0621 100644 --- a/.github/workflows/pre-commit_auto_update.yml +++ b/.github/workflows/pre-commit_auto_update.yml @@ -11,7 +11,7 @@ jobs: auto-update: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} - uses: actions/setup-python@v4 diff --git a/.github/workflows/pre-commit_check.yml b/.github/workflows/pre-commit_check.yml index fbad75fd6..2876b910a 100644 --- a/.github/workflows/pre-commit_check.yml +++ b/.github/workflows/pre-commit_check.yml @@ -10,7 +10,7 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.11" diff --git a/.github/workflows/python_lint.yml b/.github/workflows/python_lint.yml index de6c69f28..eed8c083b 100644 --- a/.github/workflows/python_lint.yml +++ b/.github/workflows/python_lint.yml @@ -14,28 +14,20 @@ jobs: name: Mypy runs-on: ubuntu-latest continue-on-error: true - defaults: - run: - shell: bash -l {0} steps: - - uses: actions/checkout@v3 - - name: Setup Micromamba - uses: mamba-org/setup-micromamba@v1 + - uses: actions/checkout@v4 + - uses: prefix-dev/setup-pixi@v0.2.1 with: - cache-downloads: true - cache-environment: true - environment-file: ./environment.yml - - name: Install python packages - run: | - pip install python/ribasim - pip install python/ribasim_testmodels - pip install python/ribasim_api + pixi-version: "latest" + cache: true + - name: Prepare pixi + run: pixi run post-install-without-pre-commit - name: Run mypy on python/ribasim run: | - mypy --ignore-missing-imports python/ribasim/ribasim + pixi run mypy-ribasim-python - name: Run mypy on python/ribasim_testmodels run: | - mypy --ignore-missing-imports python/ribasim_testmodels/ribasim_testmodels + pixi run mypy-ribasim-testmodels - name: Run mypy on python/ribasim_api run: | - mypy --ignore-missing-imports python/ribasim_api/ribasim_api + pixi run mypy-ribasim-api diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index fcf173ba8..d7ecbf0b0 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -13,9 +13,6 @@ jobs: test: name: Python ${{ matrix.python_version }} - ${{ matrix.os }} - ${{ matrix.arch }} runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} strategy: fail-fast: false matrix: @@ -30,25 +27,17 @@ jobs: arch: - x86 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Setup Micromamba - uses: mamba-org/setup-micromamba@v1 + - uses: prefix-dev/setup-pixi@v0.2.1 with: - cache-downloads: true - cache-environment: true - environment-file: ./environment.yml - create-args: >- - python=${{ matrix.python_version }} - - - name: Install ribasim - run: pip install --editable python/ribasim - - - name: Install ribasim_testmodels - run: pip install --editable python/ribasim_testmodels + pixi-version: "v0.3.0" + cache: true + - name: Prepare pixi + run: pixi run post-install-without-pre-commit - name: Run tests - run: pytest --cov=ribasim --cov-report=xml python/ribasim/tests + run: pixi run test-ribasim-python-cov - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/.github/workflows/qgis.yml b/.github/workflows/qgis.yml index 6863ecd4e..788a7e059 100644 --- a/.github/workflows/qgis.yml +++ b/.github/workflows/qgis.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Launching docker compose run: ./start.sh - name: Running tests diff --git a/.gitignore b/.gitignore index 3b7e8d60e..bfd2e6525 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ docs/site/ # environment. /core/Manifest.toml -/data/ +/generated_testmodels build/create_binaries/ribasim_cli/ build/create_binaries/libribasim/ @@ -155,3 +155,5 @@ dmypy.json .vscode/settings.json /.luarc.json +build/ribasim_cli/tests/temp/ +report.xml diff --git a/.teamcity/Ribasim_Ribasim/buildTypes/BuildRibasimCliWindows.xml b/.teamcity/Ribasim_Ribasim/buildTypes/BuildRibasimCliWindows.xml index 5c080c704..59c901d25 100644 --- a/.teamcity/Ribasim_Ribasim/buildTypes/BuildRibasimCliWindows.xml +++ b/.teamcity/Ribasim_Ribasim/buildTypes/BuildRibasimCliWindows.xml @@ -9,7 +9,7 @@