rompy.core.config.BaseConfig#

pydantic model rompy.core.config.BaseConfig[source]#

Base class for model templates.

The template class provides the object that is used to set up the model configuration. When implemented for a given model, can move along a scale of complexity to suit the application.

In its most basic form, as implemented in this base object, it consists of path to a cookiecutter template with the class providing the context for the {{config}} values in that template. Note that any {{runtime}} values are filled from the ModelRun object.

If the template is a git repo, the checkout parameter can be used to specify a branch or tag and it will be cloned and used.

If the object is callable, it will be colled prior to rendering the template. This mechanism can be used to perform tasks such as fetching exteral data, or providing additional context to the template beyond the arguments provided by the user..

Show JSON schema
{
   "title": "BaseConfig",
   "description": "Base class for model templates.\n\nThe template class provides the object that is used to set up the model configuration.\nWhen implemented for a given model, can move along a scale of complexity\nto suit the application.\n\nIn its most basic form, as implemented in this base object, it consists of path to a cookiecutter template\nwith the class providing the context for the {{config}} values in that template. Note that any\n{{runtime}} values are filled from the ModelRun object.\n\nIf the template is a git repo, the checkout parameter can be used to specify a branch or tag and it\nwill be cloned and used.\n\nIf the object is callable, it will be colled prior to rendering the template. This mechanism can be\nused to perform tasks such as fetching exteral data, or providing additional context to the template\nbeyond the arguments provided by the user..",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "base",
         "default": "base",
         "title": "Model Type",
         "type": "string"
      },
      "template": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/rompy/templates/base",
         "description": "The path to the model template",
         "title": "Template"
      },
      "checkout": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "main",
         "description": "The git branch to use if the template is a git repo",
         "title": "Checkout"
      }
   },
   "additionalProperties": true
}

Fields:
field checkout: str | None = 'main'#

The git branch to use if the template is a git repo

field model_type: Literal['base'] = 'base'#
field template: str | None = '/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/rompy/templates/base'#

The path to the model template