Refactor Curriculum Attributes (#335)

* remove min_value from AttributeDefinition
* remove type from AttributeDefinition
* Add CurriculumContext
* add ensure_interval option for RangeAttributes
* docs: Add legend explaining curriculum indicators in dataset gallery
* update GALLERY.md
This commit is contained in:
Andreas Köpf 2025-03-16 15:40:28 +01:00 committed by GitHub
parent 4e7d9296ee
commit d2c895f1d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
101 changed files with 286 additions and 677 deletions

View file

@ -10,7 +10,7 @@ from dataclasses import dataclass
from random import Random
from typing import Optional
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
from ..coaching import BaseCurriculum, RangeAttributeDefinition
from ..factory import ProceduralDataset, register_dataset
QUESTION_TEMPLATE = """There are a total of {num_courses} courses you have to take, labeled from 0 to {last_index}.
@ -152,8 +152,6 @@ class CourseScheduleCurriculum(BaseCurriculum):
levels=[10, 50, 100, 500],
default_level=0, # Start with 5 courses
description="Number of courses in the schedule",
attr_type=AttributeType.APPEND,
min_value=3, # Ensure at least 3 courses
lower_field_name="min_num_courses",
upper_field_name="max_num_courses",
),
@ -162,8 +160,6 @@ class CourseScheduleCurriculum(BaseCurriculum):
levels=[2, 3, 4, 5],
default_level=0, # Start with 2 prerequisites max
description="Number of prerequisites per course",
attr_type=AttributeType.APPEND,
min_value=0,
lower_field_name="min_num_prerequisites",
upper_field_name="max_num_prerequisites",
),
@ -172,8 +168,6 @@ class CourseScheduleCurriculum(BaseCurriculum):
levels=[3, 4, 5, 6],
default_level=0, # Start with 3 cycle length
description="Length of a cycle in the prerequisites",
attr_type=AttributeType.APPEND,
min_value=3,
lower_field_name="min_cycle_length",
upper_field_name="max_cycle_length",
),