Skip to content

Commit aab0ce4

Browse files
committed
unlink fd everywhere
1 parent f3ee4ce commit aab0ce4

File tree

8 files changed

+82
-22
lines changed

8 files changed

+82
-22
lines changed

.github/workflows/pytest.yml

-6
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,5 @@ jobs:
3131
run: |
3232
git submodule update --init --recursive
3333
uv pip install -e ".[dev, docs, all, example]"
34-
- name: Setup cmake
35-
uses: jwlawson/actions-setup-cmake@v2
36-
with:
37-
cmake-version: '3.10.2'
38-
- name: Build fast-downward
39-
run: ./dacbench/envs/rl-plan/fast-downward/build.py
4034
- name: Run tests with pytest
4135
run: /home/runner/work/DACBench/DACBench/.venv/bin/python -m pytest tests

README.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,14 @@ source .venv/bin/activate
3434
git submodule update --init --recursive
3535
make install
3636
```
37-
This command installs the base version of DACBench including the three small surrogate benchmarks and the option to install the FastDownward benchmark.
37+
This command installs the base version of DACBench including the three small surrogate benchmarks.
3838
For any other benchmark, you may use a singularity container as provided by us (see next section) or install it as an additional dependency. As an example,
3939
to install the SGDBenchmark, run:
4040

4141
```
4242
uv pip install dacbench[sgd]
4343
```
4444

45-
To use FastDownward, you first need to build the solver itself. We recommend using
46-
cmake version 3.10.2. The command is:
47-
```
48-
./dacbench/envs/rl-plan/fast-downward/build.py
49-
```
50-
5145
You can also install all dependencies like so:
5246
```
5347
make install-dev

dacbench/benchmarks/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import importlib
33
import warnings
44

5-
from dacbench.benchmarks.fast_downward_benchmark import FastDownwardBenchmark
5+
# from dacbench.benchmarks.fast_downward_benchmark import FastDownwardBenchmark
66
from dacbench.benchmarks.function_approximation_benchmark import (
77
FunctionApproximationBenchmark,
88
)
@@ -13,7 +13,7 @@
1313
"LubyBenchmark",
1414
"FunctionApproximationBenchmark",
1515
"ToySGDBenchmark",
16-
"FastDownwardBenchmark",
16+
# "FastDownwardBenchmark",
1717
]
1818

1919
modcma_spec = importlib.util.find_spec("modcma")

dacbench/envs/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import importlib
33
import warnings
44

5-
from dacbench.envs.fast_downward import FastDownwardEnv
5+
# from dacbench.envs.fast_downward import FastDownwardEnv
66
from dacbench.envs.function_approximation import (
77
FunctionApproximationEnv,
88
FunctionApproximationInstance,
@@ -17,7 +17,7 @@
1717
"luby_gen",
1818
"FunctionApproximationEnv",
1919
"FunctionApproximationInstance",
20-
"FastDownwardEnv",
20+
# "FastDownwardEnv",
2121
"ToySGDEnv",
2222
"ToySGDInstance",
2323
"TheoryEnv",

docs/index.rst

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Welcome to DACBench's documentation!
2121
source/benchmark_docs/function_approximation
2222
source/benchmark_docs/luby
2323
source/benchmark_docs/toy_sgd
24-
source/benchmark_docs/fastdownward
2524
source/benchmark_docs/theory
2625
source/benchmark_docs/cma
2726
source/benchmark_docs/sgd

docs/source/benchmarks.rst

-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ They are both based on artificial functions and real algorithms:
2020
Learning the Luby sequence.
2121
- :doc:`ToySGD <benchmark_docs/toy_sgd>` (Artificial Benchmark):
2222
Controlling the learning rate in gradient descent.
23-
- Toy version of the :doc:`FastDownward benchmark <benchmark_docs/fastdownward>`:
24-
Heuristic selection for the FastDownward Planner with ground truth.
2523
- :doc:`Theory benchmark <benchmark_docs/theory>` with ground truth:
2624
RLS algorithm on the LeadingOnes problem.
2725

@@ -30,7 +28,6 @@ Beyond these smaller scale problems we know a lot about, DACBench also contains
3028
interpretable algorithms with larger scopes. These are oftentimes noisier, harder to debug
3129
and more costly to run and thus present a real challenge for DAC algorithms:
3230

33-
* :doc:`FastDownward benchmark <benchmark_docs/fastdownward>`: Heuristic selection for the FastDownward Planner on competition tasks.
3431
* :doc:`CMA-ES <benchmark_docs/cma>`: Step-size adpation and algorithm component selection for CMA-ES.
3532
* :doc:`SGD-DL <benchmark_docs/sgd>`: Learning rate adaption for neural networks.
3633

tests/benchmarks/test_fd_benchmark.py

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import json
2+
import os
3+
import unittest
4+
import pytest
5+
6+
from dacbench.benchmarks import FastDownwardBenchmark
7+
from dacbench.envs import FastDownwardEnv
8+
9+
10+
@pytest.mark.skip(reason="FD issues locally and remote make testing hard")
11+
class TestFDBenchmark(unittest.TestCase):
12+
def test_get_env(self):
13+
bench = FastDownwardBenchmark()
14+
env = bench.get_environment()
15+
self.assertTrue(issubclass(type(env), FastDownwardEnv))
16+
17+
bench.config.instance_set_path = "../instance_sets/fast_downward/childsnack"
18+
bench.read_instance_set()
19+
env = bench.get_environment()
20+
self.assertTrue(issubclass(type(env), FastDownwardEnv))
21+
22+
# TODO: This test breaks remote testing, possibly due to too many open ports.
23+
# Should be investigated
24+
# def test_scenarios(self):
25+
# scenarios = [
26+
# "fd_barman.json",
27+
# # "fd_blocksworld.json",
28+
# # "fd_visitall.json",
29+
# # "fd_childsnack.json",
30+
# # "fd_sokoban.json",
31+
# # "fd_rovers.json",
32+
# ]
33+
# for s in scenarios:
34+
# path = os.path.join("dacbench/additional_configs/fast_downward/", s)
35+
# bench = FastDownwardBenchmark(path)
36+
# self.assertTrue(bench.config is not None)
37+
# env = bench.get_environment()
38+
# state, info = env.reset()
39+
# self.assertTrue(state is not None)
40+
# self.assertTrue(info is not None)
41+
# state, _, _, _, _ = env.step(0)
42+
# self.assertTrue(state is not None)
43+
44+
def test_save_conf(self):
45+
bench = FastDownwardBenchmark()
46+
del bench.config["config_space"]
47+
bench.save_config("test_conf.json")
48+
with open("test_conf.json", "r") as fp:
49+
recovered = json.load(fp)
50+
for k in bench.config.keys():
51+
self.assertTrue(k in recovered.keys())
52+
os.remove("test_conf.json")
53+
54+
def test_read_instances(self):
55+
bench = FastDownwardBenchmark()
56+
bench.read_instance_set()
57+
self.assertTrue(len(bench.config.instance_set.keys()) == 30)
58+
self.assertTrue(type(bench.config.instance_set[0]) == str)
59+
self.assertTrue(os.path.isfile(bench.config.instance_set[0]))
60+
path = bench.config.instance_set[0]
61+
bench2 = FastDownwardBenchmark()
62+
env = bench2.get_environment()
63+
self.assertTrue(type(env.instance_set[0]) == str)
64+
self.assertTrue(len(env.instance_set.keys()) == 30)
65+
self.assertTrue(path == env.instance_set[0])
66+
67+
def test_benchmark_env(self):
68+
bench = FastDownwardBenchmark()
69+
env = bench.get_benchmark()
70+
self.assertTrue(issubclass(type(env), FastDownwardEnv))
71+
72+
def test_from_to_json(self):
73+
bench = FastDownwardBenchmark()
74+
restored_bench = FastDownwardBenchmark.from_json(bench.to_json())
75+
self.assertEqual(bench, restored_bench)

tests/envs/test_fast_downward.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22
import unittest
3+
import pytest
34

45
from dacbench import AbstractEnv
56
from dacbench.benchmarks.fast_downward_benchmark import FastDownwardBenchmark
67

7-
8+
@pytest.mark.skip(reason="FD issues locally and remote make testing hard")
89
class TestFDEnv(unittest.TestCase):
910
def make_env(self):
1011
bench = FastDownwardBenchmark()

0 commit comments

Comments
 (0)