pyissm.model.classes.dependent
- class pyissm.model.classes.dependent(md=None, other=None)
Bases:
manage_stateDependent variable class for ISSM.
This class contains parameters for dependent variables in the ISSM framework. Dependent variables are outputs or responses that depend on independent variables and are typically used as objective functions in inverse problems or as outputs for sensitivity analysis.
- Parameters:
other (any, optional) – Any other class object that contains common fields to inherit from. If values in
otherdiffer from default values, they will override the default values.
- name
Variable name (must match corresponding String).
- Type:
str, default=’’
- fos_reverse_index
Index for fos_reverse driver of ADOLC.
- Type:
float, default=np.nan
- exp
File needed to compute dependent variable.
- Type:
str, default=’’
- segments
Mass flux segments.
- Type:
list, default=[]
- index
Index parameter.
- Type:
int, default=-1
- nods
Size parameter.
- Type:
int, default=0
Examples
>>> md.dependent = pyissm.model.classes.dependent() >>> md.dependent.name = 'Vel' >>> md.dependent.exp = 'velocity_observations.exp'
- __init__(md=None, other=None)
Initialize the instance with optional field inheritance.
- Parameters:
other (
object, optional) – Another instance to inherit field values from. If provided, any fields in the current instance that differ from the default values and exist in ‘other’ will be replaced with the values from ‘other’.
Notes
The inheritance process:
Iterates through all attributes of the current instance
Checks if the same attribute exists in the ‘other’ instance
Compares field values using _fields_equal()
If different, replaces the current value with the ‘other’ value
This enables the common ISSM pattern where classes can inherit configurations from existing instances while maintaining their default values for unspecified fields.
Methods
__init__([md, other])Initialize the instance with optional field inheritance.
check_consistency(md, solution, analyses)Check consistency of the [dependent] parameters.
issm_enum_string()Default ISSM C++ enum string used during marshalling.
- check_consistency(md, solution, analyses)
Check consistency of the [dependent] parameters.
- Parameters:
md (
pyissm.model.Model) – The model object to check.solution (
str) – The solution name to check.analyses (list of
str) – List of analyses to check consistency for.
- Returns:
md – The model object with any consistency errors noted.
- Return type: