scitex_core.errors

exception scitex_core.errors.SciTeXError(message, context=None, suggestion=None)[source]

Bases: Exception

Base Exception class for all SciTeX errors.

__init__(message, context=None, suggestion=None)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.SciTeXWarning[source]

Bases: UserWarning

Base warning class for all SciTeX warnings.

exception scitex_core.errors.ConfigurationError(message, context=None, suggestion=None)[source]

Bases: SciTeXError

Raised when there are issues with SciTeX configuration.

exception scitex_core.errors.ConfigFileNotFoundError(filepath)[source]

Bases: ConfigurationError

Raised when a required configuration file is not found.

__init__(filepath)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.ConfigKeyError(key, available_keys=None)[source]

Bases: ConfigurationError

Raised when a required configuration key is missing.

__init__(key, available_keys=None)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.IOError(message, context=None, suggestion=None)[source]

Bases: SciTeXError

Base class for input/output related errors.

exception scitex_core.errors.FileFormatError(filepath, expected_format=None, actual_format=None)[source]

Bases: IOError

Raised when file format is not supported or incorrect.

__init__(filepath, expected_format=None, actual_format=None)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.SaveError(filepath, reason)[source]

Bases: IOError

Raised when saving data fails.

__init__(filepath, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.LoadError(filepath, reason)[source]

Bases: IOError

Raised when loading data fails.

__init__(filepath, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.ScholarError(message, context=None, suggestion=None)[source]

Bases: SciTeXError

Base class for scholar module errors.

exception scitex_core.errors.SearchError(query, source, reason)[source]

Bases: ScholarError

Raised when paper search fails.

__init__(query, source, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.EnrichmentError(paper_title, reason)[source]

Bases: ScholarError

Raised when paper enrichment fails.

__init__(paper_title, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.PDFDownloadError(url, reason)[source]

Bases: ScholarError

Raised when PDF download fails.

__init__(url, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.DOIResolutionError(doi, reason)[source]

Bases: ScholarError

Raised when DOI resolution fails.

__init__(doi, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.PDFExtractionError(filepath, reason)[source]

Bases: ScholarError

Raised when PDF text extraction fails.

__init__(filepath, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.BibTeXEnrichmentError(bibtex_file, reason)[source]

Bases: ScholarError

Raised when BibTeX enrichment fails.

__init__(bibtex_file, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.TranslatorError(translator_name, reason)[source]

Bases: ScholarError

Raised when Zotero translator operations fail.

__init__(translator_name, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.AuthenticationError(provider, reason='')[source]

Bases: ScholarError

Raised when authentication fails.

__init__(provider, reason='')[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.PlottingError(message, context=None, suggestion=None)[source]

Bases: SciTeXError

Base class for plotting-related errors.

exception scitex_core.errors.FigureNotFoundError(fig_id)[source]

Bases: PlottingError

Raised when attempting to operate on a non-existent figure.

__init__(fig_id)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.AxisError(message, axis_info=None)[source]

Bases: PlottingError

Raised when there are issues with plot axes.

__init__(message, axis_info=None)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.DataError(message, context=None, suggestion=None)[source]

Bases: SciTeXError

Base class for data processing errors.

exception scitex_core.errors.ShapeError(expected_shape, actual_shape, operation)[source]

Bases: DataError

Raised when data shapes are incompatible.

__init__(expected_shape, actual_shape, operation)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.DTypeError(expected_dtype, actual_dtype, operation)[source]

Bases: DataError

Raised when data types are incompatible.

__init__(expected_dtype, actual_dtype, operation)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.PathError(message, context=None, suggestion=None)[source]

Bases: SciTeXError

Base class for path-related errors.

exception scitex_core.errors.InvalidPathError(path, reason)[source]

Bases: PathError

Raised when a path is invalid or doesn’t follow SciTeX conventions.

__init__(path, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.PathNotFoundError(path)[source]

Bases: PathError

Raised when a required path doesn’t exist.

__init__(path)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.TemplateError(message, context=None, suggestion=None)[source]

Bases: SciTeXError

Base class for template-related errors.

exception scitex_core.errors.TemplateViolationError(filepath, violation)[source]

Bases: TemplateError

Raised when SciTeX template is not followed.

__init__(filepath, violation)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.NNError(message, context=None, suggestion=None)[source]

Bases: SciTeXError

Base class for neural network module errors.

exception scitex_core.errors.ModelError(model_name, reason)[source]

Bases: NNError

Raised when there are issues with neural network models.

__init__(model_name, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

exception scitex_core.errors.StatsError(message, context=None, suggestion=None)[source]

Bases: SciTeXError

Base class for statistics module errors.

exception scitex_core.errors.TestError(test_name, reason)[source]

Bases: StatsError

Raised when statistical tests fail.

__init__(test_name, reason)[source]

Initialize SciTeX error with detailed information.

Parameters:
  • message (str) – The error message

  • context (dict, optional) – Additional context information (e.g., file paths, variable values)

  • suggestion (str, optional) – Suggested fix or action

scitex_core.errors.warn_deprecated(old_function, new_function, version=None)[source]

Issue a deprecation warning.

scitex_core.errors.warn_performance(operation, suggestion)[source]

Issue a performance warning.

scitex_core.errors.warn_data_loss(operation, detail)[source]

Issue a data loss warning.

scitex_core.errors.check_path(path)[source]

Validate a path according to SciTeX conventions.

Parameters:

path (str) – The path to validate

Raises:

InvalidPathError – If the path doesn’t follow SciTeX conventions

Return type:

None

scitex_core.errors.check_file_exists(filepath)[source]

Check if a file exists.

Parameters:

filepath (str) – The file path to check

Raises:

PathNotFoundError – If the file doesn’t exist

Return type:

None

scitex_core.errors.check_shape_compatibility(shape1, shape2, operation)[source]

Check if two shapes are compatible for an operation.

Parameters:
  • shape1 (tuple) – First shape

  • shape2 (tuple) – Second shape

  • operation (str) – The operation being performed

Raises:

ShapeError – If shapes are incompatible

Return type:

None