clophfit.fitting.errors#

Error classes for ClopHfit.

This module defines custom exceptions used throughout the ClopHfit package for better error handling and user-friendly error messages.

Exceptions#

ClopHfitError

Base class for all ClopHfit errors.

FitError

Base class for fitting errors.

InsufficientDataError

Raised to prevent fitting failure for too few data points.

ConvergenceError

Raised when fitting fails to converge.

InvalidDataError

Raised when input data is invalid.

CLIError

Base class for CLI-related errors.

FileFormatError

Raised when an input file has invalid format.

DataValidationError

Raised when data fails validation checks.

MissingDependencyError

Raised when required file dependencies are missing.

Module Contents#

exception clophfit.fitting.errors.ClopHfitError#

Bases: Exception

Base class for all ClopHfit errors.

exception clophfit.fitting.errors.FitError#

Bases: ClopHfitError

Base class for fitting errors.

exception clophfit.fitting.errors.InsufficientDataError#

Bases: FitError

Raised to prevent fitting failure for too few data points.

exception clophfit.fitting.errors.ConvergenceError#

Bases: FitError

Raised when fitting fails to converge.

exception clophfit.fitting.errors.InvalidDataError#

Bases: FitError

Raised when input data is invalid.

exception clophfit.fitting.errors.CLIError#

Bases: ClopHfitError

Base class for CLI-related errors.

exception clophfit.fitting.errors.FileFormatError(filepath, expected_format, details='')#

Bases: CLIError

Raised when an input file has invalid format.

Parameters:
  • filepath (str) – Path to the problematic file.

  • expected_format (str) – Description of expected file format.

  • details (str, optional) – Additional details about the error.

exception clophfit.fitting.errors.DataValidationError(message, suggestions=None)#

Bases: CLIError

Raised when data fails validation checks.

Parameters:
  • message (str) – Description of the validation error.

  • suggestions (list[str] | None) – List of suggestions to fix the error.

exception clophfit.fitting.errors.MissingDependencyError(missing_file, required_by, reason)#

Bases: CLIError

Raised when required file dependencies are missing.

Parameters:
  • missing_file (str) – The file that is missing.

  • required_by (str) – What requires this file.

  • reason (str) – Why this file is needed.