message_ix_models.model.transport.files.ExogenousDataFile
- class message_ix_models.model.transport.files.ExogenousDataFile(*, name: str, units: str, key: KeyLike | None = None, dims: tuple[str, ...] | None = None, path: str | tuple[str, ...] | None = None, description: str | None = None, required: bool = True)[source]
Bases:
object
Exogenous/input data for MESSAGEix-Transport expected in a file.
Todo
Generate documentation (docstrings or snippets) in reStructuredText format.
Accept an argument that sets
dfd
directly; skip handling other arguments.Annotate certain dimensions as optional; expand
add_tasks()
to automatically handle insertion of these dimensions.Merge with, or make a subclass of,
ExoData
.
- Parameters:
name (
str
) – Name of the data flow.units (
str
) – Units for observations in the data flow.key (
KeyLike
, optional) – Key at which the data from the file will be present in aComputer
.path (
str
ortuple
ofstr
, optional) – Path at which the file is located. If not supplied,path
is constructed from key, dims, and the tag “exo”.description (
str
, optional) – Human-readable description of the data flow, including any notes about required properties or contents or methods used to handle the data.required (
bool
, optional) – IfTrue
(the default), the file must be present for the build to succeed.
- __init__(*, name: str, units: str, key: KeyLike | None = None, dims: tuple[str, ...] | None = None, path: str | tuple[str, ...] | None = None, description: str | None = None, required: bool = True)[source]
Methods
__init__
(*, name, units[, key, dims, path, ...])add_tasks
(c, *args, context)Prepare c to read data from a file like
path
.Generate a CSV template file.
Attributes
genno.Key
, including preferred dimensions.Path fragment for the location of a file containing the data.
True
if the data must be present fortransport.build.main()
.Preferred units.
sdmx.Dataflow
describing the input data flow.- add_tasks(c: genno.Computer, *args, context: Context) tuple[KeyLike, ...] [source]
Prepare c to read data from a file like
path
.
- df: sdmx.model.common.BaseDataflowDefinition
sdmx.Dataflow
describing the input data flow.
- property path: Path
Path fragment for the location of a file containing the data.
- property required: bool
True
if the data must be present fortransport.build.main()
.