rompy.core.data.DataBlob#

pydantic model rompy.core.data.DataBlob[source]#

Data source for model ingestion.

Generic data source for files that either need to be copied to the model directory or linked if link is set to True.

Show JSON schema
{
   "title": "DataBlob",
   "description": "Data source for model ingestion.\n\nGeneric data source for files that either need to be copied to the model directory\nor linked if `link` is set to True.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "data_blob",
         "description": "Model type discriminator",
         "enum": [
            "data_blob",
            "data_link"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "id": {
         "default": "data",
         "description": "Unique identifier for this data source",
         "title": "Id",
         "type": "string"
      },
      "source": {
         "description": "URI of the data source, either a local file path or a remote uri",
         "title": "Source"
      },
      "link": {
         "default": false,
         "description": "Whether to create a symbolic link instead of copying the file",
         "title": "Link",
         "type": "boolean"
      }
   },
   "additionalProperties": false,
   "required": [
      "source"
   ]
}

Fields:
field id: str = 'data'#

Unique identifier for this data source

Whether to create a symbolic link instead of copying the file

field model_type: Literal['data_blob', 'data_link'] = 'data_blob'#

Model type discriminator

field source: AnyPath [Required]#

URI of the data source, either a local file path or a remote uri

get(destdir: str | Path, name: str | None = None, *args, **kwargs) Path[source]#

Copy or link the data source to a new directory.

Parameters:

destdir (str | Path) – The destination directory to copy or link the data source to.

Returns:

The path to the copied file or created symlink.

Return type:

Path

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.