arckit
arckit copied to clipboard
Feature: Added print_grid function, print grid to terminal
@mxbi Thanks for the awesome project!
I Haphazardly added a function to print the grid to the terminal. It is based on the rich library.
Example:
import arckit
import arckit.vis as vis
train_set, eval_set = arckit.load_data() # Load ARC1 train/eval
task = train_set[0]
for ex in task.train:
print("Input: ")
grid = vis.draw_grid(ex[0])
vis.print_grid(grid)
print('Output: ')
grid = vis.draw_grid(ex[1])
vis.print_grid(grid)
print()
Should print to the terminal:
Awesome! I really like the printing style.
I'm wondering whether we can extend this to take in numpy arrays (the standard grid format for Task) rather than essentially inverting the draw_grid call, which might have some weird behaviour if called on the result of draw_task, for example.
I'm closing this in favour of #12 - thank you for the suggestion!