spectrochempy.analysis.constraints.Monotonic

class Monotonic(profile, direction, components=None, tolerance=1.1)[source]

Monotonicity constraint.

States that each selected component must be monotonically increasing or decreasing along the constrained axis (typically the observation/time axis for concentrations).

Parameters:
  • profile (str) – "C" (concentrations) or "St" (spectra).

  • direction (str) – Either "increasing" or "decreasing".

  • components (list[int], optional) – Component indices to which the constraint applies. None (default) means “all components”.

  • tolerance (float, optional) – Admissibility tolerance. Must be >= 1.0. 1.0 makes the constraint strict; values above 1.0 allow small local violations (mirrors the historical monoIncTol / monoDecTol semantics). Default is 1.1.

Examples

>>> from spectrochempy import Monotonic
>>> Monotonic("C", "increasing")
Monotonic(profile='C', direction='increasing', components=None, tolerance=1.1)
>>> Monotonic("C", "decreasing", components=[0], tolerance=1.0)
Monotonic(profile='C', direction='decreasing', components=[0], tolerance=1.0)

Attributes Summary

components

Component selection (None means "all").

direction

Monotonicity direction ("increasing" or "decreasing").

name

Short human-readable name of the constraint family.

profile

Canonical profile identifier ("C" or "St").

tolerance

Admissibility tolerance (>= 1.0).

Attributes Documentation

components

Component selection (None means “all”).

Type:

list[int] or None

direction

Monotonicity direction ("increasing" or "decreasing").

Type:

str

name

Short human-readable name of the constraint family.

Type:

str

profile

Canonical profile identifier ("C" or "St").

Type:

str

tolerance

Admissibility tolerance (>= 1.0).

Type:

float

Examples using spectrochempy.analysis.constraints.Monotonic