summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-04-29 09:54:55 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-04-29 09:54:55 +0200
commit4b79b253d268652a1ae7239b564aaff9c2871589 (patch)
tree9436545560fe8dccbb515b406204468e2d28e6ac /lib
parent4f43ceed98bc8f929facfd6c17f394de8ca1a588 (diff)
Use relative module paths. PYTHONPATH=lib bin/... is no longer needed
Diffstat (limited to 'lib')
-rwxr-xr-xlib/automata.py4
-rw-r--r--lib/codegen.py4
-rw-r--r--lib/data_parameters.py4
-rw-r--r--lib/dfatool.py10
-rw-r--r--lib/functions.py2
-rw-r--r--lib/harness.py4
-rw-r--r--lib/lex.py2
-rw-r--r--lib/parameters.py5
8 files changed, 18 insertions, 17 deletions
diff --git a/lib/automata.py b/lib/automata.py
index 2f893e6..8a43e8f 100755
--- a/lib/automata.py
+++ b/lib/automata.py
@@ -1,7 +1,7 @@
"""Classes and helper functions for PTA and other automata."""
-from functions import AnalyticFunction, NormalizationFunction
-from utils import is_numeric
+from .functions import AnalyticFunction, NormalizationFunction
+from .utils import is_numeric
import itertools
import numpy as np
import json
diff --git a/lib/codegen.py b/lib/codegen.py
index 6e94bee..e0bf45f 100644
--- a/lib/codegen.py
+++ b/lib/codegen.py
@@ -1,7 +1,7 @@
"""Code generators for multipass dummy drivers for online model evaluation."""
-from automata import PTA, Transition
-from modular_arithmetic import simulate_int_type
+from .automata import PTA, Transition
+from .modular_arithmetic import simulate_int_type
header_template = """
#ifndef DFATOOL_{name}_H
diff --git a/lib/data_parameters.py b/lib/data_parameters.py
index 7cb875d..3b7a148 100644
--- a/lib/data_parameters.py
+++ b/lib/data_parameters.py
@@ -5,8 +5,8 @@ Parameters include the amount of keys, length of strings (both keys and values),
length of lists, ane more.
"""
-from protocol_benchmarks import codegen_for_lib
-import cycles_to_energy, size_to_radio_energy, utils
+from .protocol_benchmarks import codegen_for_lib
+from . import cycles_to_energy, size_to_radio_energy, utils
import numpy as np
import ubjson
diff --git a/lib/dfatool.py b/lib/dfatool.py
index b206250..b41d399 100644
--- a/lib/dfatool.py
+++ b/lib/dfatool.py
@@ -12,11 +12,11 @@ import struct
import tarfile
import hashlib
from multiprocessing import Pool
-from functions import analytic
-from functions import AnalyticFunction
-from parameters import ParamStats
-from utils import vprint, is_numeric, soft_cast_int, param_slice_eq, remove_index_from_tuple
-from utils import by_name_to_by_param, match_parameter_values, running_mean
+from .functions import analytic
+from .functions import AnalyticFunction
+from .parameters import ParamStats
+from .utils import vprint, is_numeric, soft_cast_int, param_slice_eq, remove_index_from_tuple
+from .utils import by_name_to_by_param, match_parameter_values, running_mean
try:
from pubcode import Code128
diff --git a/lib/functions.py b/lib/functions.py
index 87fb2f0..2451ef6 100644
--- a/lib/functions.py
+++ b/lib/functions.py
@@ -8,7 +8,7 @@ from itertools import chain, combinations
import numpy as np
import re
from scipy import optimize
-from utils import is_numeric, vprint
+from .utils import is_numeric, vprint
arg_support_enabled = True
diff --git a/lib/harness.py b/lib/harness.py
index 59b5fa0..54518e3 100644
--- a/lib/harness.py
+++ b/lib/harness.py
@@ -3,9 +3,9 @@ Harnesses for various types of benchmark logs.
tbd
"""
-import subprocess
import re
-from pubcode import Code128
+from .pubcode import Code128
+
class TransitionHarness:
"""
diff --git a/lib/lex.py b/lib/lex.py
index 4388162..b18fa2b 100644
--- a/lib/lex.py
+++ b/lib/lex.py
@@ -1,4 +1,4 @@
-from sly import Lexer, Parser
+from .sly import Lexer, Parser
class TimedWordLexer(Lexer):
diff --git a/lib/parameters.py b/lib/parameters.py
index 00ae4aa..41e312a 100644
--- a/lib/parameters.py
+++ b/lib/parameters.py
@@ -3,8 +3,9 @@ import numpy as np
from collections import OrderedDict
from copy import deepcopy
from multiprocessing import Pool
-from utils import remove_index_from_tuple, is_numeric, is_power_of_two
-from utils import filter_aggregate_by_param, by_name_to_by_param
+from .utils import remove_index_from_tuple, is_numeric
+from .utils import filter_aggregate_by_param, by_name_to_by_param
+
def distinct_param_values(by_name, state_or_tran):
"""