Coverage for src/loman/consts.py: 100%

30 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-10-21 05:36 +0000

1"""Constants and enumerations for the loman computation engine.""" 

2 

3from enum import Enum 

4 

5 

6class States(Enum): 

7 """Possible states for a computation node.""" 

8 

9 PLACEHOLDER = 0 

10 UNINITIALIZED = 1 

11 STALE = 2 

12 COMPUTABLE = 3 

13 UPTODATE = 4 

14 ERROR = 5 

15 PINNED = 6 

16 

17 

18class NodeAttributes: 

19 """Constants for node attribute names in the computation graph.""" 

20 

21 VALUE = "value" 

22 STATE = "state" 

23 FUNC = "func" 

24 GROUP = "group" 

25 TAG = "tag" 

26 STYLE = "style" 

27 ARGS = "args" 

28 KWDS = "kwds" 

29 TIMING = "timing" 

30 EXECUTOR = "executor" 

31 CONVERTER = "converter" 

32 

33 

34class EdgeAttributes: 

35 """Constants for edge attribute names in the computation graph.""" 

36 

37 PARAM = "param" 

38 

39 

40class SystemTags: 

41 """System-level tags used internally by loman.""" 

42 

43 SERIALIZE = "__serialize__" 

44 EXPANSION = "__expansion__" 

45 

46 

47class NodeTransformations: 

48 """Node transformation types for visualization.""" 

49 

50 CONTRACT = "contract" 

51 COLLAPSE = "collapse" 

52 EXPAND = "expand"