prolint.config

ProLint configuration module.

This module provides configuration classes, enums, and utilities for customizing ProLint behavior.

Submodules

Attributes

Classes

TimeUnit

Time unit options for contact duration analysis.

NormalizationMethod

Normalization methods for contact durations.

UnitConversionFactor

Conversion factors from time units to seconds.

SimulationParams

Simulation parameters for contact calculations.

Functions

load_theme(→ Dict)

Load the ProLint color theme from JSON file.

hex_to_rgb(→ Tuple[int, int, int])

Convert hex color string to RGB tuple.

color_to_tuple(→ Tuple[float, float, float, float])

Convert color dict to RGBA tuple.

interpolate_gradient(→ Tuple[float, float, float, float])

Interpolate a color from a gradient based on value.

get_color_for_value(→ str)

Get a hex color for a value from a discrete color scale.

get_unit_label(→ str)

Get display label for a time unit.

setup_logging(→ logging.Logger)

Configure logging for ProLint.

get_logger(→ logging.Logger)

Get a child logger for a ProLint module.

Package Contents

class prolint.config.TimeUnit[source]

Bases: str, enum.Enum

Time unit options for contact duration analysis.

FEMTOSECOND

Femtoseconds (“fs”).

Type:

str

PICOSECOND

Picoseconds (“ps”).

Type:

str

NANOSECOND

Nanoseconds (“ns”).

Type:

str

MICROSECOND

Microseconds (“us”).

Type:

str

MILLISECOND

Milliseconds (“ms”).

Type:

str

SECOND

Seconds (“s”).

Type:

str

FEMTOSECOND = 'fs'
PICOSECOND = 'ps'
NANOSECOND = 'ns'
MICROSECOND = 'us'
MILLISECOND = 'ms'
SECOND = 's'
class prolint.config.NormalizationMethod[source]

Bases: str, enum.Enum

Normalization methods for contact durations.

COUNTS

Report durations as frame counts (“counts”).

Type:

str

ACTUAL_TIME

Report durations in time units (“actual_time”).

Type:

str

COUNTS = 'counts'
ACTUAL_TIME = 'actual_time'
class prolint.config.UnitConversionFactor(*args, **kwds)[source]

Bases: enum.Enum

Conversion factors from time units to seconds.

Each member’s value represents the unit in seconds.

fs

Femtoseconds (1e-15 s).

Type:

float

ps

Picoseconds (1e-12 s).

Type:

float

ns

Nanoseconds (1e-9 s).

Type:

float

us

Microseconds (1e-6 s).

Type:

float

ms

Milliseconds (1e-3 s).

Type:

float

s

Seconds (1.0 s).

Type:

float

fs = 1e-15
ps = 1e-12
ns = 1e-09
us = 1e-06
ms = 0.001
s = 1.0
class prolint.config.SimulationParams[source]

Simulation parameters for contact calculations.

units

Time units for output (default: “us”).

Type:

str

normalizer

Normalization method (default: “actual_time”).

Type:

str

unit_conversion_factor

Factor to convert trajectory time to output units.

Type:

float

norm_factor

Normalization factor for contact durations.

Type:

float

units: str = 'us'
normalizer: str = 'actual_time'
unit_conversion_factor: float = 1e-06
norm_factor: float = 1.0
prolint.config.load_theme() Dict[source]

Load the ProLint color theme from JSON file.

Returns:

Theme configuration containing colors, gradients, and amino acid mappings.

Return type:

dict

prolint.config.COLORS: Dict[source]
prolint.config.COLOR_SCALES: Dict[str, List[str]][source]
prolint.config.GRADIENTS: Dict[source]
prolint.config.AMINO_ACID_COLORS: Dict[str, str][source]
prolint.config.AMINO_ACID_ONE_LETTER: Dict[str, str][source]
prolint.config.UNIT_LABELS: Dict[str, str][source]
prolint.config.hex_to_rgb(hex_color: str) Tuple[int, int, int][source]

Convert hex color string to RGB tuple.

Parameters:

hex_color (str) – Hex color string (e.g., “#FF5733” or “FF5733”).

Returns:

RGB values as (red, green, blue), each 0-255.

Return type:

tuple of int

prolint.config.color_to_tuple(color: Dict, normalize: bool = True) Tuple[float, float, float, float][source]

Convert color dict to RGBA tuple.

Parameters:
  • color (dict) – Color dict with “r”, “g”, “b”, “a” keys (RGB in 0-255, alpha in 0-1).

  • normalize (bool, default=True) – If True, normalize RGB values to 0-1 range. Alpha is unchanged.

Returns:

RGBA values as (red, green, blue, alpha).

Return type:

tuple of float

prolint.config.interpolate_gradient(value: float, min_val: float, max_val: float, gradient_name: str = 'sharedContacts') Tuple[float, float, float, float][source]

Interpolate a color from a gradient based on value.

Parameters:
  • value (float) – Value to map to a color.

  • min_val (float) – Minimum value of the range.

  • max_val (float) – Maximum value of the range.

  • gradient_name (str, default="sharedContacts") – Name of the gradient to use from GRADIENTS.

Returns:

Interpolated RGBA color values (0-1 range).

Return type:

tuple of float

prolint.config.get_color_for_value(value: float, scale_name: str = 'prolint', vmin: float = 0, vmax: float = 1) str[source]

Get a hex color for a value from a discrete color scale.

Parameters:
  • value (float) – Value to map to a color.

  • scale_name (str, default="prolint") – Name of the color scale from COLOR_SCALES.

  • vmin (float, default=0) – Minimum value of the range.

  • vmax (float, default=1) – Maximum value of the range.

Returns:

Hex color string.

Return type:

str

prolint.config.get_unit_label(unit: str) str[source]

Get display label for a time unit.

Parameters:

unit (str) – Time unit code (e.g., “us”, “ns”, “ps”).

Returns:

Human-readable unit label (e.g., “μs”, “ns”, “ps”).

Return type:

str

prolint.config.setup_logging(level: int = logging.INFO, format_string: str | None = None, simple: bool = False) logging.Logger[source]

Configure logging for ProLint.

Parameters:
  • level (int, default=logging.INFO) – Logging level (e.g., logging.DEBUG, logging.INFO).

  • format_string (str, optional) – Custom format string for log messages.

  • simple (bool, default=False) – If True, use simplified format without timestamps.

Returns:

Configured ProLint logger instance.

Return type:

logging.Logger

prolint.config.get_logger(name: str) logging.Logger[source]

Get a child logger for a ProLint module.

Parameters:

name (str) – Module name (will be prefixed with “prolint.”).

Returns:

Logger instance for the specified module.

Return type:

logging.Logger