Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose definition-of-done and put in template #205

Closed
12 tasks
gijsber opened this issue May 12, 2023 · 4 comments
Closed
12 tasks

Compose definition-of-done and put in template #205

gijsber opened this issue May 12, 2023 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation test Relates to unit testing

Comments

@gijsber
Copy link
Contributor

gijsber commented May 12, 2023

If we agree on this list we can move it to an issue template

Typically new node-types require update of:

  • core\src\create.jl
  • core\src\validation.jl
  • core\src\solve.jl

Updating other jl-files may depend on needs

ribasim_python

  • newnodetype.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/updae nodetype to python\ribasim_api\tests\conftest.py

documentation

  • update docs\core\equations.qmd
  • update docs\core\usage.qmd
  • update docs\python\examples.ipynb
  • update docs\schema*.json

QGIS

  • update qgis\core\nodes.py
@gijsber gijsber added documentation Improvements or additions to documentation test Relates to unit testing labels May 12, 2023
@gijsber gijsber added this to Ribasim May 12, 2023
@github-project-automation github-project-automation bot moved this to 🔲 Todo in Ribasim May 12, 2023
@evetion
Copy link
Member

evetion commented May 15, 2023

When a new node type is created, one needs to run

julia --project=docs docs/gen_schema.jl

to create new jsonschemas in the docs folder, and

datamodel-codegen --use-title-as-name --input docs/schema/root.schema.json --output python/ribasim/ribasim/models.py

to generate the Python models from it.

This should be followed by black python to format the generated code.

@Hofer-Julian Hofer-Julian changed the title compose definition-of-done and put in template Compose definition-of-done and put in template May 15, 2023
@SnippenE SnippenE moved this from To do to Sprint backlog in Ribasim May 16, 2023
@SnippenE SnippenE moved this from Sprint backlog to To do in Ribasim May 16, 2023
@SouthEndMusic
Copy link
Collaborator

julia --project=docs docs/gen_schema.jl

@evetion running this script requires the package JSON3, but adding this to the Julia environment makes a test fail, saying that it was not loaded via using Ribasim.

@visr
Copy link
Member

visr commented May 18, 2023

The --project=docs here should activate this environment, which has JSON3: https://github.com/Deltares/Ribasim/blob/main/docs/Project.toml

The reason we use a separate environment is to avoid having to add JSON3 as a dependency for Ribasim itself.

If you haven't done so before, you first need to instantiate your docs environment, you could run julia --project=docs, followed by running instantiate in the Pkg mode (]). Or simply running up also does the trick.

https://deltares.github.io/Ribasim/contribute/core.html#run-ribasim-simulations

@SouthEndMusic
Copy link
Collaborator

Ok, thanks for the clarification.

visr added a commit that referenced this issue May 19, 2023
This is my first draft of how to add a new node type. Please let me know
if anything is incorrect or incomplete in such a way that I can fix it,
so that it helps me understand the code better. Informed by #205.

---------

Co-authored-by: Bart de Koning <bart123-4@hotmail.com>
Co-authored-by: Martijn Visser <mgvisser@gmail.com>
Hofer-Julian pushed a commit that referenced this issue May 19, 2023
This is my first draft of how to add a new node type. Please let me know
if anything is incorrect or incomplete in such a way that I can fix it,
so that it helps me understand the code better. Informed by #205.

---------

Co-authored-by: Bart de Koning <bart123-4@hotmail.com>
Co-authored-by: Martijn Visser <mgvisser@gmail.com>
@SnippenE SnippenE moved this from To do to Sprint backlog in Ribasim May 25, 2023
@evetion evetion moved this from Sprint backlog to 🏗 In progress in Ribasim Jun 1, 2023
@SnippenE SnippenE moved this from 🏗 In progress to ✅ Done in Ribasim Jun 8, 2023
@evetion evetion closed this as completed Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation test Relates to unit testing
Projects
Archived in project
Development

No branches or pull requests

4 participants