mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-11 11:16:15 +08:00
Changed zipline -> catalyst import paths
* Updated cython build scripts * Updated setup.py to to install catalyst package * Updated momentum example to use catalyst package * catalyst executable now supports loading pipelines from multiple bundles
This commit is contained in:
@@ -6,11 +6,11 @@ import click
|
||||
|
||||
py_versions = ('2.7', '3.4', '3.5')
|
||||
npy_versions = ('1.9', '1.10')
|
||||
zipline_path = os.path.join(
|
||||
catalyst_path = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
'..',
|
||||
'conda',
|
||||
'zipline',
|
||||
'catalyst',
|
||||
)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ def mkargs(py_version, npy_version, output=False):
|
||||
'args': [
|
||||
'conda',
|
||||
'build',
|
||||
zipline_path,
|
||||
catalyst_path,
|
||||
'-c', 'quantopian',
|
||||
'--python=%s' % py_version,
|
||||
'--numpy=%s' % npy_version,
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# generate configuration, cert, and password if this is the first run
|
||||
#
|
||||
if [ ! -f /var/tmp/zipline_init ] ; then
|
||||
if [ ! -f /var/tmp/catalyst_init ] ; then
|
||||
jupyter notebook --generate-config
|
||||
if [ ! -f ${SSL_CERT_PEM} ] ; then
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
||||
@@ -11,7 +11,7 @@ if [ ! -f /var/tmp/zipline_init ] ; then
|
||||
-keyout ${SSL_CERT_KEY} -out ${SSL_CERT_PEM}
|
||||
fi
|
||||
echo "c.NotebookApp.password = ${PW_HASH}" >> ${CONFIG_PATH}
|
||||
touch /var/tmp/zipline_init
|
||||
touch /var/tmp/catalyst_init
|
||||
fi
|
||||
|
||||
jupyter notebook -y --no-browser --notebook-dir=${PROJECT_DIR} \
|
||||
|
||||
@@ -2,7 +2,7 @@ import inspect
|
||||
from operator import attrgetter
|
||||
from textwrap import dedent
|
||||
|
||||
from zipline import api, TradingAlgorithm
|
||||
from catalyst import api, TradingAlgorithm
|
||||
|
||||
|
||||
def main():
|
||||
@@ -12,14 +12,14 @@ def main():
|
||||
# explicitly importing.
|
||||
stub.write(dedent("""\
|
||||
import collections
|
||||
from zipline.assets import Asset, Equity, Future
|
||||
from zipline.assets.futures import FutureChain
|
||||
from zipline.finance.asset_restrictions import Restrictions
|
||||
from zipline.finance.cancel_policy import CancelPolicy
|
||||
from zipline.pipeline import Pipeline
|
||||
from zipline.protocol import Order
|
||||
from zipline.utils.events import EventRule
|
||||
from zipline.utils.security_list import SecurityList
|
||||
from catalyst.assets import Asset, Equity, Future
|
||||
from catalyst.assets.futures import FutureChain
|
||||
from catalyst.finance.asset_restrictions import Restrictions
|
||||
from catalyst.finance.cancel_policy import CancelPolicy
|
||||
from catalyst.pipeline import Pipeline
|
||||
from catalyst.protocol import Order
|
||||
from catalyst.utils.events import EventRule
|
||||
from catalyst.utils.security_list import SecurityList
|
||||
|
||||
|
||||
"""))
|
||||
|
||||
@@ -18,7 +18,7 @@ set -e
|
||||
stash_result=$(git stash --keep-index)
|
||||
|
||||
# Run flake8 linting
|
||||
flake8 zipline tests
|
||||
flake8 catalyst tests
|
||||
# Run unit tests
|
||||
nosetests -x
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
find -E zipline tests -regex '.*\.(c|so)' -exec rm {} +
|
||||
find -E catalyst tests -regex '.*\.(c|so)' -exec rm {} +
|
||||
else
|
||||
find zipline tests -regex '.*\.\(c\|so\)' -exec rm {} +
|
||||
find catalyst tests -regex '.*\.\(c\|so\)' -exec rm {} +
|
||||
fi
|
||||
python setup.py build_ext --inplace
|
||||
|
||||
@@ -42,7 +42,7 @@ contextlib2==0.4.0
|
||||
# networkx requires decorator
|
||||
decorator==4.0.0
|
||||
|
||||
# Graph algorithms used by zipline.pipeline
|
||||
# Graph algorithms used by catalyst.pipeline
|
||||
networkx==1.9.1
|
||||
|
||||
# NumericalExpression pipeline terms.
|
||||
|
||||
Reference in New Issue
Block a user