summaryrefslogtreecommitdiff
path: root/szilagyi/_dataset/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'szilagyi/_dataset/__init__.py')
-rw-r--r--szilagyi/_dataset/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/szilagyi/_dataset/__init__.py b/szilagyi/_dataset/__init__.py
index c91abc3..8ff88ae 100644
--- a/szilagyi/_dataset/__init__.py
+++ b/szilagyi/_dataset/__init__.py
@@ -3,9 +3,6 @@ import os
import re
-ROOT = os.path.dirname(os.path.abspath(__file__))
-
-
class Vector(complex):
def __getitem__(self, index):
if index == 0:
@@ -16,7 +13,7 @@ class Vector(complex):
raise IndexError
-def load():
+def _load_from(root):
def _read(iterable):
for x, y in iterable:
yield Vector(float(x), float(y))
@@ -32,4 +29,7 @@ def load():
if match:
yield int(match.group(1)), os.path.join(directory, filename)
- return [(x, _load(y)) for x, y in sorted(_files(ROOT), key=lambda x: x[0])]
+ return [(x, _load(y)) for x, y in sorted(_files(root), key=lambda x: x[0])]
+
+
+INDICES = _load_from(os.path.dirname(os.path.abspath(__file__)))