Coverage for dantinox / exceptions.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-30 21:34 +0200

1""" 

2DantinoX exception hierarchy. 

3 

4Catch ``DantinoXError`` to handle any library error; use the sub-classes for 

5finer-grained control. 

6 

7 DantinoXError 

8 ├── ConfigError — invalid or inconsistent Config 

9 ├── CheckpointError — missing or corrupt checkpoint files 

10 ├── BenchmarkError — failure during benchmarking 

11 └── PlotError — failure during plot generation 

12""" 

13 

14from __future__ import annotations 

15 

16 

17class DantinoXError(Exception): 

18 """Base class for all DantinoX exceptions.""" 

19 

20 

21class ConfigError(DantinoXError): 

22 """Raised when a :class:`~core.config.Config` is invalid or inconsistent.""" 

23 

24 

25class CheckpointError(DantinoXError): 

26 """Raised when a run directory, config file, or weights file cannot be loaded.""" 

27 

28 

29class BenchmarkError(DantinoXError): 

30 """Raised when benchmarking a run fails.""" 

31 

32 

33class PlotError(DantinoXError): 

34 """Raised when plot generation fails."""