diff --git a/docs/contribute/addnode.qmd b/docs/contribute/addnode.qmd index 491743c91..1a9005b37 100644 --- a/docs/contribute/addnode.qmd +++ b/docs/contribute/addnode.qmd @@ -239,26 +239,24 @@ There are several parts of the documentation which should be updated with the ne - `docs/core/equations` should contain a short explanation and if possible an analytical expression for the behaviour of the new node; - `docs/core/usage.qmd` should contain a short explanation of the node and the possible schemas associated with it; - The example models constructed in `docs/python/examples.ipynb` should be extended with the new node type or a new example model with the new node type should be made. +- In `_quarto.yml` add `NewNodeType` to the "Node types" contents for the Python API reference. + # Finishing up When a new node type is created, one needs to run ``` -julia --project=docs docs/gen_schema.jl +pixi run codegen ``` -to create new JSON Schemas in the docs folder. -:::{.callout-note} -If you haven't done so before, you first need to instantiate your docs environment. -Run `julia --project=docs`, followed by running `instantiate` in the Pkg mode (press `]`). -::: +This will derive all JSON Schemas from the julia code, and write them to the docs folder. +From these JSON Schemas the Python modules `models.py` and `config.py` are generated. -To generate the Python module `models.py` and `config.py` from the JSON Schemas, run: +Since adding a node type touches both the Python and Julia code, +it is a good idea to run both the [Python test suite](python.qmd#test) and [Julia test suite](core.qmd#test) locally before creating a pull request. +You can run all tests with: ``` -pixi run codegen +pixi run tests ``` - -Since adding a node type touches both the Python and Julia code, -it is a good idea to run both the [Python test suite](python.qmd#test) and [Julia test suite](core.qmd#test) locally before creating a pull request. diff --git a/pixi.toml b/pixi.toml index 5e8c8e362..1a4e15a13 100644 --- a/pixi.toml +++ b/pixi.toml @@ -72,7 +72,9 @@ test-ribasim-core = { cmd = "julia --project=core --eval 'using Pkg; Pkg.instant generate-testmodels = "python utils/generate-testmodels.py" tests = { depends_on = ["lint", "test-ribasim-python", "test-ribasim-core"] } # Codegen -generate-schema = "julia --project=docs docs/gen_schema.jl" +generate-schema = { cmd = "julia --project=docs docs/gen_schema.jl", depends_on = [ + "instantiate-julia-docs", +] } generate-python = """\ datamodel-codegen --use-title-as-name --use-double-quotes --disable-timestamp --use-default --strict-nullable --input-file-type=jsonschema --input docs/schema/root.schema.json --output python/ribasim/ribasim/models.py && \ datamodel-codegen --use-title-as-name --use-double-quotes --disable-timestamp --use-default --strict-nullable --input-file-type=jsonschema --input docs/schema/Config.schema.json --output python/ribasim/ribasim/config.py"""