Repository: pylhc/tfs

Issue:
Fix local imports

Discussion:

Patch:
diff --git a/tfs/collection.py b/tfs/collection.py
index 6baee14..62b5c40 100644
--- a/tfs/collection.py
+++ b/tfs/collection.py
@@ -9,7 +9,8 @@ Advanced tfs reading and writing functionality.
 
 """
 import os
-from handler import read_tfs, write_tfs, TfsDataFrame
+
+from tfs.handler import read_tfs, write_tfs, TfsDataFrame
 
 
 class _MetaTfsCollection(type):
diff --git a/tfs/fixed_dataframe.py b/tfs/fixed_dataframe.py
index 0a17f51..4b8e9d8 100644
--- a/tfs/fixed_dataframe.py
+++ b/tfs/fixed_dataframe.py
@@ -67,8 +67,8 @@ import os
 from collections import defaultdict, OrderedDict, namedtuple
 from contextlib import suppress
 
-from tools import DotDict
-from handler import TfsDataFrame, read_tfs, write_tfs
+from tfs.handler import TfsDataFrame, read_tfs, write_tfs
+from tfs.tools import DotDict
 
 DEFAULTS = defaultdict(float, {int: 0, str: ''})
 
diff --git a/tfs/tools.py b/tfs/tools.py
index fcd9262..4a45337 100644
--- a/tfs/tools.py
+++ b/tfs/tools.py
@@ -9,9 +9,12 @@ Additional functions to modify tfs files.
 :module: tools
 
 """
-from handler import TfsFormatError, read_tfs, write_tfs
 import logging
+
 import numpy as np
+
+from tfs.handler import TfsFormatError, read_tfs, write_tfs
+
 LOG = logging.getLogger(__name__)
 
 


Test patch:
diff --git a/tests/context.py b/tests/context.py
index 7553cd5..4dae14c 100644
--- a/tests/context.py
+++ b/tests/context.py
@@ -3,9 +3,6 @@ from os.path import abspath, join, dirname, pardir
 root_path = abspath(join(dirname(__file__), pardir))
 if root_path not in sys.path:
     sys.path.insert(0, root_path)
-tfs_path = join(root_path, "tfs")
-if tfs_path not in sys.path:
-    sys.path.insert(0, tfs_path)
 test_path = join(root_path, "tests")
 if test_path not in sys.path:
     sys.path.insert(0, test_path)
diff --git a/tests/test_collection.py b/tests/test_collection.py
index e8f3194..a770035 100644
--- a/tests/test_collection.py
+++ b/tests/test_collection.py
@@ -4,9 +4,9 @@ import tempfile
 import pytest
 
 from . import context
-from collection import TfsCollection, Tfs
 from helper import compare_dataframes
 from tfs import read_tfs
+from tfs.collection import TfsCollection, Tfs
 
 CURRENT_DIR = os.path.dirname(__file__)
 
diff --git a/tests/test_fixed_dataframe.py b/tests/test_fixed_dataframe.py
index 94d5c09..1f0fbda 100644
--- a/tests/test_fixed_dataframe.py
+++ b/tests/test_fixed_dataframe.py
@@ -5,9 +5,9 @@ import numpy as np
 import pytest
 
 from . import context
-from fixed_dataframe import FixedColumn, FixedColumnCollection, FixedTfs
-from handler import read_tfs, write_tfs, TfsDataFrame
 from helper import compare_dataframes
+from tfs.fixed_dataframe import FixedColumn, FixedColumnCollection, FixedTfs
+from tfs.handler import read_tfs, write_tfs, TfsDataFrame
 
 
 class MyTfs(FixedTfs):
diff --git a/tests/test_tools.py b/tests/test_tools.py
index 20efa9f..0b922f8 100644
--- a/tests/test_tools.py
+++ b/tests/test_tools.py
@@ -5,8 +5,8 @@ from shutil import copyfile
 import pytest
 
 from . import context
-from handler import read_tfs, TfsFormatError
-from tools import remove_header_comments_from_files, remove_nan_from_files, significant_digits
+from tfs.handler import read_tfs, TfsFormatError
+from tfs.tools import remove_header_comments_from_files, remove_nan_from_files, significant_digits
 
 CURRENT_DIR = os.path.dirname(__file__)