mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
use native types List->list, Dict->dict, Set->set, Tuple->tuple
This commit is contained in:
parent
5d02064b5a
commit
3e7ff3b084
95 changed files with 754 additions and 760 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import random
|
||||
from typing import Any, List, Tuple
|
||||
from typing import Any
|
||||
|
||||
from .dsl import *
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ def get_pso_difficulty(example: dict) -> float:
|
|||
return (pix_pct + col_pct + obj_dens) / 3
|
||||
|
||||
|
||||
def unifint(rng: random.Random, diff_lb: float, diff_ub: float, bounds: Tuple[int, int]) -> int:
|
||||
def unifint(rng: random.Random, diff_lb: float, diff_ub: float, bounds: tuple[int, int]) -> int:
|
||||
"""
|
||||
rng
|
||||
diff_lb: lower bound for difficulty, must be in range [0, diff_ub]
|
||||
|
|
@ -83,7 +83,7 @@ def strip_prefix(string: str, prefix: str) -> str:
|
|||
return string[len(prefix) :]
|
||||
|
||||
|
||||
def format_grid(grid: List[List[int]]) -> Grid:
|
||||
def format_grid(grid: list[list[int]]) -> Grid:
|
||||
"""
|
||||
grid type casting
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue