From 5013752d8649b6b2070f1e2f8a3817db28416dbd Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 3 Sep 2022 00:18:04 +0200 Subject: Moved Vector to dataset --- szilagyi/_dataset/__init__.py | 12 ++++++++++-- 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): -- cgit v1.1