API Reference
Complete API documentation for mpspline.
Main Function
Classes
HorizonSequence
- class mpspline.spline.HorizonSequence(horizons: list[dict], strict: bool = False)
Bases:
objectRepresents a sequence of soil horizons for a component.
Handles extraction and validation of horizon data, property identification, and preparation for spline interpolation.
- Attributes:
horizons: List of horizon dictionaries max_depth: Maximum depth of any horizon (cm) properties: Sorted list of numeric properties across all horizons
- __init__(horizons: list[dict], strict: bool = False)
Initialize from horizon list.
- Args:
- horizons: List of horizon dicts with keys:
hzname: Horizon name (str)
upper: Depth to top (cm, int/float)
lower: Depth to bottom (cm, int/float)
[property names]: Property values (float)
strict: If True, raise on validation errors instead of warnings
ValidationResult
Secondary Functions
Single Profile Processing
Algorithm Functions
Validation
Constants
Standard Depths
Standard Soil Properties
- mpspline.constants.STANDARD_SOIL_PROPERTIES: dict[str, str] = {'awc_r': 'Available water capacity (cm/cm)', 'ca_r': 'Exchangeable calcium (meq/100g)', 'cec7_r': 'Cation exchange capacity (meq/100g)', 'clay': 'Clay content (%)', 'dbthirdbar_r': 'Bulk density at 1/3 bar (g/cm3)', 'ec_r': 'Electrical conductivity (dS/m)', 'k_r': 'Exchangeable potassium (meq/100g)', 'ksat_r': 'Saturated hydraulic conductivity (cm/hr)', 'mg_r': 'Exchangeable magnesium (meq/100g)', 'na_r': 'Exchangeable sodium (meq/100g)', 'om_r': 'Organic matter (%)', 'ph01mcl_r': 'pH (0.01 M CaCl2)', 'ph1to1h2o_r': 'pH (1:1 H2O)', 'sand': 'Sand content (%)', 'sar_r': 'Sodium adsorption ratio', 'silt': 'Silt content (%)'}
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)