Settings
EyeLink tracker settings with runtime validation.
This module defines all configuration settings for EyeLink tracker operation. Settings use Pydantic for runtime validation and rich IDE support via comprehensive docstrings.
- class pyelink.settings.Settings(**data)[source]
Bases:
BaseModelEyeLink tracker configuration with runtime validation.
All settings have comprehensive docstrings visible in IDE autocomplete. Values are validated at creation and on assignment.
Example
settings = Settings() settings.n_cal_targets = 13 settings.save_to_file(“my_config.json”)
- Parameters:
filename (str)
filepath (str)
enable_long_filenames (bool)
max_filename_length (int)
sample_rate (Literal[250, 500, 1000, 2000])
n_cal_targets (Literal[3, 5, 9, 13])
enable_automatic_calibration (bool)
log_calibration_target_messages (bool)
pacing_interval (int)
calibration_corner_scaling (float)
validation_corner_scaling (float)
target_type (Literal['ABC', 'AB', 'A', 'B', 'C', 'CIRCLE', 'IMAGE'])
target_image_path (str | None)
calibration_instruction_text (str)
calibration_text_font_size (int)
calibration_text_font_name (str)
calibration_instruction_page_callback (Callable[[object], None] | None)
fixation_center_diameter (float)
fixation_outer_diameter (float)
fixation_cross_width (float)
circle_outer_radius (int)
circle_inner_radius (int)
screen_width (float)
screen_height (float)
camera_to_screen_distance (float)
screen_distance (float | None)
camera_lens_focal_length (int | None)
backend (Literal['pygame', 'psychopy', 'pyglet'])
fullscreen (bool)
display_index (int)
pupil_tracking_mode (Literal['CENTROID', 'ELLIPSE'])
pupil_size_mode (Literal['AREA', 'DIAMETER'])
set_heuristic_filter (bool)
enable_dual_corneal_tracking (bool)
file_event_filter (str)
link_event_filter (str)
link_sample_data (str)
file_sample_data (str)
record_samples_to_file (bool)
record_events_to_file (bool)
record_sample_over_link (bool)
record_event_over_link (bool)
enable_search_limits (bool)
track_search_limits (bool)
autothreshold_click (bool)
autothreshold_repeat (bool)
enable_camera_position_detect (bool)
illumination_power (Literal[1, 2, 3])
host_ip (str)
el_configuration (Literal['MTABLER', 'BTABLER', 'RTABLER', 'RBTABLER', 'AMTABLER', 'ARTABLER', 'BTOWER'])
eye_tracked (Literal['BOTH', 'LEFT', 'RIGHT'])
- el_configuration: Literal['MTABLER', 'BTABLER', 'RTABLER', 'RBTABLER', 'AMTABLER', 'ARTABLER', 'BTOWER']
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'use_enum_values': True, 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod validate_area_proportions(v)[source]
Validate area proportions are in valid range (0, 1].
- classmethod validate_screen_distance(v, info)[source]
Ensure at least one screen distance measurement is provided.
- validate_file_settings()[source]
Validate file-related settings after all fields are set.
- Return type:
- save_to_file(path)[source]
Save settings to JSON file.
Example
settings.save_to_file(“my_experiment_config.json”)
- classmethod load_from_file(path)[source]
Load settings from JSON file.
- Parameters:
path (
str) – File path to load from- Return type:
- Returns:
Settings instance with validated values
Example
settings = Settings.load_from_file(“my_experiment_config.json”)