plexus.cli.shared.shared module

Shared functions between BatchCommands and PredictionCommands.

plexus.cli.shared.shared.get_score_guidelines_path(scorecard_name: str, score_name: str) Path

Compute the guidelines markdown file path for a score based on scorecard and score names.

This function follows the convention: ./scorecards/[scorecard_name]/guidelines/[score_name].md

where both scorecard_name and score_name are sanitized for use in file paths.

Args:

scorecard_name: The name of the scorecard score_name: The name of the score

Returns:

A Path object pointing to the guidelines file location

Example:
>>> get_score_guidelines_path("My Scorecard", "Call Quality Score")
Path('scorecards/my_scorecard/guidelines/call_quality_score.md')
plexus.cli.shared.shared.get_score_yaml_path(scorecard_name: str, score_name: str) Path

Compute the YAML file path for a score based on scorecard and score names.

This function follows the convention: ./scorecards/[scorecard_name]/[score_name].yaml

where both scorecard_name and score_name are sanitized for use in file paths.

Args:

scorecard_name: The name of the scorecard score_name: The name of the score

Returns:

A Path object pointing to the YAML file location

Example:
>>> get_score_yaml_path("My Scorecard", "Call Quality Score")
Path('scorecards/my_scorecard/call_quality_score.yaml')
async plexus.cli.shared.shared.get_scoring_jobs_for_batch(client, batch_job_id)

Get scoring jobs associated with a batch job.

plexus.cli.shared.shared.sanitize_path_name(name: str) str

Sanitize a string to be safe for use as a path name while preserving readability. Only replaces characters that are unsafe for paths.

Args:

name: The string to sanitize

Returns:

A sanitized string that is safe to use as a path name

Example:
>>> sanitize_path_name("Patient Interest")
'Patient Interest'
>>> sanitize_path_name("Call/Response*Test")
'Call-Response-Test'
>>> sanitize_path_name("Special: Score (with) [chars]")
'Special- Score (with) -chars-'
plexus.cli.shared.shared.select_sample_csv(csv_path, content_id)

Select a sample from CSV file.

plexus.cli.shared.shared.select_sample_data_driven(scorecard_class, score_name, content_id, score_configuration, fresh)

Select a sample using data-driven approach.