C++ binding
This reference only describes the C++ Python binding. For a full documentation of the C++ code, please refer to the C++ reference.
hydrobricks Python interface
ModelHydro class
- class _hydrobricks.ModelHydro
Bases:
pybind11_object- add_action(self: _hydrobricks.ModelHydro, action: Action) bool
Adding a action to the model.
- add_time_series(self: _hydrobricks.ModelHydro, time_series: _hydrobricks.TimeSeries) bool
Adding a time series to the model.
- attach_time_series_to_hydro_units(self: _hydrobricks.ModelHydro) bool
Attach the time series.
- clear_time_series(self: _hydrobricks.ModelHydro) None
Clear time series. Use only if the time series were created with ModelHydro::ClearTimeSeries.
- create_time_series(self: _hydrobricks.ModelHydro, data_name: str, time: numpy.ndarray[numpy.float64[m, 1]], ids: numpy.ndarray[numpy.int32[m, 1]], data: numpy.ndarray[numpy.float64[m, n]]) bool
Create a time series and add it to the model.
- dump_outputs(self: _hydrobricks.ModelHydro, path: str) bool
Dump the model outputs to file.
- forcing_loaded(self: _hydrobricks.ModelHydro) bool
Check if the forcing data were loaded.
- get_actions_nb(self: _hydrobricks.ModelHydro) int
Get the number of actions.
- get_outlet_discharge(self: _hydrobricks.ModelHydro) numpy.ndarray[numpy.float64[m, 1]]
Get the outlet discharge.
- get_sporadic_action_items_nb(self: _hydrobricks.ModelHydro) int
Get the number of action items.
- get_total_et(self: _hydrobricks.ModelHydro) float
Get the total amount of water lost by evapotranspiration.
- get_total_outlet_discharge(self: _hydrobricks.ModelHydro) float
Get the outlet discharge total.
- get_total_snow_storage_changes(self: _hydrobricks.ModelHydro) float
Get the total change in snow storage.
- get_total_water_storage_changes(self: _hydrobricks.ModelHydro) float
Get the total change in water storage.
- init_with_basin(self: _hydrobricks.ModelHydro, model_settings: _hydrobricks.SettingsModel, basin_settings: _hydrobricks.SettingsBasin) bool
Initialize the model and create the sub basin.
- is_ok(self: _hydrobricks.ModelHydro) bool
Check if the model is correctly set up.
- reset(self: _hydrobricks.ModelHydro) None
Reset the model before another run.
- run(self: _hydrobricks.ModelHydro) bool
Run the model.
- save_as_initial_state(self: _hydrobricks.ModelHydro) None
Save the model state as initial conditions.
- update_parameters(self: _hydrobricks.ModelHydro, model_settings: _hydrobricks.SettingsModel) None
Update the parameters with the provided values.
SettingsModel class
- class _hydrobricks.SettingsModel
Bases:
pybind11_object- add_brick_parameter(self: _hydrobricks.SettingsModel, name: str, value: float, kind: str = 'constant') None
Add a brick parameter.
- add_brick_process(self: _hydrobricks.SettingsModel, name: str, kind: str, target: str = '', log: bool = False) None
Add a process to a brick.
- add_hydro_unit_brick(self: _hydrobricks.SettingsModel, name: str, kind: str = 'storage') None
Add a hydro unit brick.
- add_land_cover_brick(self: _hydrobricks.SettingsModel, name: str, kind: str) None
Add a land cover brick.
- add_logging_to(self: _hydrobricks.SettingsModel, name: str) None
Add logging to the item.
- add_process_forcing(self: _hydrobricks.SettingsModel, name: str) None
Add a process forcing.
- add_process_parameter(self: _hydrobricks.SettingsModel, name: str, value: float, kind: str = 'constant') None
Add a process parameter.
- add_snow_ice_transformation(self: _hydrobricks.SettingsModel, transformation_process: str = 'transform:snow_ice_constant') None
Add the snow-ice transformation process.
- add_snow_redistribution(self: _hydrobricks.SettingsModel, redistribution_process: str = 'transport:snow_slide', skip_glaciers: bool = False) None
Add the snow redistribution process.
- add_sub_basin_brick(self: _hydrobricks.SettingsModel, name: str, kind: str = 'storage') None
Add a sub basin brick.
- generate_precipitation_splitters(self: _hydrobricks.SettingsModel, with_snow: bool = True) None
Generate the precipitation splitters.
- generate_snowpacks(self: _hydrobricks.SettingsModel, snow_melt_process: str) None
Generate the snowpack.
- log_all(self: _hydrobricks.SettingsModel, log_all: bool = True) None
Logging all components.
- select_hydro_unit_brick(self: _hydrobricks.SettingsModel, name: str) None
Select a hydro unit brick.
- set_parameter_value(self: _hydrobricks.SettingsModel, component: str, name: str, value: float) bool
Setting one of the model parameter.
- set_process_outputs_as_instantaneous(self: _hydrobricks.SettingsModel) None
Set the process outputs as instantaneous.
- set_process_outputs_as_static(self: _hydrobricks.SettingsModel) None
Set the process outputs as static.
- set_solver(self: _hydrobricks.SettingsModel, name: str) None
Set the solver.
- set_timer(self: _hydrobricks.SettingsModel, start_date: str, end_date: str, time_step: int, time_step_unit: str) None
Set the modelling time properties.
SettingsBasin class
- class _hydrobricks.SettingsBasin
Bases:
pybind11_object- add_hydro_unit(self: _hydrobricks.SettingsBasin, id: int, area: float, elevation: float = -9999) None
Add a hydro unit to the spatial structure.
- add_hydro_unit_property_double(self: _hydrobricks.SettingsBasin, name: str, value: float, unit: str) None
Set a hydro unit property.
- add_hydro_unit_property_str(self: _hydrobricks.SettingsBasin, name: str, value: str) None
Set a hydro unit property.
- add_land_cover(self: _hydrobricks.SettingsBasin, name: str, kind: str, fraction: float) None
Add a land cover element.
- add_lateral_connection(self: _hydrobricks.SettingsBasin, giver_hydro_unit_id: int, receiver_hydro_unit_id: int, fraction: float, type: str = '') None
Add a lateral connection between two hydro units.
- clear(self: _hydrobricks.SettingsBasin) None
Clear the basin settings.
- get_lateral_connections_nb(self: _hydrobricks.SettingsBasin) int
Get the number of lateral connections.
SubBasin class
- class _hydrobricks.SubBasin
Bases:
pybind11_object- init(self: _hydrobricks.SubBasin, spatial_structure: _hydrobricks.SettingsBasin) bool
Initialize the basin.
Parameter class
- class _hydrobricks.Parameter
Bases:
pybind11_object- get_name(self: _hydrobricks.Parameter) str
Get the parameter name.
- get_value(self: _hydrobricks.Parameter) float
Get the parameter value.
- property name
- set_name(self: _hydrobricks.Parameter, arg0: str) None
Set the parameter name.
- set_value(self: _hydrobricks.Parameter, arg0: float) None
Set the parameter value.
- property value
- class _hydrobricks.ParameterVariableYearly
Bases:
Parameter- set_values(self: _hydrobricks.ParameterVariableYearly, year_start: int, year_end: int, values: list[float]) bool
Set the parameter values.
TimeSeries class
- class _hydrobricks.TimeSeries
Bases:
pybind11_object- static create(data_name: str, time: numpy.ndarray[numpy.float64[m, 1]], ids: numpy.ndarray[numpy.int32[m, 1]], data: numpy.ndarray[numpy.float64[m, n]]) _hydrobricks.TimeSeries