Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Howuhh committed Mar 28, 2024
1 parent 8c8fb62 commit b21c142
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions examples/walkthrough.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@
"source": [
"import os\n",
"from xminigrid.types import RuleSet\n",
"from xminigrid.benchmarks import Benchmark, load_benchmark, load_bz2_pickle, DATA_PATH, NAME2HFFILENAME\n",
"from xminigrid.benchmarks import Benchmark, load_benchmark, load_benchmark_from_path, load_bz2_pickle, DATA_PATH, NAME2HFFILENAME\n",
"from xminigrid.rendering.text_render import print_ruleset"
]
},
Expand Down Expand Up @@ -966,15 +966,18 @@
"outputs": [],
"source": [
"# example path, can be any your valid path\n",
"bechmark_path = os.path.join(DATA_PATH, NAME2HFFILENAME[\"trivial-1m\"])\n",
"\n",
"rulesets_clear = load_bz2_pickle(bechmark_path)\n",
"loaded_benchmark = Benchmark(\n",
" goals=rulesets_clear[\"goals\"],\n",
" rules=rulesets_clear[\"rules\"],\n",
" init_tiles=rulesets_clear[\"init_tiles\"],\n",
" num_rules=rulesets_clear[\"num_rules\"]\n",
")"
"loaded_benchmark = load_benchmark_from_path(os.path.join(DATA_PATH, NAME2HFFILENAME[\"trivial-1m\"]))\n",
"\n",
"# or a bit more manually\n",
"# bechmark_path = os.path.join(DATA_PATH, NAME2HFFILENAME[\"trivial-1m\"])\n",
"\n",
"# rulesets_clear = load_bz2_pickle(bechmark_path)\n",
"# loaded_benchmark = Benchmark(\n",
"# goals=rulesets_clear[\"goals\"],\n",
"# rules=rulesets_clear[\"rules\"],\n",
"# init_tiles=rulesets_clear[\"init_tiles\"],\n",
"# num_rules=rulesets_clear[\"num_rules\"]\n",
"# )"
]
},
{
Expand Down

0 comments on commit b21c142

Please sign in to comment.