Skip to content

Commit c5e0d5f

Browse files
committed
force path when headless
1 parent c99f645 commit c5e0d5f

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

jupyddl/data_analyst.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@ def __get_all_pddl_from_data(self):
2424
tested_files = []
2525
domains_problems = []
2626
i = 0
27-
for root, _, files in os.walk("data/", topdown=False):
28-
for name in files:
29-
if ".gitkeep" in name:
30-
continue
31-
tested_files.append(os.getcwd() + "/" + os.path.join(root, name))
32-
if i % 2 != 0:
33-
domains_problems.append((tested_files[i - 1], tested_files[i]))
34-
i += 1
35-
return domains_problems
27+
if "DISPLAY" in os.environ:
28+
for root, _, files in os.walk("data/", topdown=False):
29+
for name in files:
30+
if ".gitkeep" in name:
31+
continue
32+
tested_files.append(os.getcwd() + "/" + os.path.join(root, name))
33+
if i % 2 != 0:
34+
domains_problems.append((tested_files[i - 1], tested_files[i]))
35+
i += 1
36+
return domains_problems
37+
return [('data/problem.pddl', 'data/domain.pddl')]
3638

3739
def __plot_data(self, times, total_nodes, plot_title):
3840
plt.plot(total_nodes, times, "b:o")

tests/test_data_analyst.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import sys
44
from os import path
5-
65
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
76
from jupyddl.data_analyst import DataAnalyst
87

0 commit comments

Comments
 (0)