MHCXGraph.utils.tools.find_class

MHCXGraph.utils.tools.find_class(classes: dict[str, dict[str, float]], value: float)[source]

Find class intervals that contain a numeric value.

Parameters:
  • classes (dict[str, dict[str, float]]) – Dictionary defining class intervals with keys "low" and "high".

  • value (float) – Value to evaluate against interval definitions.

Returns:

class_name – Name of the matching class, a list of classes if multiple intervals match, or None if no interval contains the value.

Return type:

str or list[str] or None