cursus.validation.builders.reporting

Streamlined Reporting and Scoring Package for Builder Testing.

This package contains only the essential streamlined modules for generating reports and scoring for builder test results. Optimized to leverage the alignment system infrastructure while eliminating over-engineering.

Essential Components: - StreamlinedBuilderTestReporter: Unified reporting system - StreamlinedStepBuilderScorer: Component-based scoring system

Architectural Changes: - ✅ Streamlined reporting system (50% code reduction) - ✅ Component-based scoring (eliminates manual test categorization) - ✅ Alignment system integration (leverages proven infrastructure) - ✅ Unified report formats (compatible with alignment system) - ✅ Eliminated over-engineered components (results_storage, report_generator, etc.) - ✅ Backward compatibility maintained

class StreamlinedBuilderTestReporter(output_dir=None)[source]

Bases: object

Streamlined reporter that leverages alignment system infrastructure.

Eliminates redundancy by using proven alignment system patterns while preserving unique builder testing capabilities.

test_and_report_builder(builder_class, step_name=None)[source]

Test a step builder using the unified validation approach.

Leverages the refactored UniversalStepBuilderTest that integrates with the alignment system to eliminate redundancy.

test_and_save_builder_report(builder_class, step_name=None)[source]

Test a builder and save the streamlined report to file.

test_step_type_builders(sagemaker_step_type)[source]

Test all builders of a specific SageMaker step type using streamlined approach.

class StreamlinedBuilderTestReport(builder_name, builder_class, sagemaker_step_type)[source]

Bases: object

Simplified builder test report that leverages alignment system infrastructure.

Eliminates redundancy by using alignment system’s proven reporting patterns while preserving unique builder testing capabilities.

add_alignment_results(results)[source]

Add results from alignment system validation.

add_integration_results(results)[source]

Add results from integration testing (unique to builders).

add_scoring_data(scoring)[source]

Add scoring data from scoring system.

export_to_json()[source]

Export report to JSON format compatible with alignment system reports.

get_critical_issues()[source]

Get critical issues from alignment system.

get_overall_status()[source]

Get overall validation status.

get_quality_rating()[source]

Get quality rating from scoring system.

get_quality_score()[source]

Get quality score from scoring system.

is_passing()[source]

Check if the overall validation is passing.

print_summary()[source]

Print a formatted summary to console.

save_to_file(output_path)[source]

Save report to JSON file.

class StreamlinedStepBuilderScorer(validation_results)[source]

Bases: object

Streamlined scorer that leverages alignment system infrastructure.

Eliminates redundancy by using alignment system’s proven test categorization and priority system while preserving essential quality metrics.

calculate_component_score(component_name)[source]

Calculate score for a validation component.

Parameters:

component_name (str) – Name of the component (alignment_validation, integration_testing, etc.)

Returns:

Tuple containing (score, details)

Return type:

Tuple[float, Dict[str, Any]]

calculate_overall_score()[source]

Calculate overall score using simplified weighted approach.

Returns:

Overall score (0-100)

Return type:

float

generate_report()[source]

Generate a streamlined score report.

Returns:

Dictionary containing the score report

Return type:

Dict[str, Any]

get_rating(score)[source]

Get rating based on score.

Parameters:

score (float) – Score to rate (0-100)

Returns:

Rating string

Return type:

str

print_report()[source]

Print a formatted score report to the console.

save_report(step_name, output_dir='test_reports')[source]

Save the score report to a JSON file.

Parameters:
  • step_name (str) – Name of the step

  • output_dir (str) – Directory to save the report in

Returns:

Path to the saved report

Return type:

str

score_builder_validation_results(validation_results, step_name='Unknown', save_report=True, output_dir='test_reports')[source]

Score validation results from the unified validation approach.

Parameters:
  • validation_results (Dict[str, Any]) – Results from UniversalStepBuilderTest.run_validation_for_step()

  • step_name (str) – Name of the step

  • save_report (bool) – Whether to save the report to a file

  • output_dir (str) – Directory to save the report in

Returns:

Score report dictionary

Return type:

Dict[str, Any]

BuilderTestReporter

alias of StreamlinedBuilderTestReporter

BuilderTestReport

alias of StreamlinedBuilderTestReport

StepBuilderScorer

alias of StreamlinedStepBuilderScorer

score_builder_results(results, builder_name='Unknown', save_report=True, output_dir='test_reports', generate_chart=False)[source]

Legacy compatibility function for scoring builder results.

This function provides backward compatibility but internally uses the streamlined scoring approach.

Modules

builder_reporter

Streamlined Step Builder Test Reporting System.

scoring

Streamlined Scoring System for Universal Step Builder Tests.