Skip to content

Commit

Permalink
Minor fixes so that numpy is not imported before installation
Browse files Browse the repository at this point in the history
  • Loading branch information
anandtrex committed Mar 7, 2018
1 parent 8de83e7 commit b862362
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ltl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from numbers import Integral, Real
from timeit import default_timer as timer

import numpy as np

__author__ = 'anand'

Expand Down Expand Up @@ -208,6 +207,8 @@ def dict_to_list(input_dict, get_dict_spec=False):
:returns: The list representing the contents of the dict. If get_dict_spec is True, the dict
specification is also returned. Note that the keys are always sorted ascendingly by name
"""
import numpy as np

return_list = []
dict_items = sorted(input_dict.items())
dict_spec = []
Expand Down Expand Up @@ -241,6 +242,8 @@ def list_to_dict(input_list, dict_spec):
of individual elements are preserved, the types of the iterables inside which they reside are not.
:func:`.list_to_dict` creates all iterables as numpy arrays.
"""
import numpy as np

cursor = 0
return_dict = {}
for dict_entry in dict_spec:
Expand Down Expand Up @@ -302,6 +305,8 @@ def convert_dict_to_numpy(input_dict):
:returns: The converted output dictionary
"""
import numpy as np

output_dict = {}
for key, value in input_dict.items():
if isinstance(value, Iterable) and not isinstance(value, str):
Expand Down
2 changes: 1 addition & 1 deletion ltl/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MAJOR_VERSION = "0.4"
FULL_VERSION = "0.4.0"
FULL_VERSION = "0.4.1"

0 comments on commit b862362

Please sign in to comment.