From f503acb8674a6c59153298f655d036d82e1d2107 Mon Sep 17 00:00:00 2001 From: Maarten Pronk Date: Tue, 12 Sep 2023 13:56:14 +0200 Subject: [PATCH] Add documentation for Config generation. --- .github/pull_request_template.md | 2 +- docs/contribute/addnode.qmd | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e2e198a22..d1149de66 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -29,7 +29,7 @@ Updating other julia files may be required. - 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 `docs/schema*.json` by running `julia --project=docs docs/gen_schema.jl` and `datamodel-codegen --use-title-as-name --use-double-quotes --input docs/schema/root.schema.json --output python/ribasim/ribasim/models.py` and `datamodel-codegen --use-title-as-name --use-double-quotes --input docs/schema/Config.schema.json --output python/ribasim/ribasim/config.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 diff --git a/docs/contribute/addnode.qmd b/docs/contribute/addnode.qmd index 3c15e841f..ed2f047ea 100644 --- a/docs/contribute/addnode.qmd +++ b/docs/contribute/addnode.qmd @@ -247,10 +247,11 @@ If you haven't done so before, you first need to instantiate your docs environme Run `julia --project=docs`, followed by running `instantiate` in the Pkg mode (press `]`). ::: -To generate the Python module `models.py` from the JSON Schemas, run: +To generate the Python module `models.py` and `config.py` from the JSON Schemas, run: ``` -datamodel-codegen --use-title-as-name --input docs/schema/root.schema.json --output python/ribasim/ribasim/models.py +datamodel-codegen --use-title-as-name --use-double-quotes --input docs/schema/root.schema.json --output python/ribasim/ribasim/models.py +`datamodel-codegen --use-title-as-name --use-double-quotes --input docs/schema/Config.schema.json --output python/ribasim/ribasim/config.py` ``` Run [Black](python.qmd#sec-black) to format the generated code.