Skip to content

[IMP] Standardize Stage Naming (CamelCase classes, snake_case identifiers) #986

@VibhuJawa

Description

@VibhuJawa

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions