ravenpy.config package

Subpackages

Submodules

ravenpy.config.base module

class ravenpy.config.base.Command[source]

Bases: _Command

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class ravenpy.config.base.FlatCommand[source]

Bases: Command

Only used to discriminate Commands that should not be nested.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class ravenpy.config.base.GenericParameterList(*, Parameters: Sequence[str], Units: Sequence[str] | None = None, pl: Sequence[ParameterList])[source]

Bases: Command

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'parameters': FieldInfo(annotation=Sequence[str], required=True, alias='Parameters', alias_priority=2, description='Parameter names'), 'pl': FieldInfo(annotation=Sequence[ravenpy.config.base.ParameterList], required=True), 'units': FieldInfo(annotation=Union[Sequence[str], NoneType], required=False, default=None, alias='Units', alias_priority=2)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

num_values_equal_num_names()[source]

Check that the length of the parameter list equals the number of given parameter names.

parameters: Sequence[str]
pl: Sequence[ParameterList]
set_default_units()[source]
units: Sequence[str] | None
class ravenpy.config.base.LineCommand[source]

Bases: FlatCommand

A non-nested Command on a single line.

:CommandName {field_1} {field_2} … {field_n}

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

to_rv()[source]

Return Raven configuration string.

class ravenpy.config.base.ListCommand(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootModel, _Command

Use so that commands with __root__: Sequence[Command] behave like a list.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[Any], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

root: Sequence[Any]
class ravenpy.config.base.ParameterList(*, name: str = '', values: Sequence[Variable | Expression | float | None | str] = ())[source]

Bases: Record

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'name': FieldInfo(annotation=str, required=False, default=''), 'values': FieldInfo(annotation=Sequence[Union[pymbolic.primitives.Variable, pymbolic.primitives.Expression, float, NoneType, str]], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
classmethod no_none_in_default(data)[source]

Make sure that no values are None for the [DEFAULT] record.

values: Sequence[Variable | Expression | float | None | str]
class ravenpy.config.base.Params[source]

Bases: object

class ravenpy.config.base.RV[source]

Bases: Command

Base class for RV configuration objects.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class ravenpy.config.base.Record[source]

Bases: _Record

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class ravenpy.config.base.RootCommand(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootModel, _Command

Generic Command for root models.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Any, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

root: Any
class ravenpy.config.base.RootRecord(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootModel, _Record

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=~RootModelRootType, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class ravenpy.config.base.SymConfig[source]

Bases: object

arbitrary_types_allowed = True
ravenpy.config.base.encoder(v: dict) dict[source]

Return string representation of objects in dictionary.

This is meant to be applied to BaseModel attributes that either have an alias defined, or have a root attribute. The objective is to avoid creating Command objects for every configuration option:

  • bool: ‘:{cmd}n’ if obj else ‘’

  • dict: ‘:{cmd} {key} {value}’

  • enum: ‘:{cmd} {obj.value}’

  • Command: obj.to_rv()

  • Sequence: complicated

  • Any other: ‘:{cmd} {obj}’

ravenpy.config.base.optfield(**kwds)[source]

Shortcut to create an optional field with an alias.

ravenpy.config.base.parse_symbolic(value, **kwds)[source]

Inject values of symbolic variables into object and return object.

Note that parsing the output of model_dump can cause problems because there is not always enough information in the dictionary to recreate the correct model.

ravenpy.config.commands module

class ravenpy.config.commands.AssimilateStreamflow(*, sb_id: str)[source]

Bases: LineCommand

Subbasin ID to assimilate streamflow for.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'coerce_numbers_to_str': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'sb_id': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

sb_id: str
class ravenpy.config.commands.AssimilatedState(*, state: Literal['SURFACE_WATER', 'ATMOSPHERE', 'ATMOS_PRECIP', 'PONDED_WATER', 'SOIL', 'SOIL[0]', 'SOIL[1]', 'SOIL[2]', 'GROUNDWATER', 'CANOPY', 'CANOPY_SNOW', 'TRUNK', 'ROOT', 'DEPRESSION', 'WETLAND', 'LAKE_STORAGE', 'SNOW', 'SNOW_LIQ', 'GLACIER', 'GLACIER_ICE', 'CONVOLUTION', 'CONV_STOR', 'SURFACE_WATER_TEMP', 'SNOW_TEMP', 'COLD_CONTENT', 'GLACIER_CC', 'SOIL_TEMP', 'CANOPY_TEMP', 'SNOW_DEPTH', 'PERMAFROST_DEPTH', 'SNOW_COVER', 'SNOW_AGE', 'SNOW_ALBEDO', 'CROP_HEAT_UNITS', 'CUM_INFIL', 'CUM_SNOWMELT', 'CONSTITUENT', 'CONSTITUENT_SRC', 'CONSTITUENT_SW', 'CONSTITUENT_SINK', 'MULTIPLE'] | Literal['STREAMFLOW'], group: str)[source]

Bases: LineCommand

group: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'group': FieldInfo(annotation=str, required=True), 'state': FieldInfo(annotation=Union[Literal['SURFACE_WATER', 'ATMOSPHERE', 'ATMOS_PRECIP', 'PONDED_WATER', 'SOIL', 'SOIL[0]', 'SOIL[1]', 'SOIL[2]', 'GROUNDWATER', 'CANOPY', 'CANOPY_SNOW', 'TRUNK', 'ROOT', 'DEPRESSION', 'WETLAND', 'LAKE_STORAGE', 'SNOW', 'SNOW_LIQ', 'GLACIER', 'GLACIER_ICE', 'CONVOLUTION', 'CONV_STOR', 'SURFACE_WATER_TEMP', 'SNOW_TEMP', 'COLD_CONTENT', 'GLACIER_CC', 'SOIL_TEMP', 'CANOPY_TEMP', 'SNOW_DEPTH', 'PERMAFROST_DEPTH', 'SNOW_COVER', 'SNOW_AGE', 'SNOW_ALBEDO', 'CROP_HEAT_UNITS', 'CUM_INFIL', 'CUM_SNOWMELT', 'CONSTITUENT', 'CONSTITUENT_SRC', 'CONSTITUENT_SW', 'CONSTITUENT_SINK', 'MULTIPLE'], Literal['STREAMFLOW']], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

state: Literal['SURFACE_WATER', 'ATMOSPHERE', 'ATMOS_PRECIP', 'PONDED_WATER', 'SOIL', 'SOIL[0]', 'SOIL[1]', 'SOIL[2]', 'GROUNDWATER', 'CANOPY', 'CANOPY_SNOW', 'TRUNK', 'ROOT', 'DEPRESSION', 'WETLAND', 'LAKE_STORAGE', 'SNOW', 'SNOW_LIQ', 'GLACIER', 'GLACIER_ICE', 'CONVOLUTION', 'CONV_STOR', 'SURFACE_WATER_TEMP', 'SNOW_TEMP', 'COLD_CONTENT', 'GLACIER_CC', 'SOIL_TEMP', 'CANOPY_TEMP', 'SNOW_DEPTH', 'PERMAFROST_DEPTH', 'SNOW_COVER', 'SNOW_AGE', 'SNOW_ALBEDO', 'CROP_HEAT_UNITS', 'CUM_INFIL', 'CUM_SNOWMELT', 'CONSTITUENT', 'CONSTITUENT_SRC', 'CONSTITUENT_SW', 'CONSTITUENT_SINK', 'MULTIPLE'] | Literal['STREAMFLOW']
class ravenpy.config.commands.BasinIndex(*, sb_id: int = 1, name: str = 'watershed', ChannelStorage: float = 0.0, RivuletStorage: float = 0.0, Qout: Sequence[float] = (1.0, 0.0, 0.0), Qlat: Sequence[float] | None = None, Qin: Sequence[float] | None = None)[source]

Bases: Command

Initial conditions for a flow segment.

channel_storage: float
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'coerce_numbers_to_str': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'channel_storage': FieldInfo(annotation=float, required=False, default=0.0, alias='ChannelStorage', alias_priority=2), 'name': FieldInfo(annotation=str, required=False, default='watershed'), 'qin': FieldInfo(annotation=Union[Sequence[float], NoneType], required=False, default=None, alias='Qin', alias_priority=2), 'qlat': FieldInfo(annotation=Union[Sequence[float], NoneType], required=False, default=None, alias='Qlat', alias_priority=2), 'qout': FieldInfo(annotation=Sequence[float], required=False, default=(1.0, 0.0, 0.0), alias='Qout', alias_priority=2), 'rivulet_storage': FieldInfo(annotation=float, required=False, default=0.0, alias='RivuletStorage', alias_priority=2), 'sb_id': FieldInfo(annotation=int, required=False, default=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
classmethod parse(s)[source]
qin: Sequence[float] | None
qlat: Sequence[float] | None
qout: Sequence[float]
rivulet_storage: float
sb_id: int
class ravenpy.config.commands.BasinStateVariables(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands.BasinIndex], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

classmethod parse(sol)[source]
root: Sequence[BasinIndex]
class ravenpy.config.commands.ChannelProfile(*, name: str = 'chn_XXX', bed_slope: float = 0, survey_points: Tuple[Tuple[float, float], ...] = (), roughness_zones: Tuple[Tuple[float, float], ...] = ())[source]

Bases: FlatCommand

ChannelProfile command (RVP).

bed_slope: float
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'bed_slope': FieldInfo(annotation=float, required=False, default=0), 'name': FieldInfo(annotation=str, required=False, default='chn_XXX'), 'roughness_zones': FieldInfo(annotation=Tuple[Tuple[float, float], ...], required=False, default=()), 'survey_points': FieldInfo(annotation=Tuple[Tuple[float, float], ...], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
roughness_zones: Tuple[Tuple[float, float], ...]
survey_points: Tuple[Tuple[float, float], ...]
to_rv()[source]

Return Raven configuration string.

class ravenpy.config.commands.CustomOutput(*, time_per: Literal['DAILY', 'MONTHLY', 'YEARLY', 'WATER_YEARLY', 'CONTINUOUS'], stat: Literal['AVERAGE', 'MAXIMUM', 'MINIMUM', 'RANGE', 'MEDIAN', 'QUARTILES'], variable: str, space_agg: Literal['BY_BASIN', 'BY_HRU', 'BY_HRU_GROUP', 'BY_SB_GROUP', 'ENTIRE_WATERSHED'], filename: str = '')[source]

Bases: FlatCommand

Create custom output file to track a single variable, parameter or forcing function over time at a number of basins, HRUs, or across the watershed.

Parameters:
  • time_per ({'DAILY', 'MONTHLY', 'YEARLY', 'WATER_YEARLY', 'CONTINUOUS'}) – Time period.

  • stat ({'AVERAGE', 'MAXIMUM', 'MINIMUM', 'RANGE', 'MEDIAN', 'QUARTILES', 'HISTOGRAM [min] [max] [# bins]') – Statistic reported for each time interval.

  • variable (str) – Variable or parameter name. Consult the Raven documentation for the list of allowed names.

  • space_agg ({'BY_BASIN', 'BY_HRU', 'BY_HRU_GROUP', 'BY_SB_GROUP', 'ENTIRE_WATERSHED'}) – Spatial evaluation domain.

  • filename (str) – Output file name. Defaults to something approximately like <run name>_<variable>_<time_per>_<stat>_<space_agg>.nc

filename: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'filename': FieldInfo(annotation=str, required=False, default=''), 'space_agg': FieldInfo(annotation=Literal['BY_BASIN', 'BY_HRU', 'BY_HRU_GROUP', 'BY_SB_GROUP', 'ENTIRE_WATERSHED'], required=True), 'stat': FieldInfo(annotation=Literal['AVERAGE', 'MAXIMUM', 'MINIMUM', 'RANGE', 'MEDIAN', 'QUARTILES'], required=True), 'time_per': FieldInfo(annotation=Literal['DAILY', 'MONTHLY', 'YEARLY', 'WATER_YEARLY', 'CONTINUOUS'], required=True), 'variable': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

space_agg: Literal['BY_BASIN', 'BY_HRU', 'BY_HRU_GROUP', 'BY_SB_GROUP', 'ENTIRE_WATERSHED']
stat: Literal['AVERAGE', 'MAXIMUM', 'MINIMUM', 'RANGE', 'MEDIAN', 'QUARTILES']
time_per: Literal['DAILY', 'MONTHLY', 'YEARLY', 'WATER_YEARLY', 'CONTINUOUS']
variable: str
class ravenpy.config.commands.Data(*, data_type: Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR'] = '', units: str = '', ReadFromNetCDF: ReadFromNetCDF)[source]

Bases: FlatCommand

data_type: Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR']
classmethod from_nc(fn, data_type, station_idx=1, alt_names=(), **kwds)[source]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'data_type': FieldInfo(annotation=Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR'], required=False, default=''), 'read_from_netcdf': FieldInfo(annotation=ReadFromNetCDF, required=True, alias='ReadFromNetCDF', alias_priority=2), 'units': FieldInfo(annotation=str, required=False, default='')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

read_from_netcdf: ReadFromNetCDF
units: str
class ravenpy.config.commands.EnsembleMode(*, mode: Literal['ENSEMBLE_ENKF'] = 'ENSEMBLE_ENKF', n: int)[source]

Bases: LineCommand

mode: Literal['ENSEMBLE_ENKF']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'mode': FieldInfo(annotation=Literal['ENSEMBLE_ENKF'], required=False, default='ENSEMBLE_ENKF'), 'n': FieldInfo(annotation=int, required=True, description='Number of members')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

n: int
class ravenpy.config.commands.EvaluationPeriod(*, name: str, start: date, end: date)[source]

Bases: LineCommand

:EvaluationPeriod [period_name] [start yyyy-mm-dd] [end yyyy-mm-dd]

end: date
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'end': FieldInfo(annotation=date, required=True), 'name': FieldInfo(annotation=str, required=True), 'start': FieldInfo(annotation=date, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
start: date
class ravenpy.config.commands.ForcingPerturbation(*, forcing: Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR'], dist: Literal['DIST_UNIFORM', 'DIST_NORMAL', 'DIST_GAMMA'], p1: float, p2: float, adj: Literal['ADDITIVE', 'MULTIPLICATIVE'], hru_grp: str = '')[source]

Bases: LineCommand

adj: Literal['ADDITIVE', 'MULTIPLICATIVE']
dist: Literal['DIST_UNIFORM', 'DIST_NORMAL', 'DIST_GAMMA']
forcing: Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR']
hru_grp: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'adj': FieldInfo(annotation=Literal['ADDITIVE', 'MULTIPLICATIVE'], required=True), 'dist': FieldInfo(annotation=Literal['DIST_UNIFORM', 'DIST_NORMAL', 'DIST_GAMMA'], required=True), 'forcing': FieldInfo(annotation=Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR'], required=True), 'hru_grp': FieldInfo(annotation=str, required=False, default=''), 'p1': FieldInfo(annotation=float, required=True), 'p2': FieldInfo(annotation=float, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

p1: float
p2: float
class ravenpy.config.commands.Gauge(*, name: str = 'default', Latitude: float, Longitude: float, Elevation: float | None = None, RainCorrection: Variable | Expression | float | None = None, SnowCorrection: Variable | Expression | float | None = None, MonthlyAveEvaporation: Sequence | None = None, MonthlyAveTemperature: Sequence | None = None, MonthlyMinTemperature: Sequence | None = None, MonthlyMaxTemperature: Sequence | None = None, Data: Sequence[Data] | None = None)[source]

Bases: FlatCommand

classmethod confirm_monthly(v)[source]
data: Sequence[Data] | None
property ds: Dataset

Return xarray Dataset with forcing variables keyed by Raven forcing names.

elevation: float | None
classmethod from_nc(fn: str | Path | Sequence[Path], data_type: Sequence[str] | None = None, station_idx: int = 1, alt_names: Dict[str, str] | None = None, mon_ave: bool = False, data_kwds: Dict[str, Any] | None = None, engine: str = 'h5netcdf', **kwds) Gauge[source]

Return Gauge instance with configuration options inferred from the netCDF itself.

Parameters:
  • fn (str or Path or Sequence[Path]) – NetCDF file path or paths.

  • data_type (Sequence[str], optional) – Raven data types to extract from netCDF files, e.g. ‘PRECIP’, ‘AVE_TEMP’. The algorithm tries to find all forcings in each file until one is found, then it stops searching for it in the following files.

  • station_idx (int) – Index along station dimension. Starts at 1. Should be the same for all netCDF files.

  • alt_names (dict) – Alternative variable names keyed by data type. Use this if variables do not correspond to CF standard defaults.

  • mon_ave (bool) – If True, compute the monthly average.

  • data_kwds (dict[options.Forcings, dict[str, str]]) – Additional :Data parameters keyed by forcing type and station id. Overrides inferred parameters. Use keyword “ALL” to pass parameters to all variables.

  • engine ({"h5netcdf", "netcdf4", "pydap"}) – The engine used to open the dataset. Default is ‘h5netcdf’.

  • **kwds – Additional arguments for Gauge.

Returns:

Gauge instance.

Return type:

Gauge

latitude: float
longitude: float
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'data': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.Data], NoneType], required=False, default=None, alias='Data', alias_priority=2), 'elevation': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, alias='Elevation', alias_priority=2), 'latitude': FieldInfo(annotation=float, required=True, alias='Latitude', alias_priority=2), 'longitude': FieldInfo(annotation=float, required=True, alias='Longitude', alias_priority=2), 'monthly_ave_evaporation': FieldInfo(annotation=Union[Sequence, NoneType], required=False, default=None, alias='MonthlyAveEvaporation', alias_priority=2), 'monthly_ave_temperature': FieldInfo(annotation=Union[Sequence, NoneType], required=False, default=None, alias='MonthlyAveTemperature', alias_priority=2), 'monthly_max_temperature': FieldInfo(annotation=Union[Sequence, NoneType], required=False, default=None, alias='MonthlyMaxTemperature', alias_priority=2), 'monthly_min_temperature': FieldInfo(annotation=Union[Sequence, NoneType], required=False, default=None, alias='MonthlyMinTemperature', alias_priority=2), 'name': FieldInfo(annotation=str, required=False, default='default'), 'rain_correction': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=False, default=None, alias='RainCorrection', alias_priority=2, description='Rain correction'), 'snow_correction': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=False, default=None, alias='SnowCorrection', alias_priority=2, description='Snow correction')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

monthly_ave_evaporation: Sequence | None
monthly_ave_temperature: Sequence | None
monthly_max_temperature: Sequence | None
monthly_min_temperature: Sequence | None
name: str
rain_correction: Variable | Expression | float | None
snow_correction: Variable | Expression | float | None
class ravenpy.config.commands.GridWeights(*, NumberHRUs: int = 1, NumberGridCells: int = 1, data: Sequence[GWRecord] = (GWRecord(root=(1, 0, 1.0)),))[source]

Bases: Command

GridWeights command.

Notes

command can be embedded in both a GriddedForcing or a StationForcing.

The default is to have a single cell that covers an entire single HRU, with a weight of 1.

class GWRecord(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootRecord

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Tuple[int, int, float], required=False, default=(1, 0, 1.0))}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

root: Tuple[int, int, float]
data: Sequence[GWRecord]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'data': FieldInfo(annotation=Sequence[ravenpy.config.commands.GridWeights.GWRecord], required=False, default=(GWRecord(root=(1, 0, 1.0)),)), 'number_grid_cells': FieldInfo(annotation=int, required=False, default=1, alias='NumberGridCells', alias_priority=2), 'number_hrus': FieldInfo(annotation=int, required=False, default=1, alias='NumberHRUs', alias_priority=2)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

number_grid_cells: int
number_hrus: int
classmethod parse(s)[source]
class ravenpy.config.commands.GriddedForcing(*, FileNameNC: Url | Path, VarNameNC: str, DimNamesNC: Sequence[str], station_idx: int | None = None, TimeShift: float | None = None, LinearTransform: LinearTransform | None = None, Deaccumulate: bool | None = None, LatitudeVarNameNC: str | None = None, LongitudeVarNameNC: str | None = None, ElevationVarNameNC: str | None = None, name: str = '', ForcingType: Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR'] | None = None, GridWeights: GridWeights | RedirectToFile = GridWeights(number_hrus=1, number_grid_cells=1, data=(GWRecord(root=(1, 0, 1.0)),)))[source]

Bases: ReadFromNetCDF

GriddedForcing command (RVT).

classmethod check_dims(v)[source]
forcing_type: Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR'] | None
grid_weights: GridWeights | RedirectToFile
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'deaccumulate': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None, alias='Deaccumulate', alias_priority=2), 'dim_names_nc': FieldInfo(annotation=Sequence[str], required=True, alias='DimNamesNC', alias_priority=2), 'elevation_var_name_nc': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='ElevationVarNameNC', alias_priority=2), 'file_name_nc': FieldInfo(annotation=Union[Annotated[pydantic_core._pydantic_core.Url, UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)], Path], required=True, alias='FileNameNC', alias_priority=2, description='NetCDF file name.'), 'forcing_type': FieldInfo(annotation=Union[Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR'], NoneType], required=False, default=None, alias='ForcingType', alias_priority=2), 'grid_weights': FieldInfo(annotation=Union[GridWeights, RedirectToFile], required=False, default=GridWeights(number_hrus=1, number_grid_cells=1, data=(GWRecord(root=(1, 0, 1.0)),)), alias='GridWeights', alias_priority=2), 'latitude_var_name_nc': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='LatitudeVarNameNC', alias_priority=2), 'linear_transform': FieldInfo(annotation=Union[LinearTransform, NoneType], required=False, default=None, alias='LinearTransform', alias_priority=2), 'longitude_var_name_nc': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='LongitudeVarNameNC', alias_priority=2), 'name': FieldInfo(annotation=str, required=False, default=''), 'station_idx': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'time_shift': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, alias='TimeShift', alias_priority=2, description='Time stamp shift in days.'), 'var_name_nc': FieldInfo(annotation=str, required=True, alias='VarNameNC', alias_priority=2, description='NetCDF variable name.')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
station_idx: int | None
class ravenpy.config.commands.HRU(*, hru_id: int = 1, area: Variable | Expression | float | None = 0, elevation: float = 0, latitude: float = 0, longitude: float = 0, subbasin_id: int = 1, land_use_class: str = '[NONE]', veg_class: str = '[NONE]', soil_profile: str = '[NONE]', aquifer_profile: str = '[NONE]', terrain_class: str = '[NONE]', slope: float = 0.0, aspect: float = 0.0, hru_type: str | None = None)[source]

Bases: Record

Record to populate :HRUs command internal table (RVH).

aquifer_profile: str
area: Variable | Expression | float | None
aspect: float
elevation: float
hru_id: int
hru_type: str | None
land_use_class: str
latitude: float
longitude: float
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'aquifer_profile': FieldInfo(annotation=str, required=False, default='[NONE]'), 'area': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=False, default=0), 'aspect': FieldInfo(annotation=float, required=False, default=0.0, metadata=[Ge(ge=0), Le(le=360)]), 'elevation': FieldInfo(annotation=float, required=False, default=0), 'hru_id': FieldInfo(annotation=int, required=False, default=1, metadata=[Gt(gt=0)]), 'hru_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'land_use_class': FieldInfo(annotation=str, required=False, default='[NONE]'), 'latitude': FieldInfo(annotation=float, required=False, default=0), 'longitude': FieldInfo(annotation=float, required=False, default=0), 'slope': FieldInfo(annotation=float, required=False, default=0.0, metadata=[Ge(ge=0)]), 'soil_profile': FieldInfo(annotation=str, required=False, default='[NONE]'), 'subbasin_id': FieldInfo(annotation=int, required=False, default=1, metadata=[Gt(gt=0)]), 'terrain_class': FieldInfo(annotation=str, required=False, default='[NONE]'), 'veg_class': FieldInfo(annotation=str, required=False, default='[NONE]')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

slope: float
soil_profile: str
subbasin_id: int
terrain_class: str
veg_class: str
class ravenpy.config.commands.HRUGroup(*, name: str, groups: _Rec)[source]

Bases: FlatCommand

groups: _Rec
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'groups': FieldInfo(annotation=HRUGroup._Rec, required=True), 'name': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
class ravenpy.config.commands.HRUState(*, hru_id: int = 1, data: Dict[str, Variable | Expression | float | None] = None)[source]

Bases: Record

data: Dict[str, Variable | Expression | float | None]
hru_id: int
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'data': FieldInfo(annotation=Dict[str, Union[pymbolic.primitives.Variable, pymbolic.primitives.Expression, float, NoneType]], required=False, default_factory=dict), 'hru_id': FieldInfo(annotation=int, required=False, default=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

classmethod parse(sol, names=None)[source]
class ravenpy.config.commands.HRUStateVariableTable(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

Table of HRU state variables.

If the HRUState include different attributes, the states will be modified to include all attributes.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands.HRUState], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

classmethod parse(sol: str)[source]
root: Sequence[HRUState]
set_attributes()[source]
class ravenpy.config.commands.HRUs(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

HRUs command (RVH).

classmethod ignore_unrecognized_hrus(values)[source]

Ignore HRUs with unrecognized hru_type.

HRUs are ignored only if all allowed HRU classes define hru_type, and if the values passed include it.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands.HRU], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

root: Sequence[HRU]
ravenpy.config.commands.LU

alias of LandUseClass

class ravenpy.config.commands.LandUseClass(*, name: str = '', impermeable_frac: Variable | Expression | float | None = 0.0, forest_coverage: Variable | Expression | float | None = 0.0)[source]

Bases: Record

forest_coverage: Variable | Expression | float | None
impermeable_frac: Variable | Expression | float | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'forest_coverage': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=False, default=0.0), 'impermeable_frac': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=False, default=0.0), 'name': FieldInfo(annotation=str, required=False, default='')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
class ravenpy.config.commands.LandUseClasses(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands.LandUseClass], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

root: Sequence[LandUseClass]
class ravenpy.config.commands.LandUseParameterList(*, Parameters: Sequence[Literal['FOREST_COVERAGE', 'IMPERMEABLE_FRAC', 'ROUGHNESS', 'FOREST_SPARSENESS', 'DEP_MAX', 'MAX_DEP_AREA_FRAC', 'DD_MELT_TEMP', 'MELT_FACTOR', 'DD_REFREEZE_TEMP', 'MIN_MELT_FACTOR', 'MAX_MELT_FACTOR', 'REFREEZE_FACTOR', 'REFREEZE_EXP', 'DD_AGGRADATION', 'SNOW_PATCH_LIMIT', 'HBV_MELT_FOR_CORR', 'HBV_MELT_ASP_CORR', 'GLAC_STORAGE_COEFF', 'HBV_MELT_GLACIER_CORR', 'HBV_GLACIER_KMIN', 'HBV_GLACIER_AG', 'CC_DECAY_COEFF', 'SCS_CN', 'SCS_IA_FRACTION', 'PARTITION_COEFF', 'MAX_SAT_AREA_FRAC', 'B_EXP', 'ABST_PERCENT', 'DEP_MAX_FLOW', 'DEP_N', 'DEP_SEEP_K', 'DEP_K', 'DEP_THRESHOLD', 'PDMROF_B', 'PONDED_EXP', 'OW_PET_CORR', 'LAKE_PET_CORR', 'LAKE_REL_COEFF', 'FOREST_PET_CORR', 'GAMMA_SCALE', 'GAMMA_SHAPE', 'GAMMA_SCALE2', 'GAMMA_SHAPE2', 'HMETS_RUNOFF_COEFF', 'AET_COEFF', 'GR4J_X4', 'UBC_ICEPT_FACTOR', 'STREAM_FRACTION', 'BF_LOSS_FRACTION']] | None = None, Units: Sequence[str] | None = None, pl: Sequence[ParameterList])[source]

Bases: GenericParameterList

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'parameters': FieldInfo(annotation=Union[Sequence[Literal['FOREST_COVERAGE', 'IMPERMEABLE_FRAC', 'ROUGHNESS', 'FOREST_SPARSENESS', 'DEP_MAX', 'MAX_DEP_AREA_FRAC', 'DD_MELT_TEMP', 'MELT_FACTOR', 'DD_REFREEZE_TEMP', 'MIN_MELT_FACTOR', 'MAX_MELT_FACTOR', 'REFREEZE_FACTOR', 'REFREEZE_EXP', 'DD_AGGRADATION', 'SNOW_PATCH_LIMIT', 'HBV_MELT_FOR_CORR', 'HBV_MELT_ASP_CORR', 'GLAC_STORAGE_COEFF', 'HBV_MELT_GLACIER_CORR', 'HBV_GLACIER_KMIN', 'HBV_GLACIER_AG', 'CC_DECAY_COEFF', 'SCS_CN', 'SCS_IA_FRACTION', 'PARTITION_COEFF', 'MAX_SAT_AREA_FRAC', 'B_EXP', 'ABST_PERCENT', 'DEP_MAX_FLOW', 'DEP_N', 'DEP_SEEP_K', 'DEP_K', 'DEP_THRESHOLD', 'PDMROF_B', 'PONDED_EXP', 'OW_PET_CORR', 'LAKE_PET_CORR', 'LAKE_REL_COEFF', 'FOREST_PET_CORR', 'GAMMA_SCALE', 'GAMMA_SHAPE', 'GAMMA_SCALE2', 'GAMMA_SHAPE2', 'HMETS_RUNOFF_COEFF', 'AET_COEFF', 'GR4J_X4', 'UBC_ICEPT_FACTOR', 'STREAM_FRACTION', 'BF_LOSS_FRACTION']], NoneType], required=False, default=None, alias='Parameters', alias_priority=2), 'pl': FieldInfo(annotation=Sequence[ravenpy.config.base.ParameterList], required=True), 'units': FieldInfo(annotation=Union[Sequence[str], NoneType], required=False, default=None, alias='Units', alias_priority=2)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

parameters: Sequence[Literal['FOREST_COVERAGE', 'IMPERMEABLE_FRAC', 'ROUGHNESS', 'FOREST_SPARSENESS', 'DEP_MAX', 'MAX_DEP_AREA_FRAC', 'DD_MELT_TEMP', 'MELT_FACTOR', 'DD_REFREEZE_TEMP', 'MIN_MELT_FACTOR', 'MAX_MELT_FACTOR', 'REFREEZE_FACTOR', 'REFREEZE_EXP', 'DD_AGGRADATION', 'SNOW_PATCH_LIMIT', 'HBV_MELT_FOR_CORR', 'HBV_MELT_ASP_CORR', 'GLAC_STORAGE_COEFF', 'HBV_MELT_GLACIER_CORR', 'HBV_GLACIER_KMIN', 'HBV_GLACIER_AG', 'CC_DECAY_COEFF', 'SCS_CN', 'SCS_IA_FRACTION', 'PARTITION_COEFF', 'MAX_SAT_AREA_FRAC', 'B_EXP', 'ABST_PERCENT', 'DEP_MAX_FLOW', 'DEP_N', 'DEP_SEEP_K', 'DEP_K', 'DEP_THRESHOLD', 'PDMROF_B', 'PONDED_EXP', 'OW_PET_CORR', 'LAKE_PET_CORR', 'LAKE_REL_COEFF', 'FOREST_PET_CORR', 'GAMMA_SCALE', 'GAMMA_SHAPE', 'GAMMA_SCALE2', 'GAMMA_SHAPE2', 'HMETS_RUNOFF_COEFF', 'AET_COEFF', 'GR4J_X4', 'UBC_ICEPT_FACTOR', 'STREAM_FRACTION', 'BF_LOSS_FRACTION']] | None
class ravenpy.config.commands.LinearTransform(*, scale: float = 1, offset: float = 0)[source]

Bases: Command

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'offset': FieldInfo(annotation=float, required=False, default=0), 'scale': FieldInfo(annotation=float, required=False, default=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

offset: float
scale: float
to_rv()[source]

Return Raven configuration string.

class ravenpy.config.commands.ObservationData(*, data_type: Literal['HYDROGRAPH'] = 'HYDROGRAPH', units: str = '', ReadFromNetCDF: ReadFromNetCDF, uid: str = '1')[source]

Bases: Data

data_type: Literal['HYDROGRAPH']
classmethod from_nc(fn, station_idx: int = 1, alt_names=(), engine='h5netcdf', **kwds)[source]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'coerce_numbers_to_str': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'data_type': FieldInfo(annotation=Literal['HYDROGRAPH'], required=False, default='HYDROGRAPH'), 'read_from_netcdf': FieldInfo(annotation=ReadFromNetCDF, required=True, alias='ReadFromNetCDF', alias_priority=2), 'uid': FieldInfo(annotation=str, required=False, default='1'), 'units': FieldInfo(annotation=str, required=False, default='')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

uid: str
class ravenpy.config.commands.ObservationErrorModel(*, state: Literal['STREAMFLOW'], dist: Literal['DIST_UNIFORM', 'DIST_NORMAL', 'DIST_GAMMA'], p1: float, p2: float, adj: Literal['ADDITIVE', 'MULTIPLICATIVE'])[source]

Bases: LineCommand

adj: Literal['ADDITIVE', 'MULTIPLICATIVE']
dist: Literal['DIST_UNIFORM', 'DIST_NORMAL', 'DIST_GAMMA']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'adj': FieldInfo(annotation=Literal['ADDITIVE', 'MULTIPLICATIVE'], required=True), 'dist': FieldInfo(annotation=Literal['DIST_UNIFORM', 'DIST_NORMAL', 'DIST_GAMMA'], required=True), 'p1': FieldInfo(annotation=float, required=True), 'p2': FieldInfo(annotation=float, required=True), 'state': FieldInfo(annotation=Literal['STREAMFLOW'], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

p1: float
p2: float
state: Literal['STREAMFLOW']
class ravenpy.config.commands.Process(*, algo: str = 'RAVEN_DEFAULT', source: str | None = None, to: Sequence[str] = ())[source]

Bases: Command

Process type embedded in HydrologicProcesses command.

See processes.py for list of processes.

algo: str
classmethod is_list(v)[source]
classmethod is_source_state_variable(v: str)[source]
classmethod is_to_state_variable(v: Sequence)[source]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=str, required=False, default='RAVEN_DEFAULT'), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

source: str | None
to: Sequence[str]
to_rv()[source]

Return Raven configuration string.

class ravenpy.config.commands.RainSnowTransition(*, temp: Variable | Expression | float | None, delta: Variable | Expression | float | None)[source]

Bases: Command

Specify the range of temperatures over which there will be a rain/snow mix when partitioning total precipitation into rain and snow components.

delta: Variable | Expression | float | None

Range [C].

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'delta': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=True), 'temp': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

temp: Variable | Expression | float | None

Midpoint of the temperature range [C].

to_rv()[source]

Return Raven configuration string.

class ravenpy.config.commands.ReadFromNetCDF(*, FileNameNC: Url | Path, VarNameNC: str, DimNamesNC: Sequence[str], StationIdx: int = 1, TimeShift: float | None = None, LinearTransform: LinearTransform | None = None, Deaccumulate: bool | None = None, LatitudeVarNameNC: str | None = None, LongitudeVarNameNC: str | None = None, ElevationVarNameNC: str | None = None)[source]

Bases: FlatCommand

property da: DataArray

Return DataArray from configuration.

deaccumulate: bool | None
dim_names_nc: Sequence[str]
elevation_var_name_nc: str | None
file_name_nc: Url | Path
classmethod from_nc(fn, data_type, station_idx=1, alt_names=(), engine='h5netcdf', **kwds)[source]

Instantiate class from netCDF dataset.

latitude_var_name_nc: str | None
linear_transform: LinearTransform | None
longitude_var_name_nc: str | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'deaccumulate': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None, alias='Deaccumulate', alias_priority=2), 'dim_names_nc': FieldInfo(annotation=Sequence[str], required=True, alias='DimNamesNC', alias_priority=2), 'elevation_var_name_nc': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='ElevationVarNameNC', alias_priority=2), 'file_name_nc': FieldInfo(annotation=Union[Annotated[pydantic_core._pydantic_core.Url, UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)], Path], required=True, alias='FileNameNC', alias_priority=2, description='NetCDF file name.'), 'latitude_var_name_nc': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='LatitudeVarNameNC', alias_priority=2), 'linear_transform': FieldInfo(annotation=Union[LinearTransform, NoneType], required=False, default=None, alias='LinearTransform', alias_priority=2), 'longitude_var_name_nc': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='LongitudeVarNameNC', alias_priority=2), 'station_idx': FieldInfo(annotation=int, required=False, default=1, alias='StationIdx', alias_priority=2, description='NetCDF index along station dimension. Starts at 1.'), 'time_shift': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, alias='TimeShift', alias_priority=2, description='Time stamp shift in days.'), 'var_name_nc': FieldInfo(annotation=str, required=True, alias='VarNameNC', alias_priority=2, description='NetCDF variable name.')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

classmethod reorder_time(v)[source]

TODO: Return dimensions as x, y, t. Currently only puts time at the end.

station_idx: int
time_shift: float | None
var_name_nc: str
class ravenpy.config.commands.RedirectToFile(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootCommand

RedirectToFile command (RVT).

Notes

For the moment, this command can only be used in the context of a GriddedForcingCommand or a StationForcingCommand, as a grid_weights field replacement when inlining is not desired.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Path, required=True, metadata=[PathType(path_type='file')])}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

root: Path
to_rv()[source]

Return Raven configuration string.

class ravenpy.config.commands.Reservoir(*, name: str = 'Lake_XXX', SubBasinID: int = 0, HRUID: int = 0, Type: str = 'RESROUTE_STANDARD', WeirCoefficient: float = 0, CrestWidth: float = 0, MaxDepth: float = 0, LakeArea: float = 0)[source]

Bases: FlatCommand

Reservoir command (RVH).

crest_width: float
hru_id: int
lake_area: float
max_depth: float
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'crest_width': FieldInfo(annotation=float, required=False, default=0, alias='CrestWidth', alias_priority=2), 'hru_id': FieldInfo(annotation=int, required=False, default=0, alias='HRUID', alias_priority=2), 'lake_area': FieldInfo(annotation=float, required=False, default=0, alias='LakeArea', alias_priority=2, description='Lake area in m2'), 'max_depth': FieldInfo(annotation=float, required=False, default=0, alias='MaxDepth', alias_priority=2), 'name': FieldInfo(annotation=str, required=False, default='Lake_XXX'), 'subbasin_id': FieldInfo(annotation=int, required=False, default=0, alias='SubBasinID', alias_priority=2), 'type': FieldInfo(annotation=str, required=False, default='RESROUTE_STANDARD', alias='Type', alias_priority=2), 'weir_coefficient': FieldInfo(annotation=float, required=False, default=0, alias='WeirCoefficient', alias_priority=2)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
subbasin_id: int
type: str
weir_coefficient: float
ravenpy.config.commands.SB

alias of SubBasin

class ravenpy.config.commands.SBGroupPropertyMultiplier(*, group_name: str, parameter_name: str, mult: float)[source]

Bases: LineCommand

group_name: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'group_name': FieldInfo(annotation=str, required=True), 'mult': FieldInfo(annotation=float, required=True), 'parameter_name': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

mult: float
parameter_name: str
ravenpy.config.commands.SC

alias of SoilClass

ravenpy.config.commands.SP

alias of SoilProfile

class ravenpy.config.commands.SeasonalRelativeHeight(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands._MonthlyRecord], required=False, default=(<ravenpy.config.commands._MonthlyRecord object>,))}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

root: Sequence[_MonthlyRecord]
class ravenpy.config.commands.SeasonalRelativeLAI(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands._MonthlyRecord], required=False, default=(<ravenpy.config.commands._MonthlyRecord object>,))}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

root: Sequence[_MonthlyRecord]
class ravenpy.config.commands.SoilClasses(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

class SoilClass(*, name: str, mineral: Tuple[float, float, float] | None = None, organic: float | None = None)[source]

Bases: Record

mineral: Tuple[float, float, float] | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'mineral': FieldInfo(annotation=Union[Tuple[float, float, float], NoneType], required=False, default=None), 'name': FieldInfo(annotation=str, required=True), 'organic': FieldInfo(annotation=Union[float, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
organic: float | None
classmethod validate_mineral(v)[source]

Assert sum of mineral fraction is 1.

classmethod validate_mineral_pct(v: Tuple)[source]
classmethod validate_organic_pct(v: float)[source]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands.SoilClasses.SoilClass], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

root: Sequence[SoilClass]
class ravenpy.config.commands.SoilModel(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootCommand

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

root: int
to_rv()[source]

Return Raven configuration string.

class ravenpy.config.commands.SoilParameterList(*, Parameters: Sequence[Literal['SAND_CON', 'CLAY_CON', 'SILT_CON', 'ORG_CON', 'POROSITY', 'STONE_FRAC', 'SAT_WILT', 'FIELD_CAPACITY', 'BULK_DENSITY', 'HYDRAUL_COND', 'CLAPP_B', 'CLAPP N,CLAPP M', 'SAT_RES', 'AIR_ENTRY_PRESSURE', 'WILTING_PRESSURE', 'HEAT_CAPACITY', 'THERMAL_COND', 'WETTING_FRONT_PSI', 'EVAP_RES_FC', 'SHUTTLEWORTH_B', 'ALBEDO_WET', 'ALBEDO_DRY', 'VIZ_ZMIN', 'VIC_ZMAX', 'VIC ALPHA', 'VIC_EVAP_GAMMA', 'MAX_PERC_RATE', 'PERC_N', 'PERC_COEFF', 'SAC_PERC_ALPHA', 'SAC_PERC_EXPON', 'SAC_PERC_PFREE', 'UNAVAIL_FRAC', 'HBV_BETA', 'MAX_BASEFLOW_RATE', 'BASEFLOW_N', 'BASEFLOW_COEFF', 'BASEFLOW_COEFF2', 'BASEFLOW_THRESH', 'BF_LOSS_FRACTION', 'STORAGE_THRESHOLD', 'MAX_CAP_RISE_RATE', 'MAX_INTERFLOW_RATE', 'INTERFLOW_COEF', 'UBC_EVAL_SOIL_DEF', 'UBC_INFIL_SOIL_DEF', 'GR4J_X2', 'GR4J_X3', 'B_EXP', 'PET_CORRECTION']] | None = None, Units: Sequence[str] | None = None, pl: Sequence[ParameterList])[source]

Bases: GenericParameterList

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'parameters': FieldInfo(annotation=Union[Sequence[Literal['SAND_CON', 'CLAY_CON', 'SILT_CON', 'ORG_CON', 'POROSITY', 'STONE_FRAC', 'SAT_WILT', 'FIELD_CAPACITY', 'BULK_DENSITY', 'HYDRAUL_COND', 'CLAPP_B', 'CLAPP N,CLAPP M', 'SAT_RES', 'AIR_ENTRY_PRESSURE', 'WILTING_PRESSURE', 'HEAT_CAPACITY', 'THERMAL_COND', 'WETTING_FRONT_PSI', 'EVAP_RES_FC', 'SHUTTLEWORTH_B', 'ALBEDO_WET', 'ALBEDO_DRY', 'VIZ_ZMIN', 'VIC_ZMAX', 'VIC ALPHA', 'VIC_EVAP_GAMMA', 'MAX_PERC_RATE', 'PERC_N', 'PERC_COEFF', 'SAC_PERC_ALPHA', 'SAC_PERC_EXPON', 'SAC_PERC_PFREE', 'UNAVAIL_FRAC', 'HBV_BETA', 'MAX_BASEFLOW_RATE', 'BASEFLOW_N', 'BASEFLOW_COEFF', 'BASEFLOW_COEFF2', 'BASEFLOW_THRESH', 'BF_LOSS_FRACTION', 'STORAGE_THRESHOLD', 'MAX_CAP_RISE_RATE', 'MAX_INTERFLOW_RATE', 'INTERFLOW_COEF', 'UBC_EVAL_SOIL_DEF', 'UBC_INFIL_SOIL_DEF', 'GR4J_X2', 'GR4J_X3', 'B_EXP', 'PET_CORRECTION']], NoneType], required=False, default=None, alias='Parameters', alias_priority=2), 'pl': FieldInfo(annotation=Sequence[ravenpy.config.base.ParameterList], required=True), 'units': FieldInfo(annotation=Union[Sequence[str], NoneType], required=False, default=None, alias='Units', alias_priority=2)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

parameters: Sequence[Literal['SAND_CON', 'CLAY_CON', 'SILT_CON', 'ORG_CON', 'POROSITY', 'STONE_FRAC', 'SAT_WILT', 'FIELD_CAPACITY', 'BULK_DENSITY', 'HYDRAUL_COND', 'CLAPP_B', 'CLAPP N,CLAPP M', 'SAT_RES', 'AIR_ENTRY_PRESSURE', 'WILTING_PRESSURE', 'HEAT_CAPACITY', 'THERMAL_COND', 'WETTING_FRONT_PSI', 'EVAP_RES_FC', 'SHUTTLEWORTH_B', 'ALBEDO_WET', 'ALBEDO_DRY', 'VIZ_ZMIN', 'VIC_ZMAX', 'VIC ALPHA', 'VIC_EVAP_GAMMA', 'MAX_PERC_RATE', 'PERC_N', 'PERC_COEFF', 'SAC_PERC_ALPHA', 'SAC_PERC_EXPON', 'SAC_PERC_PFREE', 'UNAVAIL_FRAC', 'HBV_BETA', 'MAX_BASEFLOW_RATE', 'BASEFLOW_N', 'BASEFLOW_COEFF', 'BASEFLOW_COEFF2', 'BASEFLOW_THRESH', 'BF_LOSS_FRACTION', 'STORAGE_THRESHOLD', 'MAX_CAP_RISE_RATE', 'MAX_INTERFLOW_RATE', 'INTERFLOW_COEF', 'UBC_EVAL_SOIL_DEF', 'UBC_INFIL_SOIL_DEF', 'GR4J_X2', 'GR4J_X3', 'B_EXP', 'PET_CORRECTION']] | None
class ravenpy.config.commands.SoilProfile(*, name: str = '', soil_classes: Sequence[str] = (), thicknesses: Sequence[Variable | Expression | float | None] = ())[source]

Bases: Record

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'name': FieldInfo(annotation=str, required=False, default=''), 'soil_classes': FieldInfo(annotation=Sequence[str], required=False, default=()), 'thicknesses': FieldInfo(annotation=Sequence[Union[pymbolic.primitives.Variable, pymbolic.primitives.Expression, float, NoneType]], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
soil_classes: Sequence[str]
thicknesses: Sequence[Variable | Expression | float | None]
class ravenpy.config.commands.SoilProfiles(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands.SoilProfile], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

root: Sequence[SoilProfile]
class ravenpy.config.commands.StationForcing(*, FileNameNC: Url | Path, VarNameNC: str, DimNamesNC: Sequence[str], station_idx: int | None = None, TimeShift: float | None = None, LinearTransform: LinearTransform | None = None, Deaccumulate: bool | None = None, LatitudeVarNameNC: str | None = None, LongitudeVarNameNC: str | None = None, ElevationVarNameNC: str | None = None, name: str = '', ForcingType: Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR'] | None = None, GridWeights: GridWeights | RedirectToFile = GridWeights(number_hrus=1, number_grid_cells=1, data=(GWRecord(root=(1, 0, 1.0)),)))[source]

Bases: GriddedForcing

StationForcing command (RVT).

classmethod check_dims(v)[source]
classmethod from_nc(fn, data_type, alt_names=(), **kwds)[source]

Instantiate class from netCDF dataset.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'deaccumulate': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None, alias='Deaccumulate', alias_priority=2), 'dim_names_nc': FieldInfo(annotation=Sequence[str], required=True, alias='DimNamesNC', alias_priority=2), 'elevation_var_name_nc': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='ElevationVarNameNC', alias_priority=2), 'file_name_nc': FieldInfo(annotation=Union[Annotated[pydantic_core._pydantic_core.Url, UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)], Path], required=True, alias='FileNameNC', alias_priority=2, description='NetCDF file name.'), 'forcing_type': FieldInfo(annotation=Union[Literal['PRECIP', 'PRECIP_DAILY_AVE', 'PRECIP_5DAY', 'SNOW_FRAC', 'SNOWFALL', 'RAINFALL', 'RECHARGE', 'TEMP_AVE', 'TEMP_DAILY_AVE', 'TEMP_MIN', 'TEMP_DAILY_MIN', 'TEMP_MAX', 'TEMP_DAILY_MAX', 'TEMP_MONTH_MAX', 'TEMP_MONTH_MIN', 'TEMP_MONTH_AVE', 'TEMP_AVE_UNC', 'TEMP_MAX_UNC', 'TEMP_MIN_UNC', 'AIR_DENS', 'AIR_PRES', 'REL_HUMIDITY', 'ET_RADIA', 'SHORTWAVE', 'SW_RADIA', 'SW_RADIA_NET', 'LW_RADIA_NET', 'LW_INCOMING', 'CLOUD_COVER', 'DAY_LENGTH', 'DAY_ANGLE', 'WIND_VEL', 'PET', 'OW_PET', 'PET_MONTH_AVE', 'POTENTIAL_MELT', 'SUBDAILY_CORR'], NoneType], required=False, default=None, alias='ForcingType', alias_priority=2), 'grid_weights': FieldInfo(annotation=Union[GridWeights, RedirectToFile], required=False, default=GridWeights(number_hrus=1, number_grid_cells=1, data=(GWRecord(root=(1, 0, 1.0)),)), alias='GridWeights', alias_priority=2), 'latitude_var_name_nc': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='LatitudeVarNameNC', alias_priority=2), 'linear_transform': FieldInfo(annotation=Union[LinearTransform, NoneType], required=False, default=None, alias='LinearTransform', alias_priority=2), 'longitude_var_name_nc': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='LongitudeVarNameNC', alias_priority=2), 'name': FieldInfo(annotation=str, required=False, default=''), 'station_idx': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'time_shift': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, alias='TimeShift', alias_priority=2, description='Time stamp shift in days.'), 'var_name_nc': FieldInfo(annotation=str, required=True, alias='VarNameNC', alias_priority=2, description='NetCDF variable name.')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class ravenpy.config.commands.SubBasin(*, subbasin_id: int = 1, name: str = 'sub_001', downstream_id: int = -1, profile: str = 'NONE', reach_length: float = 0, gauged: bool = True, gauge_id: str | None = '')[source]

Bases: Record

Record to populate RVH :SubBasins command internal table.

downstream_id: int
gauge_id: str | None
gauged: bool
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'coerce_numbers_to_str': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'downstream_id': FieldInfo(annotation=int, required=False, default=-1), 'gauge_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=''), 'gauged': FieldInfo(annotation=bool, required=False, default=True), 'name': FieldInfo(annotation=str, required=False, default='sub_001'), 'profile': FieldInfo(annotation=str, required=False, default='NONE'), 'reach_length': FieldInfo(annotation=float, required=False, default=0), 'subbasin_id': FieldInfo(annotation=int, required=False, default=1, metadata=[Gt(gt=0)])}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
profile: str
reach_length: float
subbasin_id: int
class ravenpy.config.commands.SubBasinGroup(*, name: str = '', sb_ids: Sequence[int] = ())[source]

Bases: FlatCommand

SubBasinGroup command (RVH).

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'name': FieldInfo(annotation=str, required=False, default=''), 'sb_ids': FieldInfo(annotation=Sequence[int], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
sb_ids: Sequence[int]
to_rv()[source]

Return Raven configuration string.

class ravenpy.config.commands.SubBasinProperties(*, Parameters: Sequence[Literal['TIME_TO_PEAK', 'TIME_CONC', 'TIME_LAG', 'NUM_RESERVOIRS', 'RES_CONSTANT', 'GAMMA_SHAPE', 'GAMMA_SCALE', 'Q_REFERENCE', 'MANNINGS_N', 'SLOPE', 'DIFFUSIVITY', 'CELERITY', 'RAIN_CORR', 'SNOW_CORR']] | None = None, records: Sequence[SubBasinProperty] | None = None)[source]

Bases: Command

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'parameters': FieldInfo(annotation=Union[Sequence[Literal['TIME_TO_PEAK', 'TIME_CONC', 'TIME_LAG', 'NUM_RESERVOIRS', 'RES_CONSTANT', 'GAMMA_SHAPE', 'GAMMA_SCALE', 'Q_REFERENCE', 'MANNINGS_N', 'SLOPE', 'DIFFUSIVITY', 'CELERITY', 'RAIN_CORR', 'SNOW_CORR']], NoneType], required=False, default=None, alias='Parameters', alias_priority=2), 'records': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.SubBasinProperty], NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

parameters: Sequence[Literal['TIME_TO_PEAK', 'TIME_CONC', 'TIME_LAG', 'NUM_RESERVOIRS', 'RES_CONSTANT', 'GAMMA_SHAPE', 'GAMMA_SCALE', 'Q_REFERENCE', 'MANNINGS_N', 'SLOPE', 'DIFFUSIVITY', 'CELERITY', 'RAIN_CORR', 'SNOW_CORR']] | None
records: Sequence[SubBasinProperty] | None
class ravenpy.config.commands.SubBasinProperty(*, sb_id: str, values: Sequence[Variable | Expression | float | None])[source]

Bases: Record

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'coerce_numbers_to_str': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'sb_id': FieldInfo(annotation=str, required=True), 'values': FieldInfo(annotation=Sequence[Union[pymbolic.primitives.Variable, pymbolic.primitives.Expression, float, NoneType]], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

sb_id: str
values: Sequence[Variable | Expression | float | None]
class ravenpy.config.commands.SubBasins(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

SubBasins command (RVH).

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands.SubBasin], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

root: Sequence[SubBasin]
ravenpy.config.commands.TC

alias of TerrainClass

class ravenpy.config.commands.TerrainClass(*, name: str, hillslope_length: Variable | Expression | float | None, drainage_density: Variable | Expression | float | None, topmodel_lambda: Variable | Expression | float | None = None)[source]

Bases: Record

drainage_density: Variable | Expression | float | None
hillslope_length: Variable | Expression | float | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'drainage_density': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=True), 'hillslope_length': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=True), 'name': FieldInfo(annotation=str, required=True), 'topmodel_lambda': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
topmodel_lambda: Variable | Expression | float | None
class ravenpy.config.commands.TerrainClasses(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands.TerrainClass], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

root: Sequence[TerrainClass]
ravenpy.config.commands.VC

alias of VegetationClass

class ravenpy.config.commands.VegetationClass(*, name: str = '', max_ht: Variable | Expression | float | None = 0.0, max_lai: Variable | Expression | float | None = 0.0, max_leaf_cond: Variable | Expression | float | None = 0.0)[source]

Bases: Record

max_ht: Variable | Expression | float | None
max_lai: Variable | Expression | float | None
max_leaf_cond: Variable | Expression | float | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'max_ht': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=False, default=0.0), 'max_lai': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=False, default=0.0), 'max_leaf_cond': FieldInfo(annotation=Union[Variable, Expression, float, NoneType], required=False, default=0.0), 'name': FieldInfo(annotation=str, required=False, default='')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
class ravenpy.config.commands.VegetationClasses(root: RootModelRootType = PydanticUndefined)[source]

Bases: ListCommand

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'root': FieldInfo(annotation=Sequence[ravenpy.config.commands.VegetationClass], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

root: Sequence[VegetationClass]
class ravenpy.config.commands.VegetationParameterList(*, Parameters: Sequence[Literal['MAX_HEIGHT', 'MAX_LEAF_COND', 'MAX_LAI', 'SVF_EXTINCTION', 'RAIN_ICEPT_PCT', 'SNOW_ICEPT_PCT', 'RAIN_ICEPT_FACT', 'SNOW_ICEPT_FACT', 'SAI_HT_RATIO', 'TRUNK_FRACTION', 'STEMFLOW_FRAC', 'ALBEDO', 'ALBEDO_WET', 'MAX_CAPACITY', 'MAX_SNOW_CAPACITY', 'ROOT_EXTINCT', 'MAX_ROOT_LENGTH', 'MIN_RESISTIVITY', 'XYLEM_FRAC', 'ROOTRADIUS', 'PSI_CRITICAL', 'DRIP_PROPORTION', 'MAX_INTERCEPT_RATE', 'CHU_MATURITY', 'VEG_DIAM', 'VEG_MBETA', 'VEG_DENSPET_VEG_CORR', 'TFRAIN', 'TFSNOW', 'RELATIVE_HT', 'RELATIVE_LAI', 'CAP_LAI_RATIO', 'SNOCAP_LAI_RATIO']] | None = None, Units: Sequence[str] | None = None, pl: Sequence[ParameterList])[source]

Bases: GenericParameterList

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'parameters': FieldInfo(annotation=Union[Sequence[Literal['MAX_HEIGHT', 'MAX_LEAF_COND', 'MAX_LAI', 'SVF_EXTINCTION', 'RAIN_ICEPT_PCT', 'SNOW_ICEPT_PCT', 'RAIN_ICEPT_FACT', 'SNOW_ICEPT_FACT', 'SAI_HT_RATIO', 'TRUNK_FRACTION', 'STEMFLOW_FRAC', 'ALBEDO', 'ALBEDO_WET', 'MAX_CAPACITY', 'MAX_SNOW_CAPACITY', 'ROOT_EXTINCT', 'MAX_ROOT_LENGTH', 'MIN_RESISTIVITY', 'XYLEM_FRAC', 'ROOTRADIUS', 'PSI_CRITICAL', 'DRIP_PROPORTION', 'MAX_INTERCEPT_RATE', 'CHU_MATURITY', 'VEG_DIAM', 'VEG_MBETA', 'VEG_DENSPET_VEG_CORR', 'TFRAIN', 'TFSNOW', 'RELATIVE_HT', 'RELATIVE_LAI', 'CAP_LAI_RATIO', 'SNOCAP_LAI_RATIO']], NoneType], required=False, default=None, alias='Parameters', alias_priority=2), 'pl': FieldInfo(annotation=Sequence[ravenpy.config.base.ParameterList], required=True), 'units': FieldInfo(annotation=Union[Sequence[str], NoneType], required=False, default=None, alias='Units', alias_priority=2)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

parameters: Sequence[Literal['MAX_HEIGHT', 'MAX_LEAF_COND', 'MAX_LAI', 'SVF_EXTINCTION', 'RAIN_ICEPT_PCT', 'SNOW_ICEPT_PCT', 'RAIN_ICEPT_FACT', 'SNOW_ICEPT_FACT', 'SAI_HT_RATIO', 'TRUNK_FRACTION', 'STEMFLOW_FRAC', 'ALBEDO', 'ALBEDO_WET', 'MAX_CAPACITY', 'MAX_SNOW_CAPACITY', 'ROOT_EXTINCT', 'MAX_ROOT_LENGTH', 'MIN_RESISTIVITY', 'XYLEM_FRAC', 'ROOTRADIUS', 'PSI_CRITICAL', 'DRIP_PROPORTION', 'MAX_INTERCEPT_RATE', 'CHU_MATURITY', 'VEG_DIAM', 'VEG_MBETA', 'VEG_DENSPET_VEG_CORR', 'TFRAIN', 'TFSNOW', 'RELATIVE_HT', 'RELATIVE_LAI', 'CAP_LAI_RATIO', 'SNOCAP_LAI_RATIO']] | None

ravenpy.config.conventions module

ravenpy.config.defaults module

ravenpy.config.defaults.default_nc_attrs()[source]

Return default NetCDF global attributes.

ravenpy.config.defaults.nc_attrs(cls, val)[source]

Ensure default netCDF attributes are present

ravenpy.config.options module

class ravenpy.config.options.AirPressureMethod(value)[source]

Bases: Enum

An enumeration.

BASIC = 'AIRPRESS_BASIC'
CONST = 'AIRPRESS_CONST'
DATA = 'AIRPRESS_DATA'
UBC = 'AIRPRESS_UBC'
class ravenpy.config.options.Calendar(value)[source]

Bases: Enum

An enumeration.

ALL_LEAP = 'ALL_LEAP'
GREGORIAN = 'GREGORIAN'
JULIAN = 'JULIAN'
NOLEAP = 'NOLEAP'
PROLEPTIC_GREGORIAN = 'PROLEPTIC_GREGORIAN'
STANDARD = 'STANDARD'
class ravenpy.config.options.CatchmentRoute(value)[source]

Bases: Enum

:CatchmentRoute

DELAYED_FIRST_ORDER = 'ROUTE_DELAYED_FIRST_ORDER'
DUMP = 'ROUTE_DUMP'
EXP = 'ROUTE_EXPONENTIAL'
EXPONENTIAL_UH = 'EXPONENTIAL_UH'
GAMMA = 'ROUTE_GAMMA_CONVOLUTION'
RESERVOIR = 'ROUTE_RESERVOIR_SERIES'
TRI = 'ROUTE_TRI_CONVOLUTION'
TRIANGULAR_UH = 'TRIANGULAR_UH'
TRI_CONVOLUTION = 'TRI_CONVOLUTION'
class ravenpy.config.options.CloudCoverMethod(value)[source]

Bases: Enum

An enumeration.

DATA = 'CLOUDCOV_DATA'
NONE = 'CLOUDCOV_NONE'
UBC = 'CLOUDCOV_UBC'
class ravenpy.config.options.EnKFMode(value)[source]

Bases: Enum

An enumeration.

CLOSED_LOOP = 'ENKF_CLOSED_LOOP'
FORECAST = 'ENKF_FORECAST'
OPEN_FORECAST = 'ENKF_OPEN_FORECAST'
OPEN_LOOP = 'ENKF_OPEN_LOOP'
SPINUP = 'ENKF_SPINUP'
class ravenpy.config.options.EvaluationMetrics(value)[source]

Bases: Enum

An enumeration.

ABSERR = 'ABSERR'
ABSMAX = 'ABSMAX'
DIAG_SPEARMAN = 'DIAG_SPEARMAN'
KLING_GUPTA = 'KLING_GUPTA'
LOG_NASH = 'LOG_NASH'
NASH_SUTCLIFFE = 'NASH_SUTCLIFFE'
NSC = 'NSC'
PCT_BIAS = 'PCT_BIAS'
PDIFF = 'PDIFF'
RCOEFF = 'RCOEFF'
RMSE = 'RMSE'
TMVOL = 'TMVOL'
class ravenpy.config.options.Evaporation(value)[source]

Bases: Enum

An enumeration.

CONSTANT = 'PET_CONSTANT'
DATA = 'PET_DATA'
FROMMONTHLY = 'PET_FROMMONTHLY'
HAMON_1961 = 'PET_HAMON_1961'
HARGREAVES = 'PET_HARGREAVES'
HARGREAVES_1985 = 'PET_HARGREAVES_1985'
MAKKINK_1957 = 'PET_MAKKINK_1957'
MOHYSE = 'PET_MOHYSE'
MONTHLY_FACTOR = 'PET_MONTHLY_FACTOR'
OUDIN = 'PET_OUDIN'
PENMAN_COMBINATION = 'PET_PENMAN_COMBINATION'
PENMAN_MONTEITH = 'PET_PENMAN_MONTEITH'
PRIESTLEY_TAYLOR = 'PET_PRIESTLEY_TAYLOR'
TURC_1961 = 'PET_TURC_1961'
VAP_DEFICIT = 'PET_VAPDEFICIT'
class ravenpy.config.options.Interpolation(value)[source]

Bases: Enum

An enumeration.

AVERAGE_ALL = 'INTERP_AVERAGE_ALL'
FROM_FILE = 'INTERP_FROM_FILE'
INVERSE_DISTANCE = 'INTERP_INVERSE_DISTANCE'
NEAREST_NEIGHBOR = 'INTERP_NEAREST_NEIGHBOR'
class ravenpy.config.options.LWIncomingMethod(value)[source]

Bases: Enum

An enumeration.

DATA = 'LW_INC_DATA'
DEFAULT = 'LW_INC_DEFAULT'
DINGMAN = 'LW_INC_DINGMAN'
SICART = 'LW_INC_SICART'
SKYVIEW = 'LW_INC_SKYVIEW'
class ravenpy.config.options.LWRadiationMethod(value)[source]

Bases: Enum

An enumeration.

DATA = 'LW_RAD_DATA'
DEFAULT = 'LW_RAD_DEFAULT'
UBCWM = 'LW_RAD_UBC'
class ravenpy.config.options.MonthlyInterpolationMethod(value)[source]

Bases: Enum

An enumeration.

LINEAR_21 = 'MONTHINT_LINEAR_21'
LINEAR_FOM = 'MONTHINT_LINEAR_FOM'
LINEAR_MID = 'MONTHINT_LINEAR_MID'
UNIFORM = 'MONTHINT_UNIFORM'
class ravenpy.config.options.OroPETCorrect(value)[source]

Bases: Enum

An enumeration.

HBV = 'OROCORR_HBV'
NONE = 'OROCORR_NONE'
SIMPLELAPSE = 'OROCORR_SIMPLELAPSE'
class ravenpy.config.options.OroPrecipCorrect(value)[source]

Bases: Enum

An enumeration.

HBV = 'OROCORR_HBV'
NONE = 'OROCORR_NONE'
SIMPLELAPSE = 'OROCORR_SIMPLELAPSE'
UBC = 'OROCORR_UBC'
class ravenpy.config.options.OroTempCorrect(value)[source]

Bases: Enum

An enumeration.

HBV = 'OROCORR_HBV'
NONE = 'OROCORR_NONE'
SIMPLELAPSE = 'OROCORR_SIMPLELAPSE'
UBC = 'OROCORR_UBC'
UBC2 = 'OROCORR_UBC_2'
class ravenpy.config.options.PotentialMeltMethod(value)[source]

Bases: Enum

:PotentialMelt algorithms

DATA = 'POTMELT_DATA'
DEGREE_DAY = 'POTMELT_DEGREE_DAY'
EB = 'POTMELT_EB'
HBV = 'POTMELT_HBV'
HMETS = 'POTMELT_HMETS'
NONE = 'POTMELT_NONE'
RESTRICTED = 'POTMELT_RESTRICTED'
UBC = 'POTMELT_UBC'
USACE = 'POTMELT_USACE'
class ravenpy.config.options.PrecipIceptFract(value)[source]

Bases: Enum

EXPLAI = 'PRECIP_ICEPT_EXPLAI'
HEDSTROM = 'PRECIP_ICEPT_HEDSTROM'
LAI = 'PRECIP_ICEPT_LAI'
NONE = 'PRECIP_ICEPT_NONE'
USER = 'PRECIP_ICEPT_USER'
class ravenpy.config.options.Precipitation(value)[source]

Bases: Enum

An enumeration.

DEFAULT = 'PRECIP_RAVEN'
class ravenpy.config.options.RainSnowFraction(value)[source]

Bases: Enum

An enumeration.

DATA = 'RAINSNOW_DATA'
DINGMAN = 'RAINSNOW_DINGMAN'
HARDER = 'RAINSNOW_HARDER'
HBV = 'RAINSNOW_HBV'
HSPF = 'RAINSNOW_HSPF'
SNTHERM89 = 'RAINSNOW_SNTHERM89'
UBC = 'RAINSNOW_UBC'
WANG = 'RAINSNOW_WANG'
class ravenpy.config.options.RelativeHumidityMethod(value)[source]

Bases: Enum

An enumeration.

CONSTANT = 'RELHUM_CONSTANT'
CORR = 'RELHUM_CORR'
DATA = 'RELHUM_DATA'
MINDEWPT = 'RELHUM_MINDEWPT'
WINDVEL = 'WINDVEL_CORR'
class ravenpy.config.options.Routing(value)[source]

Bases: Enum

An enumeration.

DIFFUSIVE_WAVE = 'ROUTE_DIFFUSIVE_WAVE'
HYDROLOGIC = 'ROUTE_HYDROLOGIC'
MUSKINGUM = 'MUSKINGUM'
NONE = 'ROUTE_NONE'
PLUG_FLOW = 'ROUTE_PLUG_FLOW'
STORAGE_COEFF = 'ROUTE_STORAGE_COEFF'
class ravenpy.config.options.SWCanopyCorrect(value)[source]

Bases: Enum

An enumeration.

DYNAMIC = 'SW_CANOPY_CORR_DYNAMIC'
NONE = 'SW_CANOPY_CORR_NONE'
STATIC = 'SW_CANOPY_CORR_STATIC'
UBC = 'SW_CANOPY_CORR_UBC'
class ravenpy.config.options.SWCloudCorrect(value)[source]

Bases: Enum

An enumeration.

ANNANDALE = 'SW_CLOUD_CORR_ANNANDALE'
DINGMAN = 'SW_CLOUD_CORR_DINGMAN'
NONE = 'SW_CLOUD_CORR_NONE'
UBC = 'SW_CLOUD_CORR_UBCWM'
class ravenpy.config.options.SWRadiationMethod(value)[source]

Bases: Enum

An enumeration.

DATA = 'SW_RAD_DATA'
DEFAULT = 'SW_RAD_DEFAULT'
UBCWM = 'SW_RAD_UBCWM'
class ravenpy.config.options.SoilModel(value)[source]

Bases: Enum

An enumeration.

MULTILAYER = 'SOIL_MULTILAYER'
ONE_LAYER = 'SOIL_ONE_LAYER'
TWO_LAYER = 'SOIL_TWO_LAYER'
class ravenpy.config.options.SubdailyMethod(value)[source]

Bases: Enum

An enumeration.

NONE = 'SUBDAILY_NONE'
SIMPLE = 'SUBDAILY_SIMPLE'
UBC = 'SUBDAILY_UBC'
class ravenpy.config.options.WindspeedMethod(value)[source]

Bases: Enum

An enumeration.

CONSTANT = 'WINDVEL_CONSTANT'
DATA = 'WINDVEL_DATA'
UBC = 'WINDVEL_UBC'

ravenpy.config.parsers module

ravenpy.config.parsers.output_files(run_name: str, path: Path)[source]

Return path to each output file if it exists.

ravenpy.config.parsers.parse_diagnostics(fn: Path)[source]

Return dictionary of performance metrics.

ravenpy.config.parsers.parse_nc(fn: Path)[source]

Open netCDF dataset with xarray if the path is valid, otherwise return None.

ravenpy.config.parsers.parse_outputs(run_name: str = None, outputdir: [<class 'str'>, <class 'pathlib.Path'>] = None)[source]

Parse outputs from model execution.

Parameters:
  • run_name (str) – RunName value identifying model outputs.

  • outputdir (str or Path) – Path to model output directory. Current directory if None.

Returns:

Dictionary holding model outputs:
  • hydrograph: xarray.Dataset

  • storage: xarray.Dataset

  • solution: Dict[str, Command]

  • diagnostics: Dict[str, list]

Return type:

dict

Notes

Values are set to None if no file is found.

ravenpy.config.parsers.parse_raven_messages(path)[source]

Parse Raven_errors and extract the messages, structured by types.

ravenpy.config.parsers.parse_solution(fn: Path, calendar: str = 'PROLEPTIC_GREGORIAN')[source]

Return command objects from the model output solution.rvc.

ravenpy.config.processes module

class ravenpy.config.processes.Abstraction(*, algo: Literal['ABST_PERCENTAGE', 'ABST_FILL', 'ABST_SCS', 'ABST_PDMROF'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['ABST_PERCENTAGE', 'ABST_FILL', 'ABST_SCS', 'ABST_PDMROF']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['ABST_PERCENTAGE', 'ABST_FILL', 'ABST_SCS', 'ABST_PDMROF'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.Baseflow(*, algo: Literal['BASE_LINEAR', 'BASE_LINEAR_CONSTRAIN', 'BASE_LINEAR_ANALYTIC', 'BASE_POWER_LAW', 'BASE_CONSTANT', 'BASE_VIC', 'BASE_THRESH_POWER', 'BASE_THRESH_STOR', 'BASE_GR4J', 'BASE_TOPMODEL', 'BASE_SACRAMENTO'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['BASE_LINEAR', 'BASE_LINEAR_CONSTRAIN', 'BASE_LINEAR_ANALYTIC', 'BASE_POWER_LAW', 'BASE_CONSTANT', 'BASE_VIC', 'BASE_THRESH_POWER', 'BASE_THRESH_STOR', 'BASE_GR4J', 'BASE_TOPMODEL', 'BASE_SACRAMENTO']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['BASE_LINEAR', 'BASE_LINEAR_CONSTRAIN', 'BASE_LINEAR_ANALYTIC', 'BASE_POWER_LAW', 'BASE_CONSTANT', 'BASE_VIC', 'BASE_THRESH_POWER', 'BASE_THRESH_STOR', 'BASE_GR4J', 'BASE_TOPMODEL', 'BASE_SACRAMENTO'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.CanopyDrip(*, algo: Literal['CANDRIP_RUTTER', 'CANDRIP_SLOWDRAIN'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['CANDRIP_RUTTER', 'CANDRIP_SLOWDRAIN']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['CANDRIP_RUTTER', 'CANDRIP_SLOWDRAIN'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.CanopyEvaporation(*, algo: Literal['CANEVP_RUTTER', 'CANEVP_MAXIMUM', 'CANEVP_ALL'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['CANEVP_RUTTER', 'CANEVP_MAXIMUM', 'CANEVP_ALL']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['CANEVP_RUTTER', 'CANEVP_MAXIMUM', 'CANEVP_ALL'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.CanopySublimation(*, algo: Literal['CANEVP_ALL', 'CANEVP_MAXIMUM', 'CANSUBLIM_ALL', 'CANSUBLIM_MAXIMUM'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['CANEVP_ALL', 'CANEVP_MAXIMUM', 'CANSUBLIM_ALL', 'CANSUBLIM_MAXIMUM']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['CANEVP_ALL', 'CANEVP_MAXIMUM', 'CANSUBLIM_ALL', 'CANSUBLIM_MAXIMUM'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.CapilaryRise(*, algo: Literal['CRISE_HBV'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['CRISE_HBV']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['CRISE_HBV'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.CapillaryRise(*, algo: Literal['RISE_HBV', 'CRISE_HBV'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['RISE_HBV', 'CRISE_HBV']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['RISE_HBV', 'CRISE_HBV'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.Conditional(*, kind: Literal['HRU_TYPE', 'LAND_CLASS', 'HRU_GROUP'], op: Literal['IS', 'IS_NOT'], value: str)[source]

Bases: Command

Conditional statement

kind: Literal['HRU_TYPE', 'LAND_CLASS', 'HRU_GROUP']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'kind': FieldInfo(annotation=Literal['HRU_TYPE', 'LAND_CLASS', 'HRU_GROUP'], required=True), 'op': FieldInfo(annotation=Literal['IS', 'IS_NOT'], required=True), 'value': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(__context: Any) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

op: Literal['IS', 'IS_NOT']
to_rv()[source]

Return Raven configuration string.

value: str
class ravenpy.config.processes.Convolve(*, algo: Literal['CONVOL_GR4J_1', 'CONVOL_GR4J_2', 'CONVOL_GAMMA', 'CONVOL_GAMMA_2'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['CONVOL_GR4J_1', 'CONVOL_GR4J_2', 'CONVOL_GAMMA', 'CONVOL_GAMMA_2']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['CONVOL_GR4J_1', 'CONVOL_GR4J_2', 'CONVOL_GAMMA', 'CONVOL_GAMMA_2'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.CropHeatUnitEvolve(*, algo: Literal['CHU_ONTARIO'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['CHU_ONTARIO']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['CHU_ONTARIO'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.DepressionOverflow(*, algo: Literal['DFLOW_THRESHPOW', 'DFLOW_LINEAR'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['DFLOW_THRESHPOW', 'DFLOW_LINEAR']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['DFLOW_THRESHPOW', 'DFLOW_LINEAR'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.Flush(*, algo: Literal['RAVEN_DEFAULT'] = 'RAVEN_DEFAULT', source: str | None = None, to: Sequence[str] = (), p: float | None = None)[source]

Bases: Process

algo: Literal['RAVEN_DEFAULT']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['RAVEN_DEFAULT'], required=False, default='RAVEN_DEFAULT'), 'p': FieldInfo(annotation=Union[float, NoneType], required=False, default=None), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

p: float | None
class ravenpy.config.processes.GlacierMelt(*, algo: Literal['GMELT_SIMPLE_MELT', 'GMELT_HBV', 'GMELT_UBC'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['GMELT_SIMPLE_MELT', 'GMELT_HBV', 'GMELT_UBC']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['GMELT_SIMPLE_MELT', 'GMELT_HBV', 'GMELT_UBC'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.GlacierRelease(*, algo: Literal['GRELEASE_LINEAR', 'GRELEASE_HBV_EC'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['GRELEASE_LINEAR', 'GRELEASE_HBV_EC']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['GRELEASE_LINEAR', 'GRELEASE_HBV_EC'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.Infiltration(*, algo: Literal['INF_RATIONAL', 'INF_SCS', 'INF_ALL_INFILTRATES', 'INF_GR4J', 'INF_GREEN_AMPT', 'INF_GA_SIMPLE', 'INF_UPSCALED_GREEN_AMPT', 'INF_HBV', 'INF_UBC', 'INF_VIC', 'INF_VIC_ARNO', 'INF_PRMS', 'INF_HMETS'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['INF_RATIONAL', 'INF_SCS', 'INF_ALL_INFILTRATES', 'INF_GR4J', 'INF_GREEN_AMPT', 'INF_GA_SIMPLE', 'INF_UPSCALED_GREEN_AMPT', 'INF_HBV', 'INF_UBC', 'INF_VIC', 'INF_VIC_ARNO', 'INF_PRMS', 'INF_HMETS']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['INF_RATIONAL', 'INF_SCS', 'INF_ALL_INFILTRATES', 'INF_GR4J', 'INF_GREEN_AMPT', 'INF_GA_SIMPLE', 'INF_UPSCALED_GREEN_AMPT', 'INF_HBV', 'INF_UBC', 'INF_VIC', 'INF_VIC_ARNO', 'INF_PRMS', 'INF_HMETS'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.Interflow(*, algo: Literal['INTERFLOW_PRMS'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['INTERFLOW_PRMS']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['INTERFLOW_PRMS'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.LakeEvaporation(*, algo: Literal['LAKE_EVAP_BASIC'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['LAKE_EVAP_BASIC']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['LAKE_EVAP_BASIC'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.LakeFreeze(*, algo: Literal['LFREEZE_BASIC', 'LFREEZE_THERMAL'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['LFREEZE_BASIC', 'LFREEZE_THERMAL']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['LFREEZE_BASIC', 'LFREEZE_THERMAL'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.LakeRelease(*, algo: Literal['LAKEREL_LINEAR'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['LAKEREL_LINEAR']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['LAKEREL_LINEAR'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.LateralEquilibrate(*, algo: str = 'RAVEN_DEFAULT', source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

Lateral equilibrate

Instantaneously equilibrates groundwater storage in basin HRUs.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=str, required=False, default='RAVEN_DEFAULT'), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.LateralFlush(*, algo: str = 'RAVEN_DEFAULT', source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

Lateral flush

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=str, required=False, default='RAVEN_DEFAULT'), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.OpenWaterEvaporation(*, algo: Literal['OPEN_WATER_EVAP', 'OPEN_WATER_RIPARIAN'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['OPEN_WATER_EVAP', 'OPEN_WATER_RIPARIAN']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['OPEN_WATER_EVAP', 'OPEN_WATER_RIPARIAN'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.Overflow(*, algo: Literal['OVERFLOW_RAVEN', 'RAVEN_DEFAULT'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['OVERFLOW_RAVEN', 'RAVEN_DEFAULT']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['OVERFLOW_RAVEN', 'RAVEN_DEFAULT'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.Percolation(*, algo: Literal['PERC_GAWSER', 'PERC_LINEAR', 'PERC_POWER_LAW', 'PERC_PRMS', 'PERC_SACRAMENTO', 'PERC_CONSTANT', 'PERC_GR4J', 'PERC_GR4JEXCH', 'PERC_GR4JEXCH2'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['PERC_GAWSER', 'PERC_LINEAR', 'PERC_POWER_LAW', 'PERC_PRMS', 'PERC_SACRAMENTO', 'PERC_CONSTANT', 'PERC_GR4J', 'PERC_GR4JEXCH', 'PERC_GR4JEXCH2']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['PERC_GAWSER', 'PERC_LINEAR', 'PERC_POWER_LAW', 'PERC_PRMS', 'PERC_SACRAMENTO', 'PERC_CONSTANT', 'PERC_GR4J', 'PERC_GR4JEXCH', 'PERC_GR4JEXCH2'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.Precipitation(*, algo: Literal['PRECIP_RAVEN', 'RAVEN_DEFAULT'] = 'PRECIP_RAVEN', source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['PRECIP_RAVEN', 'RAVEN_DEFAULT']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['PRECIP_RAVEN', 'RAVEN_DEFAULT'], required=False, default='PRECIP_RAVEN'), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.ProcessGroup(*, p: Sequence[Process], params: Sequence[Variable | Expression | float | None])[source]

Bases: Command

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'p': FieldInfo(annotation=Sequence[ravenpy.config.commands.Process], required=True), 'params': FieldInfo(annotation=Sequence[Union[pymbolic.primitives.Variable, pymbolic.primitives.Expression, float, NoneType]], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

p: Sequence[Process]
params: Sequence[Variable | Expression | float | None]
to_rv()[source]

Return Raven configuration string.

class ravenpy.config.processes.Seepage(*, algo: Literal['SEEP_LINEAR'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['SEEP_LINEAR']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['SEEP_LINEAR'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.SnowAlbedoEvolve(*, algo: Literal['SNOALB_UBC'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['SNOALB_UBC']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['SNOALB_UBC'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.SnowBalance(*, algo: Literal['SNOBAL_SIMPLE_MELT', 'SNOBAL_COLD_CONTENT', 'SNOBAL_HBV', 'SNOBAL_TWO_LAYER', 'SNOBAL_CEMA_NIEGE', 'SNOBAL_HMETS', 'SNOWBAL_GAWSER', 'SNOWBAL_UBC'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['SNOBAL_SIMPLE_MELT', 'SNOBAL_COLD_CONTENT', 'SNOBAL_HBV', 'SNOBAL_TWO_LAYER', 'SNOBAL_CEMA_NIEGE', 'SNOBAL_HMETS', 'SNOWBAL_GAWSER', 'SNOWBAL_UBC']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['SNOBAL_SIMPLE_MELT', 'SNOBAL_COLD_CONTENT', 'SNOBAL_HBV', 'SNOBAL_TWO_LAYER', 'SNOBAL_CEMA_NIEGE', 'SNOBAL_HMETS', 'SNOWBAL_GAWSER', 'SNOWBAL_UBC'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.SnowMelt(*, algo: Literal['MELT_POTMELT'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['MELT_POTMELT']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['MELT_POTMELT'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.SnowRefreeze(*, algo: Literal['FREEZE_DEGREE_DAY'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['FREEZE_DEGREE_DAY']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['FREEZE_DEGREE_DAY'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.SnowTempEvolve(*, algo: Literal['SNOTEMP_NEWTONS'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['SNOTEMP_NEWTONS']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['SNOTEMP_NEWTONS'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.SoilBalance(*, algo: Literal['SOILBAL_SACSMA'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['SOILBAL_SACSMA']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['SOILBAL_SACSMA'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.SoilEvaporation(*, algo: Literal['SOILEVAP_VIC', 'SOILEVAP_HBV', 'SOILEVAP_HYPR', 'SOILEVAL_CHU', 'SOILEVAP_UBC', 'SOILEVAP_GR4J', 'SOILEVAP_TOPMODEL', 'SOILEVAP_SEQUEN', 'SOILEVAP_ROOT', 'SOILEVAP_ROOT_CONSTRAIN', 'SOILEVAP_ROOTFRAC', 'SOILEVAP_GAWSER', 'SOILEVAP_FEDERER', 'SOILEVAP_ALL', 'SOILEVAP_LINEAR', 'SOILEVAP_SACSMA', 'SOILEVAP_HYMOD2'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['SOILEVAP_VIC', 'SOILEVAP_HBV', 'SOILEVAP_HYPR', 'SOILEVAL_CHU', 'SOILEVAP_UBC', 'SOILEVAP_GR4J', 'SOILEVAP_TOPMODEL', 'SOILEVAP_SEQUEN', 'SOILEVAP_ROOT', 'SOILEVAP_ROOT_CONSTRAIN', 'SOILEVAP_ROOTFRAC', 'SOILEVAP_GAWSER', 'SOILEVAP_FEDERER', 'SOILEVAP_ALL', 'SOILEVAP_LINEAR', 'SOILEVAP_SACSMA', 'SOILEVAP_HYMOD2']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['SOILEVAP_VIC', 'SOILEVAP_HBV', 'SOILEVAP_HYPR', 'SOILEVAL_CHU', 'SOILEVAP_UBC', 'SOILEVAP_GR4J', 'SOILEVAP_TOPMODEL', 'SOILEVAP_SEQUEN', 'SOILEVAP_ROOT', 'SOILEVAP_ROOT_CONSTRAIN', 'SOILEVAP_ROOTFRAC', 'SOILEVAP_GAWSER', 'SOILEVAP_FEDERER', 'SOILEVAP_ALL', 'SOILEVAP_LINEAR', 'SOILEVAP_SACSMA', 'SOILEVAP_HYMOD2'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class ravenpy.config.processes.Split(*, algo: str = 'RAVEN_DEFAULT', source: str | None = None, to: Tuple[str, str], p: float = None)[source]

Bases: Process

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=str, required=False, default='RAVEN_DEFAULT'), 'p': FieldInfo(annotation=float, required=False, default=None), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Tuple[str, str], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

p: float
to: Tuple[str, str]
class ravenpy.config.processes.Sublimation(*, algo: Literal['SUBLIM_SVERDRUP', 'SUBLIM_KUZMIN', 'SUBLIM_CENTRAL_SIERRA', 'SUBLIM_PSBM', 'SUBLIM_WILLIAMS'], source: str | None = None, to: Sequence[str] = ())[source]

Bases: Process

algo: Literal['SUBLIM_SVERDRUP', 'SUBLIM_KUZMIN', 'SUBLIM_CENTRAL_SIERRA', 'SUBLIM_PSBM', 'SUBLIM_WILLIAMS']
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'algo': FieldInfo(annotation=Literal['SUBLIM_SVERDRUP', 'SUBLIM_KUZMIN', 'SUBLIM_CENTRAL_SIERRA', 'SUBLIM_PSBM', 'SUBLIM_WILLIAMS'], required=True), 'source': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'to': FieldInfo(annotation=Sequence[str], required=False, default=())}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(_ModelMetaclass__context: Any) None

We need to both initialize private attributes and call the user-defined model_post_init method.

ravenpy.config.rvs module

class ravenpy.config.rvs.Config(*, EnKFMode: EnKFMode | None = None, WindowSize: int | None = None, SolutionRunName: str | None = None, ExtraRVTFilename: str | None = None, OutputDirectoryFormat: str | Path | None = None, ForecastRVTFilename: str | None = None, TruncateHindcasts: bool | None = None, ForcingPerturbation: Sequence[ForcingPerturbation] | None = None, AssimilatedState: Sequence[AssimilatedState] | None = None, AssimilateStreamflow: Sequence[AssimilateStreamflow] | None = None, ObservationErrorModel: Sequence[ObservationErrorModel] | None = None, params: Any = None, SoilClasses: SoilClasses | None = None, SoilProfiles: SoilProfiles | None = None, VegetationClasses: VegetationClasses | None = None, LandUseClasses: LandUseClasses | None = None, TerrainClasses: TerrainClasses | None = None, SoilParameterList: SoilParameterList | None = None, LandUseParameterList: LandUseParameterList | None = None, VegetationParameterList: VegetationParameterList | None = None, ChannelProfile: Sequence[ChannelProfile] | None = None, GlobalParameter: Dict[str, Variable | Expression | float | None] | None = {}, RainSnowTransition: RainSnowTransition | None = None, SeasonalRelativeLAI: SeasonalRelativeLAI | None = None, SeasonalRelativeHeight: SeasonalRelativeHeight | None = None, Gauge: Sequence[Gauge] | None = None, StationForcing: Sequence[StationForcing] | None = None, GriddedForcing: Sequence[GriddedForcing] | None = None, ObservationData: Sequence[ObservationData] | None = None, SubBasins: SubBasins | None = None, SubBasinGroup: Sequence[SubBasinGroup] | None = None, SubBasinProperties: SubBasinProperties | None = None, SBGroupPropertyMultiplier: Sequence[SBGroupPropertyMultiplier] | None = None, HRUs: HRUs | None = None, HRUGroup: Sequence[HRUGroup] | None = None, Reservoirs: Sequence[Reservoir] | None = None, HRUStateVariableTable: HRUStateVariableTable | None = None, BasinStateVariables: BasinStateVariables | None = None, UniformInitialConditions: Dict[str, Variable | Expression | float | None] | None = None, SilentMode: bool | None = None, NoisyMode: bool | None = None, RunName: str | None = None, Calendar: Calendar | None = None, StartDate: date | datetime | datetime | None = None, AssimilationStartTime: date | datetime | datetime | None = None, EndDate: date | datetime | datetime | None = None, Duration: float | None = None, TimeStep: float | str | None = None, Routing: Routing | None = None, CatchmentRoute: CatchmentRoute | None = None, Evaporation: Evaporation | None = None, OW_Evaporation: Evaporation | None = None, SWRadiationMethod: SWRadiationMethod | None = None, SWCloudCorrect: SWCloudCorrect | None = None, SWCanopyCorrect: SWCanopyCorrect | None = None, LWRadiationMethod: LWRadiationMethod | None = None, WindspeedMethod: WindspeedMethod | None = None, RainSnowFraction: RainSnowFraction | None = None, PotentialMeltMethod: PotentialMeltMethod | None = None, OroTempCorrect: OroTempCorrect | None = None, OroPrecipCorrect: OroPrecipCorrect | None = None, OroPETCorrect: OroPETCorrect | None = None, CloudCoverMethod: CloudCoverMethod | None = None, PrecipIceptFract: PrecipIceptFract | None = None, SubdailyMethod: SubdailyMethod | None = None, MonthlyInterpolationMethod: MonthlyInterpolationMethod | None = None, SoilModel: SoilModel | None = None, TemperatureCorrection: bool | None = None, LakeStorage: Literal['SURFACE_WATER', 'ATMOSPHERE', 'ATMOS_PRECIP', 'PONDED_WATER', 'SOIL', 'SOIL[0]', 'SOIL[1]', 'SOIL[2]', 'GROUNDWATER', 'CANOPY', 'CANOPY_SNOW', 'TRUNK', 'ROOT', 'DEPRESSION', 'WETLAND', 'LAKE_STORAGE', 'SNOW', 'SNOW_LIQ', 'GLACIER', 'GLACIER_ICE', 'CONVOLUTION', 'CONV_STOR', 'SURFACE_WATER_TEMP', 'SNOW_TEMP', 'COLD_CONTENT', 'GLACIER_CC', 'SOIL_TEMP', 'CANOPY_TEMP', 'SNOW_DEPTH', 'PERMAFROST_DEPTH', 'SNOW_COVER', 'SNOW_AGE', 'SNOW_ALBEDO', 'CROP_HEAT_UNITS', 'CUM_INFIL', 'CUM_SNOWMELT', 'CONSTITUENT', 'CONSTITUENT_SRC', 'CONSTITUENT_SW', 'CONSTITUENT_SINK', 'MULTIPLE'] | None = None, DefineHRUGroups: Sequence[str] | None = None, HydrologicProcesses: Sequence[Process | Conditional | ProcessGroup] | None = None, EvaluationMetrics: Sequence[EvaluationMetrics] | None = None, EvaluationPeriod: Sequence[EvaluationPeriod] | None = None, EnsembleMode: EnsembleMode | None = None, WriteNetcdfFormat: bool | None = None, NetCDFAttribute: Dict[str, str] | None = None, CustomOutput: Sequence[CustomOutput] | None = None, DirectEvaporation: bool | None = None, DeltaresFEWSMode: bool | None = None, DebugMode: bool | None = None, DontWriteWatershedStorage: bool | None = None, PavicsMode: bool | None = None, SuppressOutput: bool | None = None, WriteForcingFunctions: bool | None = None, WriteSubbasinFile: bool | None = None, WriteLocalFlows: bool | None = None)[source]

Bases: RVI, RVC, RVH, RVT, RVP, RVE

duplicate(**kwds)[source]

Duplicate this model, changing the values given in the keywords.

header(rv)[source]

Return the header to print at the top of each RV file.

property is_symbolic

Return True if configuration contains symbolic expressions.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'assimilate_streamflow': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.AssimilateStreamflow], NoneType], required=False, default_factory=<lambda>, alias='AssimilateStreamflow', alias_priority=2, validate_default=False), 'assimilated_state': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.AssimilatedState], NoneType], required=False, default_factory=<lambda>, alias='AssimilatedState', alias_priority=2, validate_default=False), 'assimilation_start_time': FieldInfo(annotation=Union[date, datetime, datetime, NoneType], required=False, default_factory=<lambda>, alias='AssimilationStartTime', alias_priority=2, validate_default=False), 'basin_state_variables': FieldInfo(annotation=Union[BasinStateVariables, NoneType], required=False, default_factory=<lambda>, alias='BasinStateVariables', alias_priority=2, validate_default=False), 'calendar': FieldInfo(annotation=Union[Calendar, NoneType], required=False, default_factory=<lambda>, alias='Calendar', alias_priority=2, validate_default=False), 'catchment_route': FieldInfo(annotation=Union[CatchmentRoute, NoneType], required=False, default_factory=<lambda>, alias='CatchmentRoute', alias_priority=2, validate_default=False), 'channel_profile': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.ChannelProfile], NoneType], required=False, default_factory=<lambda>, alias='ChannelProfile', alias_priority=2, validate_default=False), 'cloud_cover_method': FieldInfo(annotation=Union[CloudCoverMethod, NoneType], required=False, default_factory=<lambda>, alias='CloudCoverMethod', alias_priority=2, validate_default=False), 'custom_output': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.CustomOutput], NoneType], required=False, default_factory=<lambda>, alias='CustomOutput', alias_priority=2, validate_default=False), 'debug_mode': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='DebugMode', alias_priority=2, validate_default=False), 'define_hru_groups': FieldInfo(annotation=Union[Sequence[str], NoneType], required=False, default_factory=<lambda>, alias='DefineHRUGroups', alias_priority=2, validate_default=False), 'deltares_fews_mode': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='DeltaresFEWSMode', alias_priority=2, validate_default=False), 'direct_evaporation': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='DirectEvaporation', alias_priority=2, description='Rainfall is automatically reduced through evapotranspiration up to the limit of the calculated PET.', validate_default=False), 'dont_write_watershed_storage': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='DontWriteWatershedStorage', alias_priority=2, description='Do not write watershed storage variables to disk.', validate_default=False), 'duration': FieldInfo(annotation=Union[float, NoneType], required=False, default_factory=<lambda>, alias='Duration', alias_priority=2, validate_default=False), 'end_date': FieldInfo(annotation=Union[date, datetime, datetime, NoneType], required=False, default_factory=<lambda>, alias='EndDate', alias_priority=2, validate_default=False), 'enkf_mode': FieldInfo(annotation=Union[EnKFMode, NoneType], required=False, default_factory=<lambda>, alias='EnKFMode', alias_priority=2, validate_default=False), 'ensemble_mode': FieldInfo(annotation=Union[EnsembleMode, NoneType], required=False, default_factory=<lambda>, alias='EnsembleMode', alias_priority=2, validate_default=False), 'evaluation_metrics': FieldInfo(annotation=Union[Sequence[ravenpy.config.options.EvaluationMetrics], NoneType], required=False, default_factory=<lambda>, alias='EvaluationMetrics', alias_priority=2, validate_default=False), 'evaluation_period': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.EvaluationPeriod], NoneType], required=False, default_factory=<lambda>, alias='EvaluationPeriod', alias_priority=2, validate_default=False), 'evaporation': FieldInfo(annotation=Union[Evaporation, NoneType], required=False, default_factory=<lambda>, alias='Evaporation', alias_priority=2, validate_default=False), 'extra_rvt_filename': FieldInfo(annotation=Union[str, NoneType], required=False, default_factory=<lambda>, alias='ExtraRVTFilename', alias_priority=2, validate_default=False), 'forcing_perturbation': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.ForcingPerturbation], NoneType], required=False, default_factory=<lambda>, alias='ForcingPerturbation', alias_priority=2, validate_default=False), 'forecast_rvt_filename': FieldInfo(annotation=Union[str, NoneType], required=False, default_factory=<lambda>, alias='ForecastRVTFilename', alias_priority=2, validate_default=False), 'gauge': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.Gauge], NoneType], required=False, default_factory=<lambda>, alias='Gauge', alias_priority=2, validate_default=False), 'global_parameter': FieldInfo(annotation=Union[Dict[str, Union[pymbolic.primitives.Variable, pymbolic.primitives.Expression, float, NoneType]], NoneType], required=False, default={}, alias='GlobalParameter', alias_priority=2), 'gridded_forcing': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.GriddedForcing], NoneType], required=False, default_factory=<lambda>, alias='GriddedForcing', alias_priority=2, validate_default=False), 'hru_group': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.HRUGroup], NoneType], required=False, default_factory=<lambda>, alias='HRUGroup', alias_priority=2, validate_default=False), 'hru_state_variable_table': FieldInfo(annotation=Union[HRUStateVariableTable, NoneType], required=False, default_factory=<lambda>, alias='HRUStateVariableTable', alias_priority=2, validate_default=False), 'hrus': FieldInfo(annotation=Union[HRUs, NoneType], required=False, default_factory=<lambda>, alias='HRUs', alias_priority=2, validate_default=False), 'hydrologic_processes': FieldInfo(annotation=Union[Sequence[Union[ravenpy.config.commands.Process, ravenpy.config.processes.Conditional, ravenpy.config.processes.ProcessGroup]], NoneType], required=False, default_factory=<lambda>, alias='HydrologicProcesses', alias_priority=2, validate_default=False), 'lake_storage': FieldInfo(annotation=Union[Literal['SURFACE_WATER', 'ATMOSPHERE', 'ATMOS_PRECIP', 'PONDED_WATER', 'SOIL', 'SOIL[0]', 'SOIL[1]', 'SOIL[2]', 'GROUNDWATER', 'CANOPY', 'CANOPY_SNOW', 'TRUNK', 'ROOT', 'DEPRESSION', 'WETLAND', 'LAKE_STORAGE', 'SNOW', 'SNOW_LIQ', 'GLACIER', 'GLACIER_ICE', 'CONVOLUTION', 'CONV_STOR', 'SURFACE_WATER_TEMP', 'SNOW_TEMP', 'COLD_CONTENT', 'GLACIER_CC', 'SOIL_TEMP', 'CANOPY_TEMP', 'SNOW_DEPTH', 'PERMAFROST_DEPTH', 'SNOW_COVER', 'SNOW_AGE', 'SNOW_ALBEDO', 'CROP_HEAT_UNITS', 'CUM_INFIL', 'CUM_SNOWMELT', 'CONSTITUENT', 'CONSTITUENT_SRC', 'CONSTITUENT_SW', 'CONSTITUENT_SINK', 'MULTIPLE'], NoneType], required=False, default_factory=<lambda>, alias='LakeStorage', alias_priority=2, validate_default=False), 'land_use_classes': FieldInfo(annotation=Union[LandUseClasses, NoneType], required=False, default_factory=<lambda>, alias='LandUseClasses', alias_priority=2, validate_default=False), 'land_use_parameter_list': FieldInfo(annotation=Union[LandUseParameterList, NoneType], required=False, default_factory=<lambda>, alias='LandUseParameterList', alias_priority=2, validate_default=False), 'lw_radiation_method': FieldInfo(annotation=Union[LWRadiationMethod, NoneType], required=False, default_factory=<lambda>, alias='LWRadiationMethod', alias_priority=2, validate_default=False), 'monthly_interpolation_method': FieldInfo(annotation=Union[MonthlyInterpolationMethod, NoneType], required=False, default_factory=<lambda>, alias='MonthlyInterpolationMethod', alias_priority=2, validate_default=False), 'netcdf_attribute': FieldInfo(annotation=Union[Dict[str, str], NoneType], required=False, default_factory=<lambda>, alias='NetCDFAttribute', alias_priority=2, validate_default=False), 'noisy_mode': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='NoisyMode', alias_priority=2, validate_default=False), 'observation_data': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.ObservationData], NoneType], required=False, default_factory=<lambda>, alias='ObservationData', alias_priority=2, validate_default=False), 'observation_error_model': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.ObservationErrorModel], NoneType], required=False, default_factory=<lambda>, alias='ObservationErrorModel', alias_priority=2, validate_default=False), 'oro_pet_correct': FieldInfo(annotation=Union[OroPETCorrect, NoneType], required=False, default_factory=<lambda>, alias='OroPETCorrect', alias_priority=2, validate_default=False), 'oro_precip_correct': FieldInfo(annotation=Union[OroPrecipCorrect, NoneType], required=False, default_factory=<lambda>, alias='OroPrecipCorrect', alias_priority=2, validate_default=False), 'oro_temp_correct': FieldInfo(annotation=Union[OroTempCorrect, NoneType], required=False, default_factory=<lambda>, alias='OroTempCorrect', alias_priority=2, validate_default=False), 'output_directory_format': FieldInfo(annotation=Union[str, Path, NoneType], required=False, default_factory=<lambda>, alias='OutputDirectoryFormat', alias_priority=2, validate_default=False), 'ow_evaporation': FieldInfo(annotation=Union[Evaporation, NoneType], required=False, default_factory=<lambda>, alias='OW_Evaporation', alias_priority=2, validate_default=False), 'params': FieldInfo(annotation=Any, required=False, default=None), 'pavics_mode': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='PavicsMode', alias_priority=2, validate_default=False), 'potential_melt_method': FieldInfo(annotation=Union[PotentialMeltMethod, NoneType], required=False, default_factory=<lambda>, alias='PotentialMeltMethod', alias_priority=2, validate_default=False), 'precip_icept_frac': FieldInfo(annotation=Union[PrecipIceptFract, NoneType], required=False, default_factory=<lambda>, alias='PrecipIceptFract', alias_priority=2, validate_default=False), 'rain_snow_fraction': FieldInfo(annotation=Union[RainSnowFraction, NoneType], required=False, default_factory=<lambda>, alias='RainSnowFraction', alias_priority=2, validate_default=False), 'rain_snow_transition': FieldInfo(annotation=Union[RainSnowTransition, NoneType], required=False, default_factory=<lambda>, alias='RainSnowTransition', alias_priority=2, validate_default=False), 'reservoirs': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.Reservoir], NoneType], required=False, default_factory=<lambda>, alias='Reservoirs', alias_priority=2, validate_default=False), 'routing': FieldInfo(annotation=Union[Routing, NoneType], required=False, default_factory=<lambda>, alias='Routing', alias_priority=2, validate_default=False), 'run_name': FieldInfo(annotation=Union[str, NoneType], required=False, default_factory=<lambda>, alias='RunName', alias_priority=2, validate_default=False), 'sb_group_property_multiplier': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.SBGroupPropertyMultiplier], NoneType], required=False, default_factory=<lambda>, alias='SBGroupPropertyMultiplier', alias_priority=2, validate_default=False), 'seasonal_relative_height': FieldInfo(annotation=Union[SeasonalRelativeHeight, NoneType], required=False, default_factory=<lambda>, alias='SeasonalRelativeHeight', alias_priority=2, validate_default=False), 'seasonal_relative_lai': FieldInfo(annotation=Union[SeasonalRelativeLAI, NoneType], required=False, default_factory=<lambda>, alias='SeasonalRelativeLAI', alias_priority=2, validate_default=False), 'silent_mode': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='SilentMode', alias_priority=2, validate_default=False), 'soil_classes': FieldInfo(annotation=Union[SoilClasses, NoneType], required=False, default_factory=<lambda>, alias='SoilClasses', alias_priority=2, validate_default=False), 'soil_model': FieldInfo(annotation=Union[SoilModel, NoneType], required=False, default_factory=<lambda>, alias='SoilModel', alias_priority=2, validate_default=False), 'soil_parameter_list': FieldInfo(annotation=Union[SoilParameterList, NoneType], required=False, default_factory=<lambda>, alias='SoilParameterList', alias_priority=2, validate_default=False), 'soil_profiles': FieldInfo(annotation=Union[SoilProfiles, NoneType], required=False, default_factory=<lambda>, alias='SoilProfiles', alias_priority=2, validate_default=False), 'solution_run_name': FieldInfo(annotation=Union[str, NoneType], required=False, default_factory=<lambda>, alias='SolutionRunName', alias_priority=2, validate_default=False), 'start_date': FieldInfo(annotation=Union[date, datetime, datetime, NoneType], required=False, default_factory=<lambda>, alias='StartDate', alias_priority=2, validate_default=False), 'station_forcing': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.StationForcing], NoneType], required=False, default_factory=<lambda>, alias='StationForcing', alias_priority=2, validate_default=False), 'sub_basin_group': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.SubBasinGroup], NoneType], required=False, default_factory=<lambda>, alias='SubBasinGroup', alias_priority=2, validate_default=False), 'sub_basin_properties': FieldInfo(annotation=Union[SubBasinProperties, NoneType], required=False, default_factory=<lambda>, alias='SubBasinProperties', alias_priority=2, validate_default=False), 'sub_basins': FieldInfo(annotation=Union[SubBasins, NoneType], required=False, default_factory=<lambda>, alias='SubBasins', alias_priority=2, validate_default=False), 'subdaily_method': FieldInfo(annotation=Union[SubdailyMethod, NoneType], required=False, default_factory=<lambda>, alias='SubdailyMethod', alias_priority=2, validate_default=False), 'suppress_output': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='SuppressOutput', alias_priority=2, description='Write minimal output to disk when enabled.', validate_default=False), 'sw_canopy_correct': FieldInfo(annotation=Union[SWCanopyCorrect, NoneType], required=False, default_factory=<lambda>, alias='SWCanopyCorrect', alias_priority=2, validate_default=False), 'sw_cloud_correct': FieldInfo(annotation=Union[SWCloudCorrect, NoneType], required=False, default_factory=<lambda>, alias='SWCloudCorrect', alias_priority=2, validate_default=False), 'sw_radiation_method': FieldInfo(annotation=Union[SWRadiationMethod, NoneType], required=False, default_factory=<lambda>, alias='SWRadiationMethod', alias_priority=2, validate_default=False), 'temperature_correction': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='TemperatureCorrection', alias_priority=2, description='Gridded or gauged temperature bias correction.', validate_default=False), 'terrain_classes': FieldInfo(annotation=Union[TerrainClasses, NoneType], required=False, default_factory=<lambda>, alias='TerrainClasses', alias_priority=2, validate_default=False), 'time_step': FieldInfo(annotation=Union[float, str, NoneType], required=False, default_factory=<lambda>, alias='TimeStep', alias_priority=2, validate_default=False), 'truncate_hindcasts': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='TruncateHindcasts', alias_priority=2, validate_default=False), 'uniform_initial_conditions': FieldInfo(annotation=Union[Dict[str, Union[pymbolic.primitives.Variable, pymbolic.primitives.Expression, float, NoneType]], NoneType], required=False, default_factory=<lambda>, alias='UniformInitialConditions', alias_priority=2, validate_default=False), 'vegetation_classes': FieldInfo(annotation=Union[VegetationClasses, NoneType], required=False, default_factory=<lambda>, alias='VegetationClasses', alias_priority=2, validate_default=False), 'vegetation_parameter_list': FieldInfo(annotation=Union[VegetationParameterList, NoneType], required=False, default_factory=<lambda>, alias='VegetationParameterList', alias_priority=2, validate_default=False), 'window_size': FieldInfo(annotation=Union[int, NoneType], required=False, default_factory=<lambda>, alias='WindowSize', alias_priority=2, validate_default=False), 'windspeed_method': FieldInfo(annotation=Union[WindspeedMethod, NoneType], required=False, default_factory=<lambda>, alias='WindspeedMethod', alias_priority=2, validate_default=False), 'write_forcing_functions': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='WriteForcingFunctions', alias_priority=2, description='Write watershed averaged forcing functions (e.g. rainfall, radiation, PET, etc).', validate_default=False), 'write_local_flows': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='WriteLocalFlows', alias_priority=2, description='Write local contribution to hydrograph in hydrograph.csv', validate_default=False), 'write_netcdf_format': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='WriteNetcdfFormat', alias_priority=2, validate_default=False), 'write_subbasin_file': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='WriteSubbasinFile', alias_priority=2, validate_default=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

property rvc
property rve
property rvh
property rvi
property rvp
property rvt
set_params(params) Config[source]

Return a new instance of Config with params set to their numerical values.

set_solution(fn: Path, timestamp: bool = True) Config[source]

Return a new instance of Config with hru, basin states and start date set from an existing solution.

Parameters:
  • fn (Path) – Path to solution file.

  • timestamp (bool) – If False, ignore time stamp information in the solution. If True, the solution will set StartDate to the solution’s timestamp.

Returns:

Config with internal state set from the solution file.

Return type:

Config

write_rv(workdir: str | Path, modelname=None, overwrite=False, header=True)[source]

Write configuration files to disk.

Parameters:
  • workdir (str, Path) – A directory where rv files will be written to disk.

  • modelname (str) – File name stem for rv files. If not given, defaults to RunName if set, otherwise raven.

  • overwrite (bool) – If True, overwrite existing configuration files.

  • header (bool) – If True, write a header at the top of each RV file.

zip(workdir: str | Path, modelname=None, overwrite=False)[source]

Write configuration to zip file.

Parameters:
  • workdir (Path, str) – Path to zip archive storing RV files.

  • modelname (str) – File name stem for rv files. If not given, defaults to RunName if set, otherwise raven.

  • overwrite (bool) – If True, overwrite existing configuration zip file.

class ravenpy.config.rvs.RVC(*, HRUStateVariableTable: HRUStateVariableTable | None = None, BasinStateVariables: BasinStateVariables | None = None, UniformInitialConditions: Dict[str, Variable | Expression | float | None] | None = None)[source]

Bases: RV

basin_state_variables: BasinStateVariables | None
hru_state_variable_table: HRUStateVariableTable | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'basin_state_variables': FieldInfo(annotation=Union[BasinStateVariables, NoneType], required=False, default_factory=<lambda>, alias='BasinStateVariables', alias_priority=2, validate_default=False), 'hru_state_variable_table': FieldInfo(annotation=Union[HRUStateVariableTable, NoneType], required=False, default_factory=<lambda>, alias='HRUStateVariableTable', alias_priority=2, validate_default=False), 'uniform_initial_conditions': FieldInfo(annotation=Union[Dict[str, Union[pymbolic.primitives.Variable, pymbolic.primitives.Expression, float, NoneType]], NoneType], required=False, default_factory=<lambda>, alias='UniformInitialConditions', alias_priority=2, validate_default=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

uniform_initial_conditions: Dict[str, Variable | Expression | float | None] | None
class ravenpy.config.rvs.RVE(*, EnKFMode: EnKFMode | None = None, WindowSize: int | None = None, SolutionRunName: str | None = None, ExtraRVTFilename: str | None = None, OutputDirectoryFormat: str | Path | None = None, ForecastRVTFilename: str | None = None, TruncateHindcasts: bool | None = None, ForcingPerturbation: Sequence[ForcingPerturbation] | None = None, AssimilatedState: Sequence[AssimilatedState] | None = None, AssimilateStreamflow: Sequence[AssimilateStreamflow] | None = None, ObservationErrorModel: Sequence[ObservationErrorModel] | None = None)[source]

Bases: RV

assimilate_streamflow: Sequence[AssimilateStreamflow] | None
assimilated_state: Sequence[AssimilatedState] | None
enkf_mode: EnKFMode | None
extra_rvt_filename: str | None
forcing_perturbation: Sequence[ForcingPerturbation] | None
forecast_rvt_filename: str | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'assimilate_streamflow': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.AssimilateStreamflow], NoneType], required=False, default_factory=<lambda>, alias='AssimilateStreamflow', alias_priority=2, validate_default=False), 'assimilated_state': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.AssimilatedState], NoneType], required=False, default_factory=<lambda>, alias='AssimilatedState', alias_priority=2, validate_default=False), 'enkf_mode': FieldInfo(annotation=Union[EnKFMode, NoneType], required=False, default_factory=<lambda>, alias='EnKFMode', alias_priority=2, validate_default=False), 'extra_rvt_filename': FieldInfo(annotation=Union[str, NoneType], required=False, default_factory=<lambda>, alias='ExtraRVTFilename', alias_priority=2, validate_default=False), 'forcing_perturbation': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.ForcingPerturbation], NoneType], required=False, default_factory=<lambda>, alias='ForcingPerturbation', alias_priority=2, validate_default=False), 'forecast_rvt_filename': FieldInfo(annotation=Union[str, NoneType], required=False, default_factory=<lambda>, alias='ForecastRVTFilename', alias_priority=2, validate_default=False), 'observation_error_model': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.ObservationErrorModel], NoneType], required=False, default_factory=<lambda>, alias='ObservationErrorModel', alias_priority=2, validate_default=False), 'output_directory_format': FieldInfo(annotation=Union[str, Path, NoneType], required=False, default_factory=<lambda>, alias='OutputDirectoryFormat', alias_priority=2, validate_default=False), 'solution_run_name': FieldInfo(annotation=Union[str, NoneType], required=False, default_factory=<lambda>, alias='SolutionRunName', alias_priority=2, validate_default=False), 'truncate_hindcasts': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='TruncateHindcasts', alias_priority=2, validate_default=False), 'window_size': FieldInfo(annotation=Union[int, NoneType], required=False, default_factory=<lambda>, alias='WindowSize', alias_priority=2, validate_default=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

observation_error_model: Sequence[ObservationErrorModel] | None
output_directory_format: str | Path | None
solution_run_name: str | None
truncate_hindcasts: bool | None
window_size: int | None
class ravenpy.config.rvs.RVH(*, SubBasins: SubBasins | None = None, SubBasinGroup: Sequence[SubBasinGroup] | None = None, SubBasinProperties: SubBasinProperties | None = None, SBGroupPropertyMultiplier: Sequence[SBGroupPropertyMultiplier] | None = None, HRUs: HRUs | None = None, HRUGroup: Sequence[HRUGroup] | None = None, Reservoirs: Sequence[Reservoir] | None = None)[source]

Bases: RV

hru_group: Sequence[HRUGroup] | None
hrus: HRUs | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'hru_group': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.HRUGroup], NoneType], required=False, default_factory=<lambda>, alias='HRUGroup', alias_priority=2, validate_default=False), 'hrus': FieldInfo(annotation=Union[HRUs, NoneType], required=False, default_factory=<lambda>, alias='HRUs', alias_priority=2, validate_default=False), 'reservoirs': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.Reservoir], NoneType], required=False, default_factory=<lambda>, alias='Reservoirs', alias_priority=2, validate_default=False), 'sb_group_property_multiplier': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.SBGroupPropertyMultiplier], NoneType], required=False, default_factory=<lambda>, alias='SBGroupPropertyMultiplier', alias_priority=2, validate_default=False), 'sub_basin_group': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.SubBasinGroup], NoneType], required=False, default_factory=<lambda>, alias='SubBasinGroup', alias_priority=2, validate_default=False), 'sub_basin_properties': FieldInfo(annotation=Union[SubBasinProperties, NoneType], required=False, default_factory=<lambda>, alias='SubBasinProperties', alias_priority=2, validate_default=False), 'sub_basins': FieldInfo(annotation=Union[SubBasins, NoneType], required=False, default_factory=<lambda>, alias='SubBasins', alias_priority=2, validate_default=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

reservoirs: Sequence[Reservoir] | None
sb_group_property_multiplier: Sequence[SBGroupPropertyMultiplier] | None
sub_basin_group: Sequence[SubBasinGroup] | None
sub_basin_properties: SubBasinProperties | None
sub_basins: SubBasins | None
class ravenpy.config.rvs.RVI(*, SilentMode: bool | None = None, NoisyMode: bool | None = None, RunName: str | None = None, Calendar: Calendar | None = None, StartDate: date | datetime | datetime | None = None, AssimilationStartTime: date | datetime | datetime | None = None, EndDate: date | datetime | datetime | None = None, Duration: float | None = None, TimeStep: float | str | None = None, Routing: Routing | None = None, CatchmentRoute: CatchmentRoute | None = None, Evaporation: Evaporation | None = None, OW_Evaporation: Evaporation | None = None, SWRadiationMethod: SWRadiationMethod | None = None, SWCloudCorrect: SWCloudCorrect | None = None, SWCanopyCorrect: SWCanopyCorrect | None = None, LWRadiationMethod: LWRadiationMethod | None = None, WindspeedMethod: WindspeedMethod | None = None, RainSnowFraction: RainSnowFraction | None = None, PotentialMeltMethod: PotentialMeltMethod | None = None, OroTempCorrect: OroTempCorrect | None = None, OroPrecipCorrect: OroPrecipCorrect | None = None, OroPETCorrect: OroPETCorrect | None = None, CloudCoverMethod: CloudCoverMethod | None = None, PrecipIceptFract: PrecipIceptFract | None = None, SubdailyMethod: SubdailyMethod | None = None, MonthlyInterpolationMethod: MonthlyInterpolationMethod | None = None, SoilModel: SoilModel | None = None, TemperatureCorrection: bool | None = None, LakeStorage: Literal['SURFACE_WATER', 'ATMOSPHERE', 'ATMOS_PRECIP', 'PONDED_WATER', 'SOIL', 'SOIL[0]', 'SOIL[1]', 'SOIL[2]', 'GROUNDWATER', 'CANOPY', 'CANOPY_SNOW', 'TRUNK', 'ROOT', 'DEPRESSION', 'WETLAND', 'LAKE_STORAGE', 'SNOW', 'SNOW_LIQ', 'GLACIER', 'GLACIER_ICE', 'CONVOLUTION', 'CONV_STOR', 'SURFACE_WATER_TEMP', 'SNOW_TEMP', 'COLD_CONTENT', 'GLACIER_CC', 'SOIL_TEMP', 'CANOPY_TEMP', 'SNOW_DEPTH', 'PERMAFROST_DEPTH', 'SNOW_COVER', 'SNOW_AGE', 'SNOW_ALBEDO', 'CROP_HEAT_UNITS', 'CUM_INFIL', 'CUM_SNOWMELT', 'CONSTITUENT', 'CONSTITUENT_SRC', 'CONSTITUENT_SW', 'CONSTITUENT_SINK', 'MULTIPLE'] | None = None, DefineHRUGroups: Sequence[str] | None = None, HydrologicProcesses: Sequence[Process | Conditional | ProcessGroup] | None = None, EvaluationMetrics: Sequence[EvaluationMetrics] | None = None, EvaluationPeriod: Sequence[EvaluationPeriod] | None = None, EnsembleMode: EnsembleMode | None = None, WriteNetcdfFormat: bool | None = None, NetCDFAttribute: Dict[str, str] | None = None, CustomOutput: Sequence[CustomOutput] | None = None, DirectEvaporation: bool | None = None, DeltaresFEWSMode: bool | None = None, DebugMode: bool | None = None, DontWriteWatershedStorage: bool | None = None, PavicsMode: bool | None = None, SuppressOutput: bool | None = None, WriteForcingFunctions: bool | None = None, WriteSubbasinFile: bool | None = None, WriteLocalFlows: bool | None = None)[source]

Bases: RV

assimilation_start_time: date | datetime | datetime | None
calendar: Calendar | None
catchment_route: CatchmentRoute | None
cloud_cover_method: CloudCoverMethod | None
custom_output: Sequence[CustomOutput] | None
classmethod dates2cf(v, info)[source]

Convert dates to cftime dates.

debug_mode: bool | None
define_hru_groups: Sequence[str] | None
deltares_fews_mode: bool | None
direct_evaporation: bool | None
dont_write_watershed_storage: bool | None
duration: float | None
end_date: date | datetime | datetime | None
ensemble_mode: EnsembleMode | None
evaluation_metrics: Sequence[EvaluationMetrics] | None
evaluation_period: Sequence[EvaluationPeriod] | None
evaporation: Evaporation | None
hydrologic_processes: Sequence[Process | Conditional | ProcessGroup] | None
classmethod init_soil_model(v)[source]
lake_storage: Literal['SURFACE_WATER', 'ATMOSPHERE', 'ATMOS_PRECIP', 'PONDED_WATER', 'SOIL', 'SOIL[0]', 'SOIL[1]', 'SOIL[2]', 'GROUNDWATER', 'CANOPY', 'CANOPY_SNOW', 'TRUNK', 'ROOT', 'DEPRESSION', 'WETLAND', 'LAKE_STORAGE', 'SNOW', 'SNOW_LIQ', 'GLACIER', 'GLACIER_ICE', 'CONVOLUTION', 'CONV_STOR', 'SURFACE_WATER_TEMP', 'SNOW_TEMP', 'COLD_CONTENT', 'GLACIER_CC', 'SOIL_TEMP', 'CANOPY_TEMP', 'SNOW_DEPTH', 'PERMAFROST_DEPTH', 'SNOW_COVER', 'SNOW_AGE', 'SNOW_ALBEDO', 'CROP_HEAT_UNITS', 'CUM_INFIL', 'CUM_SNOWMELT', 'CONSTITUENT', 'CONSTITUENT_SRC', 'CONSTITUENT_SW', 'CONSTITUENT_SINK', 'MULTIPLE'] | None
lw_radiation_method: LWRadiationMethod | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'assimilation_start_time': FieldInfo(annotation=Union[date, datetime, datetime, NoneType], required=False, default_factory=<lambda>, alias='AssimilationStartTime', alias_priority=2, validate_default=False), 'calendar': FieldInfo(annotation=Union[Calendar, NoneType], required=False, default_factory=<lambda>, alias='Calendar', alias_priority=2, validate_default=False), 'catchment_route': FieldInfo(annotation=Union[CatchmentRoute, NoneType], required=False, default_factory=<lambda>, alias='CatchmentRoute', alias_priority=2, validate_default=False), 'cloud_cover_method': FieldInfo(annotation=Union[CloudCoverMethod, NoneType], required=False, default_factory=<lambda>, alias='CloudCoverMethod', alias_priority=2, validate_default=False), 'custom_output': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.CustomOutput], NoneType], required=False, default_factory=<lambda>, alias='CustomOutput', alias_priority=2, validate_default=False), 'debug_mode': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='DebugMode', alias_priority=2, validate_default=False), 'define_hru_groups': FieldInfo(annotation=Union[Sequence[str], NoneType], required=False, default_factory=<lambda>, alias='DefineHRUGroups', alias_priority=2, validate_default=False), 'deltares_fews_mode': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='DeltaresFEWSMode', alias_priority=2, validate_default=False), 'direct_evaporation': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='DirectEvaporation', alias_priority=2, description='Rainfall is automatically reduced through evapotranspiration up to the limit of the calculated PET.', validate_default=False), 'dont_write_watershed_storage': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='DontWriteWatershedStorage', alias_priority=2, description='Do not write watershed storage variables to disk.', validate_default=False), 'duration': FieldInfo(annotation=Union[float, NoneType], required=False, default_factory=<lambda>, alias='Duration', alias_priority=2, validate_default=False), 'end_date': FieldInfo(annotation=Union[date, datetime, datetime, NoneType], required=False, default_factory=<lambda>, alias='EndDate', alias_priority=2, validate_default=False), 'ensemble_mode': FieldInfo(annotation=Union[EnsembleMode, NoneType], required=False, default_factory=<lambda>, alias='EnsembleMode', alias_priority=2, validate_default=False), 'evaluation_metrics': FieldInfo(annotation=Union[Sequence[ravenpy.config.options.EvaluationMetrics], NoneType], required=False, default_factory=<lambda>, alias='EvaluationMetrics', alias_priority=2, validate_default=False), 'evaluation_period': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.EvaluationPeriod], NoneType], required=False, default_factory=<lambda>, alias='EvaluationPeriod', alias_priority=2, validate_default=False), 'evaporation': FieldInfo(annotation=Union[Evaporation, NoneType], required=False, default_factory=<lambda>, alias='Evaporation', alias_priority=2, validate_default=False), 'hydrologic_processes': FieldInfo(annotation=Union[Sequence[Union[ravenpy.config.commands.Process, ravenpy.config.processes.Conditional, ravenpy.config.processes.ProcessGroup]], NoneType], required=False, default_factory=<lambda>, alias='HydrologicProcesses', alias_priority=2, validate_default=False), 'lake_storage': FieldInfo(annotation=Union[Literal['SURFACE_WATER', 'ATMOSPHERE', 'ATMOS_PRECIP', 'PONDED_WATER', 'SOIL', 'SOIL[0]', 'SOIL[1]', 'SOIL[2]', 'GROUNDWATER', 'CANOPY', 'CANOPY_SNOW', 'TRUNK', 'ROOT', 'DEPRESSION', 'WETLAND', 'LAKE_STORAGE', 'SNOW', 'SNOW_LIQ', 'GLACIER', 'GLACIER_ICE', 'CONVOLUTION', 'CONV_STOR', 'SURFACE_WATER_TEMP', 'SNOW_TEMP', 'COLD_CONTENT', 'GLACIER_CC', 'SOIL_TEMP', 'CANOPY_TEMP', 'SNOW_DEPTH', 'PERMAFROST_DEPTH', 'SNOW_COVER', 'SNOW_AGE', 'SNOW_ALBEDO', 'CROP_HEAT_UNITS', 'CUM_INFIL', 'CUM_SNOWMELT', 'CONSTITUENT', 'CONSTITUENT_SRC', 'CONSTITUENT_SW', 'CONSTITUENT_SINK', 'MULTIPLE'], NoneType], required=False, default_factory=<lambda>, alias='LakeStorage', alias_priority=2, validate_default=False), 'lw_radiation_method': FieldInfo(annotation=Union[LWRadiationMethod, NoneType], required=False, default_factory=<lambda>, alias='LWRadiationMethod', alias_priority=2, validate_default=False), 'monthly_interpolation_method': FieldInfo(annotation=Union[MonthlyInterpolationMethod, NoneType], required=False, default_factory=<lambda>, alias='MonthlyInterpolationMethod', alias_priority=2, validate_default=False), 'netcdf_attribute': FieldInfo(annotation=Union[Dict[str, str], NoneType], required=False, default_factory=<lambda>, alias='NetCDFAttribute', alias_priority=2, validate_default=False), 'noisy_mode': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='NoisyMode', alias_priority=2, validate_default=False), 'oro_pet_correct': FieldInfo(annotation=Union[OroPETCorrect, NoneType], required=False, default_factory=<lambda>, alias='OroPETCorrect', alias_priority=2, validate_default=False), 'oro_precip_correct': FieldInfo(annotation=Union[OroPrecipCorrect, NoneType], required=False, default_factory=<lambda>, alias='OroPrecipCorrect', alias_priority=2, validate_default=False), 'oro_temp_correct': FieldInfo(annotation=Union[OroTempCorrect, NoneType], required=False, default_factory=<lambda>, alias='OroTempCorrect', alias_priority=2, validate_default=False), 'ow_evaporation': FieldInfo(annotation=Union[Evaporation, NoneType], required=False, default_factory=<lambda>, alias='OW_Evaporation', alias_priority=2, validate_default=False), 'pavics_mode': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='PavicsMode', alias_priority=2, validate_default=False), 'potential_melt_method': FieldInfo(annotation=Union[PotentialMeltMethod, NoneType], required=False, default_factory=<lambda>, alias='PotentialMeltMethod', alias_priority=2, validate_default=False), 'precip_icept_frac': FieldInfo(annotation=Union[PrecipIceptFract, NoneType], required=False, default_factory=<lambda>, alias='PrecipIceptFract', alias_priority=2, validate_default=False), 'rain_snow_fraction': FieldInfo(annotation=Union[RainSnowFraction, NoneType], required=False, default_factory=<lambda>, alias='RainSnowFraction', alias_priority=2, validate_default=False), 'routing': FieldInfo(annotation=Union[Routing, NoneType], required=False, default_factory=<lambda>, alias='Routing', alias_priority=2, validate_default=False), 'run_name': FieldInfo(annotation=Union[str, NoneType], required=False, default_factory=<lambda>, alias='RunName', alias_priority=2, validate_default=False), 'silent_mode': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='SilentMode', alias_priority=2, validate_default=False), 'soil_model': FieldInfo(annotation=Union[SoilModel, NoneType], required=False, default_factory=<lambda>, alias='SoilModel', alias_priority=2, validate_default=False), 'start_date': FieldInfo(annotation=Union[date, datetime, datetime, NoneType], required=False, default_factory=<lambda>, alias='StartDate', alias_priority=2, validate_default=False), 'subdaily_method': FieldInfo(annotation=Union[SubdailyMethod, NoneType], required=False, default_factory=<lambda>, alias='SubdailyMethod', alias_priority=2, validate_default=False), 'suppress_output': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='SuppressOutput', alias_priority=2, description='Write minimal output to disk when enabled.', validate_default=False), 'sw_canopy_correct': FieldInfo(annotation=Union[SWCanopyCorrect, NoneType], required=False, default_factory=<lambda>, alias='SWCanopyCorrect', alias_priority=2, validate_default=False), 'sw_cloud_correct': FieldInfo(annotation=Union[SWCloudCorrect, NoneType], required=False, default_factory=<lambda>, alias='SWCloudCorrect', alias_priority=2, validate_default=False), 'sw_radiation_method': FieldInfo(annotation=Union[SWRadiationMethod, NoneType], required=False, default_factory=<lambda>, alias='SWRadiationMethod', alias_priority=2, validate_default=False), 'temperature_correction': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='TemperatureCorrection', alias_priority=2, description='Gridded or gauged temperature bias correction.', validate_default=False), 'time_step': FieldInfo(annotation=Union[float, str, NoneType], required=False, default_factory=<lambda>, alias='TimeStep', alias_priority=2, validate_default=False), 'windspeed_method': FieldInfo(annotation=Union[WindspeedMethod, NoneType], required=False, default_factory=<lambda>, alias='WindspeedMethod', alias_priority=2, validate_default=False), 'write_forcing_functions': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='WriteForcingFunctions', alias_priority=2, description='Write watershed averaged forcing functions (e.g. rainfall, radiation, PET, etc).', validate_default=False), 'write_local_flows': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='WriteLocalFlows', alias_priority=2, description='Write local contribution to hydrograph in hydrograph.csv', validate_default=False), 'write_netcdf_format': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='WriteNetcdfFormat', alias_priority=2, validate_default=False), 'write_subbasin_file': FieldInfo(annotation=Union[bool, NoneType], required=False, default_factory=<lambda>, alias='WriteSubbasinFile', alias_priority=2, validate_default=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

monthly_interpolation_method: MonthlyInterpolationMethod | None
netcdf_attribute: Dict[str, str] | None
noisy_mode: bool | None
oro_pet_correct: OroPETCorrect | None
oro_precip_correct: OroPrecipCorrect | None
oro_temp_correct: OroTempCorrect | None
ow_evaporation: Evaporation | None
pavics_mode: bool | None
potential_melt_method: PotentialMeltMethod | None
precip_icept_frac: PrecipIceptFract | None
rain_snow_fraction: RainSnowFraction | None
routing: Routing | None
run_name: str | None
silent_mode: bool | None
soil_model: SoilModel | None
start_date: date | datetime | datetime | None
subdaily_method: SubdailyMethod | None
suppress_output: bool | None
sw_canopy_correct: SWCanopyCorrect | None
sw_cloud_correct: SWCloudCorrect | None
sw_radiation_method: SWRadiationMethod | None
temperature_correction: bool | None
time_step: float | str | None
windspeed_method: WindspeedMethod | None
write_forcing_functions: bool | None
write_local_flows: bool | None
write_netcdf_format: bool | None
write_subbasin_file: bool | None
class ravenpy.config.rvs.RVP(*, params: Any = None, SoilClasses: SoilClasses | None = None, SoilProfiles: SoilProfiles | None = None, VegetationClasses: VegetationClasses | None = None, LandUseClasses: LandUseClasses | None = None, TerrainClasses: TerrainClasses | None = None, SoilParameterList: SoilParameterList | None = None, LandUseParameterList: LandUseParameterList | None = None, VegetationParameterList: VegetationParameterList | None = None, ChannelProfile: Sequence[ChannelProfile] | None = None, GlobalParameter: Dict[str, Variable | Expression | float | None] | None = {}, RainSnowTransition: RainSnowTransition | None = None, SeasonalRelativeLAI: SeasonalRelativeLAI | None = None, SeasonalRelativeHeight: SeasonalRelativeHeight | None = None)[source]

Bases: RV

channel_profile: Sequence[ChannelProfile] | None
global_parameter: Dict[str, Variable | Expression | float | None] | None
land_use_classes: LandUseClasses | None
land_use_parameter_list: LandUseParameterList | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'channel_profile': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.ChannelProfile], NoneType], required=False, default_factory=<lambda>, alias='ChannelProfile', alias_priority=2, validate_default=False), 'global_parameter': FieldInfo(annotation=Union[Dict[str, Union[pymbolic.primitives.Variable, pymbolic.primitives.Expression, float, NoneType]], NoneType], required=False, default={}, alias='GlobalParameter', alias_priority=2), 'land_use_classes': FieldInfo(annotation=Union[LandUseClasses, NoneType], required=False, default_factory=<lambda>, alias='LandUseClasses', alias_priority=2, validate_default=False), 'land_use_parameter_list': FieldInfo(annotation=Union[LandUseParameterList, NoneType], required=False, default_factory=<lambda>, alias='LandUseParameterList', alias_priority=2, validate_default=False), 'params': FieldInfo(annotation=Any, required=False, default=None), 'rain_snow_transition': FieldInfo(annotation=Union[RainSnowTransition, NoneType], required=False, default_factory=<lambda>, alias='RainSnowTransition', alias_priority=2, validate_default=False), 'seasonal_relative_height': FieldInfo(annotation=Union[SeasonalRelativeHeight, NoneType], required=False, default_factory=<lambda>, alias='SeasonalRelativeHeight', alias_priority=2, validate_default=False), 'seasonal_relative_lai': FieldInfo(annotation=Union[SeasonalRelativeLAI, NoneType], required=False, default_factory=<lambda>, alias='SeasonalRelativeLAI', alias_priority=2, validate_default=False), 'soil_classes': FieldInfo(annotation=Union[SoilClasses, NoneType], required=False, default_factory=<lambda>, alias='SoilClasses', alias_priority=2, validate_default=False), 'soil_parameter_list': FieldInfo(annotation=Union[SoilParameterList, NoneType], required=False, default_factory=<lambda>, alias='SoilParameterList', alias_priority=2, validate_default=False), 'soil_profiles': FieldInfo(annotation=Union[SoilProfiles, NoneType], required=False, default_factory=<lambda>, alias='SoilProfiles', alias_priority=2, validate_default=False), 'terrain_classes': FieldInfo(annotation=Union[TerrainClasses, NoneType], required=False, default_factory=<lambda>, alias='TerrainClasses', alias_priority=2, validate_default=False), 'vegetation_classes': FieldInfo(annotation=Union[VegetationClasses, NoneType], required=False, default_factory=<lambda>, alias='VegetationClasses', alias_priority=2, validate_default=False), 'vegetation_parameter_list': FieldInfo(annotation=Union[VegetationParameterList, NoneType], required=False, default_factory=<lambda>, alias='VegetationParameterList', alias_priority=2, validate_default=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

params: Any
rain_snow_transition: RainSnowTransition | None
seasonal_relative_height: SeasonalRelativeHeight | None
seasonal_relative_lai: SeasonalRelativeLAI | None
soil_classes: SoilClasses | None
soil_parameter_list: SoilParameterList | None
soil_profiles: SoilProfiles | None
terrain_classes: TerrainClasses | None
vegetation_classes: VegetationClasses | None
vegetation_parameter_list: VegetationParameterList | None
class ravenpy.config.rvs.RVT(*, Gauge: Sequence[Gauge] | None = None, StationForcing: Sequence[StationForcing] | None = None, GriddedForcing: Sequence[GriddedForcing] | None = None, ObservationData: Sequence[ObservationData] | None = None)[source]

Bases: RV

gauge: Sequence[Gauge] | None
gridded_forcing: Sequence[GriddedForcing] | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'gauge': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.Gauge], NoneType], required=False, default_factory=<lambda>, alias='Gauge', alias_priority=2, validate_default=False), 'gridded_forcing': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.GriddedForcing], NoneType], required=False, default_factory=<lambda>, alias='GriddedForcing', alias_priority=2, validate_default=False), 'observation_data': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.ObservationData], NoneType], required=False, default_factory=<lambda>, alias='ObservationData', alias_priority=2, validate_default=False), 'station_forcing': FieldInfo(annotation=Union[Sequence[ravenpy.config.commands.StationForcing], NoneType], required=False, default_factory=<lambda>, alias='StationForcing', alias_priority=2, validate_default=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

observation_data: Sequence[ObservationData] | None
station_forcing: Sequence[StationForcing] | None
ravenpy.config.rvs.is_symbolic(params: dict) bool[source]

Return True if parameters include a symbolic variable.

ravenpy.config.utils module

ravenpy.config.utils.filter_for(kls, attrs, **kwds)[source]

Return attributes that are fields of dataclass.

Notes

If attrs includes an attribute name and its Raven alias, e.g. linear_transform and LinearTransform, the latter will have priority.

ravenpy.config.utils.get_annotations(a)[source]

Return all annotations inside [] or Union[…].

ravenpy.config.utils.get_average_annual_runoff(nc_file_path: str | PathLike[str], area_in_m2: float, time_dim: str = 'time', obs_var: str = 'qobs', na_value: int | float = -1.2345)[source]

Compute the average annual runoff from observed data.

ravenpy.config.utils.nc_specs(fn: str | PathLike[str], data_type: str, station_idx: int | None = None, alt_names: str | Sequence[str] | None = None, mon_ave: bool = False, engine: str = 'h5netcdf', linear_transform=None)[source]

Extract specifications from netCDF file.

Parameters:
  • fn (str, Path) – NetCDF file path or DAP link.

  • data_type (str) – Raven data type.

  • station_idx (int, optional) – Index along station dimension. Starts at 1.

  • alt_names (str, list) – Alternative variable names for data type if not the CF standard default.

  • mon_ave (bool) – If True, compute the monthly average.

  • engine (str) – The engine used to open the dataset. Default is ‘h5netcdf’.

Return type:

dict

Notes

Attributes: var_name_nc, dim_names_nc, units, linear_transform, latitude_var_name_nc, longitude_var_name_nc, elevation_var_name_nc latitude, longitude, elevation, name