prolint.config ============== .. py:module:: prolint.config .. autoapi-nested-parse:: ProLint configuration module. This module provides configuration classes, enums, and utilities for customizing ProLint behavior. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/prolint/config/colors/index /autoapi/prolint/config/enums/index /autoapi/prolint/config/logging/index /autoapi/prolint/config/units/index Attributes ---------- .. autoapisummary:: prolint.config.COLORS prolint.config.COLOR_SCALES prolint.config.GRADIENTS prolint.config.AMINO_ACID_COLORS prolint.config.AMINO_ACID_ONE_LETTER prolint.config.UNIT_LABELS Classes ------- .. autoapisummary:: prolint.config.TimeUnit prolint.config.NormalizationMethod prolint.config.UnitConversionFactor prolint.config.SimulationParams Functions --------- .. autoapisummary:: prolint.config.load_theme prolint.config.hex_to_rgb prolint.config.color_to_tuple prolint.config.interpolate_gradient prolint.config.get_color_for_value prolint.config.get_unit_label prolint.config.setup_logging prolint.config.get_logger Package Contents ---------------- .. py:class:: TimeUnit Bases: :py:obj:`str`, :py:obj:`enum.Enum` Time unit options for contact duration analysis. .. attribute:: FEMTOSECOND Femtoseconds ("fs"). :type: str .. attribute:: PICOSECOND Picoseconds ("ps"). :type: str .. attribute:: NANOSECOND Nanoseconds ("ns"). :type: str .. attribute:: MICROSECOND Microseconds ("us"). :type: str .. attribute:: MILLISECOND Milliseconds ("ms"). :type: str .. attribute:: SECOND Seconds ("s"). :type: str .. py:attribute:: FEMTOSECOND :value: 'fs' .. py:attribute:: PICOSECOND :value: 'ps' .. py:attribute:: NANOSECOND :value: 'ns' .. py:attribute:: MICROSECOND :value: 'us' .. py:attribute:: MILLISECOND :value: 'ms' .. py:attribute:: SECOND :value: 's' .. py:class:: NormalizationMethod Bases: :py:obj:`str`, :py:obj:`enum.Enum` Normalization methods for contact durations. .. attribute:: COUNTS Report durations as frame counts ("counts"). :type: str .. attribute:: ACTUAL_TIME Report durations in time units ("actual_time"). :type: str .. py:attribute:: COUNTS :value: 'counts' .. py:attribute:: ACTUAL_TIME :value: 'actual_time' .. py:class:: UnitConversionFactor(*args, **kwds) Bases: :py:obj:`enum.Enum` Conversion factors from time units to seconds. Each member's value represents the unit in seconds. .. attribute:: fs Femtoseconds (1e-15 s). :type: float .. attribute:: ps Picoseconds (1e-12 s). :type: float .. attribute:: ns Nanoseconds (1e-9 s). :type: float .. attribute:: us Microseconds (1e-6 s). :type: float .. attribute:: ms Milliseconds (1e-3 s). :type: float .. attribute:: s Seconds (1.0 s). :type: float .. py:attribute:: fs :value: 1e-15 .. py:attribute:: ps :value: 1e-12 .. py:attribute:: ns :value: 1e-09 .. py:attribute:: us :value: 1e-06 .. py:attribute:: ms :value: 0.001 .. py:attribute:: s :value: 1.0 .. py:class:: SimulationParams Simulation parameters for contact calculations. .. attribute:: units Time units for output (default: "us"). :type: str .. attribute:: normalizer Normalization method (default: "actual_time"). :type: str .. attribute:: unit_conversion_factor Factor to convert trajectory time to output units. :type: float .. attribute:: norm_factor Normalization factor for contact durations. :type: float .. py:attribute:: units :type: str :value: 'us' .. py:attribute:: normalizer :type: str :value: 'actual_time' .. py:attribute:: unit_conversion_factor :type: float :value: 1e-06 .. py:attribute:: norm_factor :type: float :value: 1.0 .. py:function:: load_theme() -> Dict Load the ProLint color theme from JSON file. :returns: Theme configuration containing colors, gradients, and amino acid mappings. :rtype: dict .. py:data:: COLORS :type: Dict .. py:data:: COLOR_SCALES :type: Dict[str, List[str]] .. py:data:: GRADIENTS :type: Dict .. py:data:: AMINO_ACID_COLORS :type: Dict[str, str] .. py:data:: AMINO_ACID_ONE_LETTER :type: Dict[str, str] .. py:data:: UNIT_LABELS :type: Dict[str, str] .. py:function:: hex_to_rgb(hex_color: str) -> Tuple[int, int, int] Convert hex color string to RGB tuple. :param hex_color: Hex color string (e.g., "#FF5733" or "FF5733"). :type hex_color: str :returns: RGB values as (red, green, blue), each 0-255. :rtype: tuple of int .. py:function:: color_to_tuple(color: Dict, normalize: bool = True) -> Tuple[float, float, float, float] Convert color dict to RGBA tuple. :param color: Color dict with "r", "g", "b", "a" keys (RGB in 0-255, alpha in 0-1). :type color: dict :param normalize: If True, normalize RGB values to 0-1 range. Alpha is unchanged. :type normalize: bool, default=True :returns: RGBA values as (red, green, blue, alpha). :rtype: tuple of float .. py:function:: interpolate_gradient(value: float, min_val: float, max_val: float, gradient_name: str = 'sharedContacts') -> Tuple[float, float, float, float] Interpolate a color from a gradient based on value. :param value: Value to map to a color. :type value: float :param min_val: Minimum value of the range. :type min_val: float :param max_val: Maximum value of the range. :type max_val: float :param gradient_name: Name of the gradient to use from GRADIENTS. :type gradient_name: str, default="sharedContacts" :returns: Interpolated RGBA color values (0-1 range). :rtype: tuple of float .. py:function:: get_color_for_value(value: float, scale_name: str = 'prolint', vmin: float = 0, vmax: float = 1) -> str Get a hex color for a value from a discrete color scale. :param value: Value to map to a color. :type value: float :param scale_name: Name of the color scale from COLOR_SCALES. :type scale_name: str, default="prolint" :param vmin: Minimum value of the range. :type vmin: float, default=0 :param vmax: Maximum value of the range. :type vmax: float, default=1 :returns: Hex color string. :rtype: str .. py:function:: get_unit_label(unit: str) -> str Get display label for a time unit. :param unit: Time unit code (e.g., "us", "ns", "ps"). :type unit: str :returns: Human-readable unit label (e.g., "μs", "ns", "ps"). :rtype: str .. py:function:: setup_logging(level: int = logging.INFO, format_string: Optional[str] = None, simple: bool = False) -> logging.Logger Configure logging for ProLint. :param level: Logging level (e.g., logging.DEBUG, logging.INFO). :type level: int, default=logging.INFO :param format_string: Custom format string for log messages. :type format_string: str, optional :param simple: If True, use simplified format without timestamps. :type simple: bool, default=False :returns: Configured ProLint logger instance. :rtype: logging.Logger .. py:function:: get_logger(name: str) -> logging.Logger Get a child logger for a ProLint module. :param name: Module name (will be prefixed with "prolint."). :type name: str :returns: Logger instance for the specified module. :rtype: logging.Logger