-
Notifications
You must be signed in to change notification settings - Fork 239
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Standardize Stage Naming (CamelCase classes, snake_case identifiers)
Problem
self._name (stage identifier) is inconsistently CamelCase vs snake_case across stages.
Expected
Class names: CamelCase (PEP 8).
Stage identifiers: snake_case for .name/self._name.
Fix
Enforce on construction:
import re
def _validate_stage_name(n: str):
if not re.fullmatch(r"[a-z][a-z0-9_]*", n):
raise ValueError(f"Stage name must be snake_case, got '{n}'")Call in each stage init; rename legacy identifiers.
(Optional) Temporary alias map with deprecation warning.
Tests
Pytest asserting:
- Class names start uppercase.
- Instance .name/._name matches snake_case.
import re, inspect
SNAKE = re.compile(r"[a-z][a-z0-9_]*")
def test_stage_naming(stage_instance):
assert SNAKE.fullmatch(stage_instance.name)Acceptance
- All classes CamelCase; all identifiers snake_case.
- Validator + tests merged
- docs/examples updated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working