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

Remove redundant depends sections from model schema #660

Open
davidorme opened this issue Jan 7, 2025 · 0 comments · May be fixed by #694
Open

Remove redundant depends sections from model schema #660

davidorme opened this issue Jan 7, 2025 · 0 comments · May be fixed by #694
Assignees

Comments

@davidorme
Copy link
Collaborator

davidorme commented Jan 7, 2025

The model JSON schema contain "depends" sections that we used to use to determine model execution order. This has been superseded by #548 , so we can should remove these sections and update the docs accordingly.

The stuff to be removed in each model JSON schema is the section like this:

            "depends": {
               "type": "object",
               "default": {},
               "properties": {
                  "init": {
                     "type": "array",
                     "default": [],
                     "items": {
                        "type": "string"
                     }
                  },
                  "update": {
                     "type": "array",
                     "default": [
                        "abiotic_simple"
                     ],
                     "items": {
                        "type": "string"
                     }
                  }
               }
            },

The corresponding docs then need to be replaced with a general statement about how VE tries to resolve the model execution order based on the variables:

#### Model dependencies
Your model may depend on a particular execution order for other models. For example, the
`freshwater` model might rely on data set up by the `hydrology` model, and so the
`hydrology` model needs to be initialised and updated before the `freshwater` model.
This is controlled using model configuration: although these dependencies may be
strong, it is more flexible to set them up through the configuration process than by
hard coding dependencies into the model objects themselves.
Your JSON Schema document therefore needs to include the following at the root level, so
that the model configuration includes a `[freshwater.depends]` section:
```json
"depends": {
"type": "object",
"default": {},
"properties": {
"init": {
"type": "array",
"default": ["hydrology"],
"items": {
"type": "string"
}
},
"update": {
"type": "array",
"default": ["hydrology"],
"items": {
"type": "string"
}
}
}
}
```

@davidorme davidorme added this to the Administrative stuff milestone Jan 7, 2025
@davidorme davidorme assigned davidorme and dalonsoa and unassigned davidorme Jan 8, 2025
@dalonsoa dalonsoa linked a pull request Jan 22, 2025 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants