Skip to content

Commit

Permalink
Trying to identify weird axis problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbywater committed Oct 4, 2017
1 parent 9f5d3ea commit 1db751e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -10,6 +10,7 @@ python:
- "3.3"
- "3.4"
- "3.5"
- "3.6"

before_install:
- travis_retry wget http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh -O miniconda.sh
Expand Down
4 changes: 2 additions & 2 deletions quantdsl/priceprocess/forwardcurve.py
@@ -1,5 +1,5 @@
import dateutil.parser
from numpy import sort, array, searchsorted
from scipy import sort, array, searchsorted

from quantdsl.priceprocess.base import datetime_from_date

Expand All @@ -11,7 +11,7 @@ def __init__(self, name, data):
self.by_date = dict(
[(datetime_from_date(dateutil.parser.parse(d)), v) for (d, v) in self.data]
)
self.sorted = sort(array(self.by_date.keys()))
self.sorted = sort(array(list(self.by_date.keys())))

def get_price(self, date):
try:
Expand Down
19 changes: 5 additions & 14 deletions quantdsl/syntax.py
Expand Up @@ -6,22 +6,13 @@
from quantdsl.exceptions import DslSyntaxError
from quantdsl.semantics import FunctionDef, DslNamespace

if six.PY3:
from importlib._bootstrap import PathFinder
else:
PathFinder = None
from importlib import import_module


def find_module_path(name):
# Find path.
if PathFinder is not None:
path_finder = PathFinder()
spec = path_finder.find_spec(fullname=name)
path = spec.origin
else:
__import__(name)
module = sys.modules[name]
path = module.__file__.strip('c') # .py not .pyc
module = import_module(name)
path = module.__file__.strip('c') # .py not .pyc
return path


Expand Down Expand Up @@ -236,9 +227,9 @@ def visitCall(self, node):
"""
if node.keywords:
raise DslSyntaxError("Calling with keywords is not currently supported (positional args only).")
if node.starargs:
if hasattr(node, 'starargs') and node.starargs:
raise DslSyntaxError("Calling with starargs is not currently supported (positional args only).")
if node.kwargs:
if hasattr(node, 'kwargs') and node.kwargs:
raise DslSyntaxError("Calling with kwargs is not currently supported (positional args only).")

# Collect the call arg expressions (whose values will be passed into the call when it is made).
Expand Down

0 comments on commit 1db751e

Please sign in to comment.