diff options
author | Aki <please@ignore.pl> | 2022-09-03 00:10:41 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-09-03 00:12:17 +0200 |
commit | 07b0fb8ef544dbf007068b5b23dd7ec989ac8017 (patch) | |
tree | 77129f78d8bd6664db8ed2ba7e0ae904abf3b395 /szilagyi/nomogram.py | |
parent | e3c151ad4ca8ae147ea00cddc08d0b40de72e192 (diff) | |
download | szilagyi-07b0fb8ef544dbf007068b5b23dd7ec989ac8017.zip szilagyi-07b0fb8ef544dbf007068b5b23dd7ec989ac8017.tar.gz szilagyi-07b0fb8ef544dbf007068b5b23dd7ec989ac8017.tar.bz2 |
Moved dataset loading function to dataset module
Diffstat (limited to 'szilagyi/nomogram.py')
-rw-r--r-- | szilagyi/nomogram.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/szilagyi/nomogram.py b/szilagyi/nomogram.py index 9d76127..91d75c2 100644 --- a/szilagyi/nomogram.py +++ b/szilagyi/nomogram.py @@ -1,7 +1,4 @@ -import csv import math -import os -import re from collections import deque @@ -15,25 +12,6 @@ class Vector(complex): raise IndexError -def load(directory): - def _read(iterable): - for x, y in iterable: - yield Vector(float(x), float(y)) - - def _load(filename): - with open(filename) as fd: - reader = csv.reader(fd) - return list(_read(reader)) - - def _files(directory): - for file in os.listdir(directory): - match = re.match(r"SWI_(-?\d+)\.csv", file) - if match: - yield int(match.group(1)), os.path.join(directory, file) - - return [(x, _load(y)) for x, y in sorted(_files(directory), key=lambda x: x[0])] - - def look_downwards(data, x, start): for i in range(start, 0, -1): if data[i - 1][0] < x: |