Version: dev

data_source_binding

Stable type · Document types

Tier: stable · Kind: type · Topic: Document types

JuliaTypeScriptPythonRustGo
DataSourceBindingnot exportedDataSourceBindingDataSourceBindingDataSourceBinding

Julia

struct DataSourceBinding
DataSourceBinding(file_variable::AbstractString; unit_conversion, codes, select, description, reference)
DataSourceBinding

Binds a parameter to one file variable of a data_sources entry (esm-spec §8.5) — the from value form of a data update. It carries no units: the units are the parameter’s own, declared once on the consumer.

Source

TypeScript

TypeScript does not export this type.

Python

class DataSourceBinding
DataSourceBinding(file_variable: str, unit_conversion: Expr | None = None, codes: dict[str, Any] | None = None, select: dict[str, Any] | None = None, description: str | None = None, reference: Reference | None = None)

Binds a parameter to ONE variable of a data_sources entry (esm-spec §8.5). It carries no units: the units are the parameter’s own, declared once on the parameter.

select overrides the source-level default for this parameter only, which is how a full-grid field and a prefix of it are both read from one file_variable without either being sliced by the consumer.

Source

Rust

pub struct DataSourceBinding {
    pub file_variable: String,
    pub unit_conversion: Option<UnitConversion>,
    pub codes: Option<Value>,
    pub select: Option<Value>,
    pub description: Option<String>,
    pub reference: Option<Reference>,
}

Binds a parameter to ONE variable of a data_sources entry (esm-spec §8.5). The 0.x DataLoaderVariable minus units: the units are the parameter’s own, declared once on the parameter instead of twice.

Source · Rust docs

Go

type DataSourceBinding struct {
	FileVariable   string     `json:"file_variable"`
	UnitConversion any        `json:"unit_conversion,omitempty"`
	Codes          any        `json:"codes,omitempty"`
	Select         any        `json:"select,omitempty"`
	Description    *string    `json:"description,omitempty"`
	Reference      *Reference `json:"reference,omitempty"`
}

func (v *DataSourceBinding) UnmarshalJSON(data []byte) error

DataSourceBinding binds a PARAMETER to one file variable of a data_sources entry, through the from value form of a data update (esm-spec 8.5). It carries no units: the units are the parameter’s own.

UnitConversion is a single Expression position; Expression already admits a bare number, so a plain factor is written as one. Its free names are subject to reference integrity (esm-spec 4.9.5).

Methods

func (v *DataSourceBinding) UnmarshalJSON(data []byte) error

Custom JSON unmarshaling for DataSourceBinding. unit_conversion is a single Expression position (a plain factor is just the number spelling of one), so it goes through UnmarshalExpression to keep its int/float wire shape and to become an ExprNode when it is a full AST.

Source · Go docs