RatingManager

Rating management for segmentation review.

Provides a rating system with CSV export for tracking review decisions on trial segmentations.

Classes

class ReviewRecord

Record of a single review decision.

Methods:

to_dict()

Convert to dictionary for serialization.

from_dict()

Create from dictionary.

class RatingManager

Manage review ratings with persistence.

Tracks ratings for trial segmentations and exports to CSV/JSON for analysis and audit.

Methods:

__init__()

Initialize rating manager.

set_reviewer()

Set the current reviewer name.

start_session()

Start a new review session.

rate_trial()

Record a rating for a trial.

get_rating()

Get existing rating for a trial.

get_all_ratings()

Get all ratings, optionally filtered by run.

export_csv()

Export ratings to CSV file.

export_json()

Export ratings to JSON file.

get_summary()

Get summary of current session ratings.

clear_session()

Clear current session records.

Functions

label()

Human-readable label.

from_string()

Create Rating from string label.

to_dict()

Convert to dictionary for serialization.

from_dict()

Create from dictionary.

set_reviewer()

Set the current reviewer name.

Args:

name: Reviewer name/ID for attribution.

start_session()

Start a new review session.

Args:

run_name: Name of the optimization run being reviewed.

Returns:

Path to session file.

rate_trial()

Record a rating for a trial.

Args:

trial_id: Trial identifier (e.g., “trial_079”). run_name: Name of the optimization run. rating: Quality rating. notes: Optional reviewer notes. metrics: Optional metrics to store with the rating.

Returns:

The created ReviewRecord.

get_rating()

Get existing rating for a trial.

Args:

trial_id: Trial identifier. run_name: Run name.

Returns:

ReviewRecord if found, None otherwise.

get_all_ratings()

Get all ratings, optionally filtered by run.

Args:

run_name: Optional run name to filter by.

Returns:

List of ReviewRecords.

export_csv()

Export ratings to CSV file.

Args:

output_path: Path for CSV file.

Returns:

Path to created CSV.

export_json()

Export ratings to JSON file.

Args:

output_path: Path for JSON file.

Returns:

Path to created JSON.

get_summary()

Get summary of current session ratings.

clear_session()

Clear current session records.