SpaceWeightMap

SpaceWeightMap(space_weights=<factory>)

Parameters

space_weights
Mapping[Space, TypedParam | Evaluated[TypedParam]]
default:"<factory>"
Mapping of spaces to their corresponding weight parameters.

Inheritance

Inheritance Chain:
  • SpaceWeightMap
  • Mapping
  • Collection
  • Sized
  • Iterable
  • Container

Properties

params
Sequence[TypedParam | Evaluated[TypedParam]]
Sequence of all weight parameters in this mapping.
space_weights
Mapping[Space, TypedParam | Evaluated[TypedParam]]
The mapping of spaces to their weight parameters.

Methods

alter_param_values()

alter_param_values(param_values, is_override_set) -> Self | None
param_values
Mapping[str, ParamInputType]
required
The parameter values to alter.
is_override_set
bool
required
Whether this is an override operation.
Returns: Self | None - The altered space weight map or None if no changes.

extend()

extend(weight_param_by_space, all_space) -> Self
weight_param_by_space
Mapping[Space, float | int | Param]
required
Additional weight parameters to extend the mapping with.
all_space
Sequence[Space]
required
All available spaces for the extension.
Returns: Self - The extended space weight map.

set_param_name_if_unset()

set_param_name_if_unset(prefix) -> None
prefix
str
required
The prefix to use for parameter names if they are not set.