vex-ast 0.2.5__py3-none-any.whl → 0.2.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vex_ast/README.md +101 -51
- vex_ast/READMEAPI.md +133 -318
- vex_ast/__init__.py +81 -81
- vex_ast/ast/README.md +87 -87
- vex_ast/ast/__init__.py +74 -74
- vex_ast/ast/core.py +71 -71
- vex_ast/ast/expressions.py +276 -276
- vex_ast/ast/interfaces.py +208 -208
- vex_ast/ast/literals.py +80 -80
- vex_ast/ast/navigator.py +241 -225
- vex_ast/ast/operators.py +135 -135
- vex_ast/ast/statements.py +351 -351
- vex_ast/ast/validators.py +121 -121
- vex_ast/ast/vex_nodes.py +279 -279
- vex_ast/parser/README.md +47 -47
- vex_ast/parser/__init__.py +26 -26
- vex_ast/parser/factory.py +190 -190
- vex_ast/parser/interfaces.py +34 -34
- vex_ast/parser/python_parser.py +831 -831
- vex_ast/registry/README.md +107 -29
- vex_ast/registry/__init__.py +51 -51
- vex_ast/registry/api.py +190 -155
- vex_ast/registry/categories.py +179 -136
- vex_ast/registry/functions/__init__.py +10 -10
- vex_ast/registry/functions/constructors.py +71 -35
- vex_ast/registry/functions/display.py +146 -146
- vex_ast/registry/functions/drivetrain.py +163 -163
- vex_ast/registry/functions/initialize.py +31 -31
- vex_ast/registry/functions/motor.py +140 -140
- vex_ast/registry/functions/sensors.py +194 -194
- vex_ast/registry/functions/timing.py +103 -103
- vex_ast/registry/language_map.py +77 -77
- vex_ast/registry/registry.py +164 -153
- vex_ast/registry/signature.py +269 -191
- vex_ast/registry/simulation_behavior.py +8 -8
- vex_ast/registry/validation.py +43 -43
- vex_ast/serialization/__init__.py +37 -37
- vex_ast/serialization/json_deserializer.py +284 -284
- vex_ast/serialization/json_serializer.py +148 -148
- vex_ast/serialization/schema.py +492 -492
- vex_ast/types/README.md +78 -26
- vex_ast/types/__init__.py +140 -140
- vex_ast/types/base.py +83 -83
- vex_ast/types/enums.py +122 -122
- vex_ast/types/objects.py +64 -64
- vex_ast/types/primitives.py +68 -68
- vex_ast/types/type_checker.py +31 -31
- vex_ast/utils/README.md +39 -39
- vex_ast/utils/__init__.py +37 -37
- vex_ast/utils/errors.py +112 -112
- vex_ast/utils/source_location.py +38 -38
- vex_ast/utils/type_definitions.py +8 -8
- vex_ast/visitors/README.md +49 -49
- vex_ast/visitors/__init__.py +27 -27
- vex_ast/visitors/analyzer.py +102 -102
- vex_ast/visitors/base.py +133 -133
- vex_ast/visitors/printer.py +196 -196
- {vex_ast-0.2.5.dist-info → vex_ast-0.2.7.dist-info}/METADATA +206 -174
- vex_ast-0.2.7.dist-info/RECORD +64 -0
- vex_ast-0.2.5.dist-info/RECORD +0 -64
- {vex_ast-0.2.5.dist-info → vex_ast-0.2.7.dist-info}/WHEEL +0 -0
- {vex_ast-0.2.5.dist-info → vex_ast-0.2.7.dist-info}/licenses/LICENSE +0 -0
- {vex_ast-0.2.5.dist-info → vex_ast-0.2.7.dist-info}/top_level.txt +0 -0
vex_ast/registry/README.md
CHANGED
@@ -1,29 +1,107 @@
|
|
1
|
-
# VEX AST Registry Package (vex_ast.registry)
|
2
|
-
|
3
|
-
This package manages the registration and organization of VEX V5 Robot Python language features, including functions, objects, and
|
4
|
-
|
5
|
-
Purpose
|
6
|
-
|
7
|
-
The registry provides a centralized system for defining and accessing information about VEX-specific language constructs.
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
* `categories.py`:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
* `
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
*
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
1
|
+
# VEX AST Registry Package (vex_ast.registry)
|
2
|
+
|
3
|
+
This package manages the registration and organization of VEX V5 Robot Python language features, including functions, objects, and their semantic behaviors.
|
4
|
+
|
5
|
+
## Purpose
|
6
|
+
|
7
|
+
The registry provides a centralized system for defining and accessing information about VEX-specific language constructs. It powers intelligent parsing, type checking, and simulation capabilities by maintaining a comprehensive database of VEX functions and their properties.
|
8
|
+
|
9
|
+
## Architecture
|
10
|
+
|
11
|
+
### Core Components
|
12
|
+
|
13
|
+
* `categories.py`: Implements the dual-axis categorization system
|
14
|
+
- `VexCategory`: Defines what a component is (MOTOR, SENSOR, DISPLAY, etc.)
|
15
|
+
- `BehaviorType`: Defines what a component does (CONTROL, READ, CONFIG, etc.)
|
16
|
+
- `SubCategory`: Provides granular classification within categories
|
17
|
+
- `FunctionCategorizer`: Intelligent categorization based on name and description
|
18
|
+
|
19
|
+
* `api.py`: Clean API layer for registry access
|
20
|
+
- Abstracts internal implementation details
|
21
|
+
- Provides intuitive query methods
|
22
|
+
- Maintains backward compatibility
|
23
|
+
|
24
|
+
* `registry.py`: Core registry implementation
|
25
|
+
- Thread-safe singleton pattern
|
26
|
+
- Efficient lookup structures
|
27
|
+
- Category/behavior indexing
|
28
|
+
|
29
|
+
* `signature.py`: Function signature system
|
30
|
+
- Parameter definitions and validation
|
31
|
+
- Return type tracking
|
32
|
+
- Language mapping (Python/C++)
|
33
|
+
|
34
|
+
### Function Organization
|
35
|
+
|
36
|
+
Functions are registered using a multi-dimensional classification:
|
37
|
+
|
38
|
+
```
|
39
|
+
Component → Category (what it is) → Behavior (what it does) → Subcategory (specific role)
|
40
|
+
Example: motor.spin → MOTOR → CONTROL → MOTOR_SPIN
|
41
|
+
```
|
42
|
+
|
43
|
+
## Usage
|
44
|
+
|
45
|
+
### Basic Registry Access
|
46
|
+
|
47
|
+
```python
|
48
|
+
from vex_ast.registry.api import registry_api
|
49
|
+
|
50
|
+
# Get functions by category
|
51
|
+
motor_functions = registry_api.get_functions_by_category(VexCategory.MOTOR)
|
52
|
+
|
53
|
+
# Get functions by behavior
|
54
|
+
control_functions = registry_api.get_functions_by_behavior(BehaviorType.CONTROL)
|
55
|
+
|
56
|
+
# Combined queries
|
57
|
+
motor_control = registry_api.get_functions_by_category_and_behavior(
|
58
|
+
VexCategory.MOTOR,
|
59
|
+
BehaviorType.CONTROL
|
60
|
+
)
|
61
|
+
|
62
|
+
# Validate function calls
|
63
|
+
valid, error = registry_api.validate_call("motor.spin", args, kwargs)
|
64
|
+
```
|
65
|
+
|
66
|
+
### Function Registration
|
67
|
+
|
68
|
+
```python
|
69
|
+
from vex_ast.registry.signature import VexFunctionSignature, VexFunctionParameter
|
70
|
+
from vex_ast.registry.categories import VexCategory, BehaviorType
|
71
|
+
|
72
|
+
# Define function signature
|
73
|
+
signature = VexFunctionSignature(
|
74
|
+
name="spin",
|
75
|
+
return_type=VOID,
|
76
|
+
parameters=[
|
77
|
+
VexFunctionParameter("direction", DIRECTION_TYPE),
|
78
|
+
VexFunctionParameter("velocity", FLOAT, 50.0),
|
79
|
+
VexFunctionParameter("units", VELOCITY_UNITS, "RPM")
|
80
|
+
],
|
81
|
+
description="Spin the motor in the specified direction",
|
82
|
+
category=VexCategory.MOTOR,
|
83
|
+
behavior=BehaviorType.CONTROL,
|
84
|
+
python_name="spin",
|
85
|
+
cpp_name="spin",
|
86
|
+
object_type=MOTOR,
|
87
|
+
method_name="spin"
|
88
|
+
)
|
89
|
+
|
90
|
+
# Register the function
|
91
|
+
registry.register_function(signature)
|
92
|
+
```
|
93
|
+
|
94
|
+
## Backward Compatibility
|
95
|
+
|
96
|
+
The registry maintains full backward compatibility with legacy systems:
|
97
|
+
- `SimulationCategory` enum is preserved and mapped to new categories
|
98
|
+
- Old API methods continue to work
|
99
|
+
- Automatic conversion between old and new category systems
|
100
|
+
|
101
|
+
## Extension Points
|
102
|
+
|
103
|
+
Extend the registry by:
|
104
|
+
1. Adding new `VexCategory` values
|
105
|
+
2. Defining new `BehaviorType` entries
|
106
|
+
3. Creating custom `SubCategory` classifications
|
107
|
+
4. Implementing specialized validation logic
|
vex_ast/registry/__init__.py
CHANGED
@@ -1,51 +1,51 @@
|
|
1
|
-
"""Registry package for VEX AST functions and types."""
|
2
|
-
|
3
|
-
from .registry import registry, VexFunctionRegistry
|
4
|
-
from .signature import (
|
5
|
-
VexFunctionSignature,
|
6
|
-
VexFunctionParameter,
|
7
|
-
ParameterMode,
|
8
|
-
SimulationCategory
|
9
|
-
)
|
10
|
-
from .categories import (
|
11
|
-
FunctionCategory,
|
12
|
-
SubCategory,
|
13
|
-
categorizer
|
14
|
-
)
|
15
|
-
from .language_map import language_mapper
|
16
|
-
from .validation import validator
|
17
|
-
from .simulation_behavior import SimulationBehavior
|
18
|
-
from .api import registry_api, RegistryAPI
|
19
|
-
|
20
|
-
# Initialize registry with default values
|
21
|
-
def initialize():
|
22
|
-
"""Initialize the registry with all VEX functions"""
|
23
|
-
from .functions.initialize import initialize_registry
|
24
|
-
initialize_registry()
|
25
|
-
|
26
|
-
__all__ = [
|
27
|
-
# Legacy direct access (deprecated)
|
28
|
-
'registry',
|
29
|
-
'VexFunctionRegistry',
|
30
|
-
|
31
|
-
# Preferred API access
|
32
|
-
'registry_api',
|
33
|
-
'RegistryAPI',
|
34
|
-
|
35
|
-
# Common types and enums
|
36
|
-
'VexFunctionSignature',
|
37
|
-
'VexFunctionParameter',
|
38
|
-
'ParameterMode',
|
39
|
-
'SimulationCategory',
|
40
|
-
'SimulationBehavior',
|
41
|
-
'FunctionCategory',
|
42
|
-
'SubCategory',
|
43
|
-
|
44
|
-
# Utility objects
|
45
|
-
'categorizer',
|
46
|
-
'language_mapper',
|
47
|
-
'validator',
|
48
|
-
|
49
|
-
# Functions
|
50
|
-
'initialize'
|
51
|
-
]
|
1
|
+
"""Registry package for VEX AST functions and types."""
|
2
|
+
|
3
|
+
from .registry import registry, VexFunctionRegistry
|
4
|
+
from .signature import (
|
5
|
+
VexFunctionSignature,
|
6
|
+
VexFunctionParameter,
|
7
|
+
ParameterMode,
|
8
|
+
SimulationCategory
|
9
|
+
)
|
10
|
+
from .categories import (
|
11
|
+
FunctionCategory,
|
12
|
+
SubCategory,
|
13
|
+
categorizer
|
14
|
+
)
|
15
|
+
from .language_map import language_mapper
|
16
|
+
from .validation import validator
|
17
|
+
from .simulation_behavior import SimulationBehavior
|
18
|
+
from .api import registry_api, RegistryAPI
|
19
|
+
|
20
|
+
# Initialize registry with default values
|
21
|
+
def initialize():
|
22
|
+
"""Initialize the registry with all VEX functions"""
|
23
|
+
from .functions.initialize import initialize_registry
|
24
|
+
initialize_registry()
|
25
|
+
|
26
|
+
__all__ = [
|
27
|
+
# Legacy direct access (deprecated)
|
28
|
+
'registry',
|
29
|
+
'VexFunctionRegistry',
|
30
|
+
|
31
|
+
# Preferred API access
|
32
|
+
'registry_api',
|
33
|
+
'RegistryAPI',
|
34
|
+
|
35
|
+
# Common types and enums
|
36
|
+
'VexFunctionSignature',
|
37
|
+
'VexFunctionParameter',
|
38
|
+
'ParameterMode',
|
39
|
+
'SimulationCategory',
|
40
|
+
'SimulationBehavior',
|
41
|
+
'FunctionCategory',
|
42
|
+
'SubCategory',
|
43
|
+
|
44
|
+
# Utility objects
|
45
|
+
'categorizer',
|
46
|
+
'language_mapper',
|
47
|
+
'validator',
|
48
|
+
|
49
|
+
# Functions
|
50
|
+
'initialize'
|
51
|
+
]
|
vex_ast/registry/api.py
CHANGED
@@ -1,155 +1,190 @@
|
|
1
|
-
"""API layer for the VEX function registry.
|
2
|
-
|
3
|
-
This module provides a clean API for accessing the VEX function registry,
|
4
|
-
hiding implementation details and providing a more stable interface.
|
5
|
-
"""
|
6
|
-
|
7
|
-
from typing import Dict, List, Optional, Union, Tuple, Any, Set
|
8
|
-
|
9
|
-
from .registry import registry, VexFunctionRegistry
|
10
|
-
from .signature import VexFunctionSignature, SimulationCategory
|
11
|
-
from .categories import
|
12
|
-
from ..types.base import VexType
|
13
|
-
|
14
|
-
class RegistryAPI:
|
15
|
-
"""API layer for the VEX function registry."""
|
16
|
-
|
17
|
-
def __init__(self, registry_instance: VexFunctionRegistry = None):
|
18
|
-
"""Initialize with a registry instance or use the singleton."""
|
19
|
-
self._registry = registry_instance or registry
|
20
|
-
|
21
|
-
def get_function(self, name: str, language: str = "python") -> Optional[VexFunctionSignature]:
|
22
|
-
"""Get a function signature by name.
|
23
|
-
|
24
|
-
Args:
|
25
|
-
name: The function name
|
26
|
-
language: The language to use for name resolution ("python" or "cpp")
|
27
|
-
|
28
|
-
Returns:
|
29
|
-
The function signature if found, None otherwise
|
30
|
-
"""
|
31
|
-
return self._registry.get_function(name, language)
|
32
|
-
|
33
|
-
def get_method(self, object_type: Union[VexType, str],
|
34
|
-
method_name: str) -> Optional[VexFunctionSignature]:
|
35
|
-
"""Get a method signature for an object type and method name.
|
36
|
-
|
37
|
-
Args:
|
38
|
-
object_type: The object type or type name
|
39
|
-
method_name: The method name
|
40
|
-
|
41
|
-
Returns:
|
42
|
-
The method signature if found, None otherwise
|
43
|
-
"""
|
44
|
-
return self._registry.get_method(object_type, method_name)
|
45
|
-
|
46
|
-
def get_functions_by_category(self, category:
|
47
|
-
"""Get all functions in a category.
|
48
|
-
|
49
|
-
Args:
|
50
|
-
category: The function category
|
51
|
-
|
52
|
-
Returns:
|
53
|
-
List of function signatures in the category
|
54
|
-
"""
|
55
|
-
return self._registry.get_functions_by_category(category)
|
56
|
-
|
57
|
-
def
|
58
|
-
"""Get all functions
|
59
|
-
|
60
|
-
Args:
|
61
|
-
|
62
|
-
|
63
|
-
Returns:
|
64
|
-
List of function signatures
|
65
|
-
"""
|
66
|
-
return self._registry.
|
67
|
-
|
68
|
-
def
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
1
|
+
"""API layer for the VEX function registry.
|
2
|
+
|
3
|
+
This module provides a clean API for accessing the VEX function registry,
|
4
|
+
hiding implementation details and providing a more stable interface.
|
5
|
+
"""
|
6
|
+
|
7
|
+
from typing import Dict, List, Optional, Union, Tuple, Any, Set
|
8
|
+
|
9
|
+
from .registry import registry, VexFunctionRegistry
|
10
|
+
from .signature import VexFunctionSignature, SimulationCategory
|
11
|
+
from .categories import VexCategory, BehaviorType, SubCategory
|
12
|
+
from ..types.base import VexType
|
13
|
+
|
14
|
+
class RegistryAPI:
|
15
|
+
"""API layer for the VEX function registry."""
|
16
|
+
|
17
|
+
def __init__(self, registry_instance: VexFunctionRegistry = None):
|
18
|
+
"""Initialize with a registry instance or use the singleton."""
|
19
|
+
self._registry = registry_instance or registry
|
20
|
+
|
21
|
+
def get_function(self, name: str, language: str = "python") -> Optional[VexFunctionSignature]:
|
22
|
+
"""Get a function signature by name.
|
23
|
+
|
24
|
+
Args:
|
25
|
+
name: The function name
|
26
|
+
language: The language to use for name resolution ("python" or "cpp")
|
27
|
+
|
28
|
+
Returns:
|
29
|
+
The function signature if found, None otherwise
|
30
|
+
"""
|
31
|
+
return self._registry.get_function(name, language)
|
32
|
+
|
33
|
+
def get_method(self, object_type: Union[VexType, str],
|
34
|
+
method_name: str) -> Optional[VexFunctionSignature]:
|
35
|
+
"""Get a method signature for an object type and method name.
|
36
|
+
|
37
|
+
Args:
|
38
|
+
object_type: The object type or type name
|
39
|
+
method_name: The method name
|
40
|
+
|
41
|
+
Returns:
|
42
|
+
The method signature if found, None otherwise
|
43
|
+
"""
|
44
|
+
return self._registry.get_method(object_type, method_name)
|
45
|
+
|
46
|
+
def get_functions_by_category(self, category: VexCategory) -> List[VexFunctionSignature]:
|
47
|
+
"""Get all functions in a category.
|
48
|
+
|
49
|
+
Args:
|
50
|
+
category: The function category
|
51
|
+
|
52
|
+
Returns:
|
53
|
+
List of function signatures in the category
|
54
|
+
"""
|
55
|
+
return self._registry.get_functions_by_category(category)
|
56
|
+
|
57
|
+
def get_functions_by_behavior(self, behavior: BehaviorType) -> List[VexFunctionSignature]:
|
58
|
+
"""Get all functions with a specific behavior type.
|
59
|
+
|
60
|
+
Args:
|
61
|
+
behavior: The behavior type
|
62
|
+
|
63
|
+
Returns:
|
64
|
+
List of function signatures with the behavior type
|
65
|
+
"""
|
66
|
+
return self._registry.get_functions_by_behavior(behavior)
|
67
|
+
|
68
|
+
def get_functions_by_subcategory(self, subcategory: SubCategory) -> List[VexFunctionSignature]:
|
69
|
+
"""Get all functions in a subcategory.
|
70
|
+
|
71
|
+
Args:
|
72
|
+
subcategory: The function subcategory
|
73
|
+
|
74
|
+
Returns:
|
75
|
+
List of function signatures in the subcategory
|
76
|
+
"""
|
77
|
+
return self._registry.get_functions_by_subcategory(subcategory)
|
78
|
+
|
79
|
+
def get_functions_by_simulation(self,
|
80
|
+
sim_category: SimulationCategory) -> List[VexFunctionSignature]:
|
81
|
+
"""Get all functions with a specific simulation category.
|
82
|
+
|
83
|
+
Args:
|
84
|
+
sim_category: The simulation category
|
85
|
+
|
86
|
+
Returns:
|
87
|
+
List of function signatures with the simulation category
|
88
|
+
"""
|
89
|
+
return self._registry.get_functions_by_simulation(sim_category)
|
90
|
+
|
91
|
+
def validate_call(self, function_name: str,
|
92
|
+
args: List[Any],
|
93
|
+
kwargs: Dict[str, Any],
|
94
|
+
language: str = "python") -> Tuple[bool, Optional[str]]:
|
95
|
+
"""Validate a function call.
|
96
|
+
|
97
|
+
Args:
|
98
|
+
function_name: The function name
|
99
|
+
args: The positional arguments
|
100
|
+
kwargs: The keyword arguments
|
101
|
+
language: The language to use for name resolution
|
102
|
+
|
103
|
+
Returns:
|
104
|
+
A tuple of (valid, error_message)
|
105
|
+
"""
|
106
|
+
return self._registry.validate_call(function_name, args, kwargs, language)
|
107
|
+
|
108
|
+
def validate_method_call(self, object_type: Union[VexType, str],
|
109
|
+
method_name: str,
|
110
|
+
args: List[Any],
|
111
|
+
kwargs: Dict[str, Any]) -> Tuple[bool, Optional[str]]:
|
112
|
+
"""Validate a method call on an object.
|
113
|
+
|
114
|
+
Args:
|
115
|
+
object_type: The object type or type name
|
116
|
+
method_name: The method name
|
117
|
+
args: The positional arguments
|
118
|
+
kwargs: The keyword arguments
|
119
|
+
|
120
|
+
Returns:
|
121
|
+
A tuple of (valid, error_message)
|
122
|
+
"""
|
123
|
+
return self._registry.validate_method_call(object_type, method_name, args, kwargs)
|
124
|
+
|
125
|
+
def get_all_functions(self) -> List[VexFunctionSignature]:
|
126
|
+
"""Get all registered functions.
|
127
|
+
|
128
|
+
Returns:
|
129
|
+
List of all function signatures
|
130
|
+
"""
|
131
|
+
return self._registry.get_all_functions()
|
132
|
+
|
133
|
+
def get_function_names(self) -> Set[str]:
|
134
|
+
"""Get all registered function names.
|
135
|
+
|
136
|
+
Returns:
|
137
|
+
Set of function names
|
138
|
+
"""
|
139
|
+
return {func.name for func in self.get_all_functions()}
|
140
|
+
|
141
|
+
def get_categories(self) -> List[VexCategory]:
|
142
|
+
"""Get all available function categories.
|
143
|
+
|
144
|
+
Returns:
|
145
|
+
List of function categories
|
146
|
+
"""
|
147
|
+
return list(VexCategory)
|
148
|
+
|
149
|
+
def get_behaviors(self) -> List[BehaviorType]:
|
150
|
+
"""Get all available behavior types.
|
151
|
+
|
152
|
+
Returns:
|
153
|
+
List of behavior types
|
154
|
+
"""
|
155
|
+
return list(BehaviorType)
|
156
|
+
|
157
|
+
def get_subcategories(self) -> List[SubCategory]:
|
158
|
+
"""Get all available function subcategories.
|
159
|
+
|
160
|
+
Returns:
|
161
|
+
List of function subcategories
|
162
|
+
"""
|
163
|
+
return list(SubCategory)
|
164
|
+
|
165
|
+
def get_simulation_categories(self) -> List[SimulationCategory]:
|
166
|
+
"""Get all available simulation categories.
|
167
|
+
|
168
|
+
Returns:
|
169
|
+
List of simulation categories
|
170
|
+
"""
|
171
|
+
return list(SimulationCategory)
|
172
|
+
|
173
|
+
def get_functions_by_category_and_behavior(self,
|
174
|
+
category: VexCategory,
|
175
|
+
behavior: BehaviorType) -> List[VexFunctionSignature]:
|
176
|
+
"""Get all functions with a specific category and behavior.
|
177
|
+
|
178
|
+
Args:
|
179
|
+
category: The function category
|
180
|
+
behavior: The behavior type
|
181
|
+
|
182
|
+
Returns:
|
183
|
+
List of function signatures with the category and behavior
|
184
|
+
"""
|
185
|
+
category_funcs = self.get_functions_by_category(category)
|
186
|
+
behavior_funcs = self.get_functions_by_behavior(behavior)
|
187
|
+
return list(set(category_funcs) & set(behavior_funcs))
|
188
|
+
|
189
|
+
# Singleton instance
|
190
|
+
registry_api = RegistryAPI()
|