mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
* feat: Add Coach and ScoreBoard classes for performance tracking and difficulty adjustment * feat: Add GroupedScores class to wrap aggregated scores * refactor: Create ScoreStats class with tuple-based score statistics * feat: Add unit test for Coach with CompositeDataset and multiple datasets * fix: Add difficulty metadata to leg counting dataset * feat: Add clear() method to ScoreBoard to reset all stored data * feat: Add __len__ method to ScoreBoard to return number of scores * feat: Add update_dataset_config method to CompositeDataset * cleanup __init__ & imports
39 lines
981 B
Python
39 lines
981 B
Python
"""Package containing data files used by reasoning_gym"""
|
|
|
|
from importlib import resources
|
|
from pathlib import Path
|
|
|
|
|
|
def get_data_file_path(filename: str) -> Path:
|
|
"""Get the path to a data file in the package.
|
|
|
|
Args:
|
|
filename: Name of the file in the data directory
|
|
|
|
Returns:
|
|
Path object pointing to the data file
|
|
|
|
Example:
|
|
>>> path = get_data_file_path("pg19362.txt")
|
|
>>> with open(path) as f:
|
|
... content = f.read()
|
|
"""
|
|
return resources.files("reasoning_gym.data").joinpath(filename)
|
|
|
|
|
|
def read_data_file(filename: str) -> str:
|
|
"""Read the contents of a data file in the package.
|
|
|
|
Args:
|
|
filename: Name of the file in the data directory
|
|
|
|
Returns:
|
|
String contents of the file
|
|
|
|
Example:
|
|
>>> content = read_data_file("pg19362.txt")
|
|
"""
|
|
return resources.files("reasoning_gym.data").joinpath(filename).read_text()
|
|
|
|
|
|
__all__ = ["get_data_file_path", "read_data_file"]
|