Coverage for src/seqrule/__init__.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-02-27 10:39 -0600

1""" 

2seqrule - A library for defining and validating sequence rules 

3""" 

4 

5__version__ = "1.0.0" 

6 

7# Core abstractions 

8# Analysis capabilities 

9from .analysis import ( 

10 ComplexityClass, 

11 PropertyAccessType, 

12 RuleAnalyzer, 

13 RuleScorer, 

14) 

15from .core import ( 

16 AbstractObject, 

17 DictAccessProxy, 

18 FormalRule, 

19 FormalRuleProtocol, 

20 Sequence, 

21 check_sequence, 

22) 

23 

24# DSL module 

25from .dsl import DSLRule, and_atomic, if_then_rule, range_rule 

26 

27# Rule combinators (aliases for better readability) 

28from .dsl import DSLRule as And # DSLRule.__and__ provides AND functionality 

29from .dsl import DSLRule as Not # DSLRule.__invert__ provides NOT functionality 

30from .dsl import DSLRule as Or # DSLRule.__or__ provides OR functionality 

31 

32# Generation utilities 

33from .generators import ( 

34 ConstrainedGenerator, 

35 Constraint, 

36 ConstraintFunction, 

37 Domain, 

38 FilterRule, 

39 LazyGenerator, 

40 PropertyPattern, 

41 generate_counter_examples, 

42 generate_lazy, 

43 generate_sequences, 

44) 

45 

46# Commonly used factory functions from rulesets 

47from .rulesets import ( 

48 create_alternation_rule, 

49 create_balanced_rule, 

50 create_gc_content_rule, 

51 create_motif_rule, 

52 create_property_match_rule, 

53 create_property_trend_rule, 

54 create_unique_property_rule, 

55) 

56 

57# Common type definitions 

58from .types import ( 

59 ComplexityOrder, 

60 PredicateFunction, 

61 Properties, 

62 PropertyKey, 

63 PropertyValue, 

64 RuleRelationship, 

65 TransformFunction, 

66) 

67 

68__all__ = [ 

69 # Core abstractions 

70 "AbstractObject", 

71 "Sequence", 

72 "FormalRule", 

73 "FormalRuleProtocol", 

74 "check_sequence", 

75 "DictAccessProxy", 

76 # DSL and rule definitions 

77 "DSLRule", 

78 "if_then_rule", 

79 "range_rule", 

80 "and_atomic", 

81 # Rule combinators 

82 "And", 

83 "Or", 

84 "Not", 

85 # Generation utilities 

86 "generate_sequences", 

87 "generate_counter_examples", 

88 "generate_lazy", 

89 "LazyGenerator", 

90 "ConstrainedGenerator", 

91 "Constraint", 

92 "PropertyPattern", 

93 "Domain", 

94 "FilterRule", 

95 "ConstraintFunction", 

96 # Common types 

97 "RuleRelationship", 

98 "ComplexityOrder", 

99 "PropertyKey", 

100 "PropertyValue", 

101 "Properties", 

102 "PredicateFunction", 

103 "TransformFunction", 

104 # Commonly used factory functions 

105 "create_property_trend_rule", 

106 "create_property_match_rule", 

107 "create_balanced_rule", 

108 "create_unique_property_rule", 

109 "create_alternation_rule", 

110 "create_gc_content_rule", 

111 "create_motif_rule", 

112 # Analysis capabilities 

113 "RuleAnalyzer", 

114 "RuleScorer", 

115 "ComplexityClass", 

116 "PropertyAccessType", 

117]