summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-09-03 00:18:04 +0200
committerAki <please@ignore.pl>2022-09-03 00:18:04 +0200
commit5013752d8649b6b2070f1e2f8a3817db28416dbd (patch)
tree4ce892e879e241077d6d75f782065887f82079bf
parent07b0fb8ef544dbf007068b5b23dd7ec989ac8017 (diff)
downloadszilagyi-5013752d8649b6b2070f1e2f8a3817db28416dbd.zip
szilagyi-5013752d8649b6b2070f1e2f8a3817db28416dbd.tar.gz
szilagyi-5013752d8649b6b2070f1e2f8a3817db28416dbd.tar.bz2
Moved Vector to dataset
-rw-r--r--szilagyi/_dataset/__init__.py12
-rw-r--r--szilagyi/nomogram.py10
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):