Skip to content

study

Study configuration and parsing module.

This module handles loading study configurations from JSON files and expanding parameter sweeps into encoder specifications.


Configuration for a single encoder sweep.

__init__(
format: str,
quality: list[int],
chroma_subsampling: list[str] | None = None,
speed: list[int] | None = None,
effort: list[int] | None = None,
method: list[int] | None = None,
resolution: list[int] | None = None,
crop: list[int] | None = None,
extra_args: dict[str, str | int | bool] | None = None
) → None

Configuration for a complete encoding study.

__init__(
id: str,
name: str,
dataset_id: str,
max_images: int | None,
encoders: list[EncoderConfig],
description: str | None = None,
time_budget: float | None = None,
comparison_tile_parameter: str | None = None,
comparison_targets: list[dict[str, Any]] | None = None,
analysis_x_axis: str | None = None,
analysis_group_by: str | None = None,
comparison_exclude_images: list[str] | None = None,
analysis_fragment_size: int | None = None,
crop_too_small_strategy: str = 'skip_image'
) → None

from_dict(data: dict[str, Any]) → StudyConfig

Create StudyConfig from a dictionary.

Args:

  • data: Dictionary matching the study JSON schema

Returns: StudyConfig instance

Raises:

  • ValueError: If required fields are missing

from_file(config_path: Path) → StudyConfig

Load a study configuration from a JSON file.

Args:

  • config_path: Path to the study JSON file

Returns: StudyConfig instance

Raises:

  • FileNotFoundError: If config file does not exist
  • ValueError: If config file has invalid content