teehr.VariableTable#

class teehr.VariableTable(ev)[source]#

Bases: DomainTable

Access methods to variables table.

Methods

add

Add a unit to the evaluation.

distinct_values

Return distinct values for a column.

field_enum

Get the variable fields enum.

fields

Return table columns as a list.

filter

Apply a filter.

order_by

Apply an order_by.

query

Run a query against the table with filters and order_by.

to_geopandas

Return GeoPandas DataFrame.

to_pandas

Return Pandas DataFrame.

to_sdf

Return PySpark DataFrame.

validate

Validate the dataset table against the schema.

add(variable: Variable | List[Variable])[source]#

Add a unit to the evaluation.

Parameters:

variable (Union[Variable, List[Variable]]) – The variable domain to add.

Example

>>> from teehr.models.domain_tables import Variable
>>> variable = Variable(
>>>     name="streamflow_hourly_inst",
>>>     long_name="Instantaneous streamflow"
>>> )
>>> ev.load.add_variable(variable)
field_enum() VariableFields[source]#

Get the variable fields enum.