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

12 statements  

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

1""" 

2Utilities for generating sequences. 

3 

4This module provides functions for generating sequences from domains of objects, 

5with support for bounded generation, filtering, constraints, and prediction. 

6""" 

7 

8# Create type aliases for improved readability 

9from typing import Any, Callable, Dict, List, TypeVar, Union 

10 

11from ..core import AbstractObject, Sequence 

12from .constrained import ConstrainedGenerator 

13from .constraints import Constraint 

14from .core import generate_counter_examples, generate_sequences 

15from .lazy import LazyGenerator, generate_lazy 

16from .patterns import PropertyPattern 

17 

18T = TypeVar("T") 

19Domain = List[Union[AbstractObject, Dict[str, Any]]] 

20FilterRule = Callable[[Sequence], bool] 

21ConstraintFunction = Callable[[Sequence], bool] 

22 

23__all__ = [ 

24 # Core classes 

25 "Constraint", 

26 "PropertyPattern", 

27 "ConstrainedGenerator", 

28 "LazyGenerator", 

29 # Generation functions 

30 "generate_sequences", 

31 "generate_counter_examples", 

32 "generate_lazy", 

33 # Type aliases 

34 "Domain", 

35 "FilterRule", 

36 "ConstraintFunction", 

37]