pywr.parameters.TablesArrayParameter

class pywr.parameters.TablesArrayParameter(model, h5file, node, where='/', scenario=None, timestep_offset=0, **kwargs)
__init__()

This Parameter reads array data from a PyTables HDF database.

The parameter reads data using the PyTables array interface and therefore does not require loading the entire dataset in to memory. This is useful for large model runs.

Parameters:
h5filetables.File or filename

The tables file handle or filename to attach the CArray objects to. If a filename is given the object will open and close the file handles.

nodestring

Name of the node in the tables database to read data from

wherestring

Path to read the node from.

scenarioScenario

Scenario to use as the second index in the array.

timestep_offsetint

Optional offset to apply to the timestep look-up. This can be used to look forward (positive value) or backward (negative value) in the dataset. The offset is applied to dataset after alignment and resampling. If the offset takes the indexing out of the data bounds then the parameter will return the first or last value available.

Methods

__init__

This Parameter reads array data from a PyTables HDF database.

after(self)

before(self)

finish(self)

get_all_indices(self)

get_all_values(self)

get_constant_value(self)

Return a constant value.

get_double_lower_bounds(self)

get_double_upper_bounds(self)

get_double_variables(self)

get_index(self, ScenarioIndex scenario_index)

get_integer_lower_bounds(self)

get_integer_upper_bounds(self)

get_integer_variables(self)

get_value(self, ScenarioIndex scenario_index)

index(self, Timestep ts, ...)

load(cls, model, data)

register(cls)

reset(self)

set_double_variables(self, double[)

set_integer_variables(self, int[)

setup(self)

unregister(cls)

value(self, Timestep ts, ...)

Attributes

children

comment

comment: unicode

double_size

double_size: 'int'

h5file

h5file: object

h5store

h5store: object

integer_size

integer_size: 'int'

is_constant

is_variable

is_variable: 'bool'

model

name

node

node: object

parents

scenario

scenario: pywr._core.Scenario

size

tags

tags: dict

timestep_offset

timestep_offset: 'int'

where

where: object