landlab.core.model_component¶
Defines the base component class from which Landlab components inherit.
Base component class methods¶
|
Create a component from an input file. |
|
Returns the dtype of a field (float, int, bool, str...). |
|
Get the units of a particular field. |
|
Get a description of a particular field. |
|
Location where a particular variable is defined. |
|
Print a help message for a particular field. |
|
Create fields for a component based on its input and output var names. |
Create fields for a component based on its optional field outputs, if declared in _optional_var_names. |
|
Return the grid shape attached to the component, if defined. |
|
Return the grid attached to the component. |
|
Return the coordinates of nodes on grid attached to the component. |
- class Component[source]¶
Bases:
object
Base component class from which Landlab components inherit.
- cite_as = ''¶
- property coords¶
Return the coordinates of nodes on grid attached to the component.
- property current_time¶
Current time.
Some components may keep track of the current time. In this case, the
current_time
attribute is incremented. Otherwise it is set to None.- Return type:
current_time
- definitions = ()¶
- property grid¶
Return the grid attached to the component.
- initialize_optional_output_fields()[source]¶
Create fields for a component based on its optional field outputs, if declared in _optional_var_names.
This method will create new fields (without overwrite) for any fields output by the component as optional. New fields are initialized to zero. New fields are created as arrays of floats, unless the component also contains the specifying property _var_type.
- initialize_output_fields(values_per_element=None)[source]¶
Create fields for a component based on its input and output var names.
This method will create new fields (without overwrite) for any fields output by, but not supplied to, the component. New fields are initialized to zero. Ignores optional fields. New fields are created as arrays of floats, unless the component specifies the variable type.
- Parameters:
values_per_element (int (optional)) – On occasion, it is necessary to create a field that is of size (n_grid_elements, values_per_element) instead of the default size (n_grid_elements,). Use this keyword argument to acomplish this task.
- input_var_names = ()¶
- name = None¶
- optional_var_names = ()¶
- output_var_names = ()¶
- property shape¶
Return the grid shape attached to the component, if defined.
- unit_agnostic = None¶
- units = ()¶
- classmethod var_definition(name)[source]¶
Get a description of a particular field.
- Parameters:
name (str) – A field name.
- Returns:
A description of each field.
- Return type:
tuple of (name, *description*)
- classmethod var_help(name)[source]¶
Print a help message for a particular field.
- Parameters:
name (str) – A field name.
- var_mapping = ()¶
- class classproperty[source]¶
Bases:
property
- __init__(*args, **kwargs)¶
- __new__(**kwargs)¶
- deleter()¶
Descriptor to obtain a copy of the property with a different deleter.
- fdel¶
- fget¶
- fset¶
- getter()¶
Descriptor to obtain a copy of the property with a different getter.
- setter()¶
Descriptor to obtain a copy of the property with a different setter.