diff options
-rw-r--r-- | szilagyi/_dataset/__init__.py | 12 | ||||
-rw-r--r-- | szilagyi/nomogram.py | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/szilagyi/_dataset/__init__.py b/szilagyi/_dataset/__init__.py index cfa1aee..c91abc3 100644 --- a/szilagyi/_dataset/__init__.py +++ b/szilagyi/_dataset/__init__.py @@ -2,12 +2,20 @@ import csv import os import re -from ..nomogram import Vector - ROOT = os.path.dirname(os.path.abspath(__file__)) +class Vector(complex): + def __getitem__(self, index): + if index == 0: + return self.real + elif index == 1: + return self.imag + else: + raise IndexError + + def load(): def _read(iterable): for x, y in iterable: diff --git a/szilagyi/nomogram.py b/szilagyi/nomogram.py index 91d75c2..299d930 100644 --- a/szilagyi/nomogram.py +++ b/szilagyi/nomogram.py @@ -1,15 +1,7 @@ import math from collections import deque - -class Vector(complex): - def __getitem__(self, index): - if index == 0: - return self.real - elif index == 1: - return self.imag - else: - raise IndexError +from ._dataset import Vector def look_downwards(data, x, start): |