From d669419d1824f9d882a3d6f13db0d64344d7743b Mon Sep 17 00:00:00 2001 From: Victor Grau Serrat Date: Fri, 19 Jan 2018 14:55:40 -0700 Subject: [PATCH 1/3] DOC: updating references to catalyst --- docs/Makefile | 10 +++++----- docs/deploy.py | 10 +++++----- docs/make.bat | 4 ++-- docs/source/conf.py | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 666dc804..f906e4af 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -23,7 +23,7 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source help: @echo "Please use \`make ' where is one of" - @echo " build to build the C and Cython extensions for zipline" + @echo " build to build the C and Cython extensions for catalyst" @echo " html to make standalone HTML files" @echo " livehtml to run a persistent process that rebuilds the docs" @echo " dirhtml to make HTML files named index.html in directories" @@ -96,9 +96,9 @@ qthelp: build @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/zipline.qhcp" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/catalyst.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/zipline.qhc" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/catalyst.qhc" applehelp: build $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp @@ -113,8 +113,8 @@ devhelp: build @echo @echo "Build finished." @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/zipline" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/zipline" + @echo "# mkdir -p $$HOME/.local/share/devhelp/catalyst" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/catalyst" @echo "# devhelp" epub: build diff --git a/docs/deploy.py b/docs/deploy.py index 9120e033..4c6b8451 100644 --- a/docs/deploy.py +++ b/docs/deploy.py @@ -8,8 +8,8 @@ from shutil import move, rmtree from subprocess import check_call HERE = dirname(abspath(__file__)) -ZIPLINE_ROOT = dirname(HERE) -TEMP_LOCATION = '/tmp/zipline-doc' +CATALYST_ROOT = dirname(HERE) +TEMP_LOCATION = '/tmp/catalyst-doc' TEMP_LOCATION_GLOB = TEMP_LOCATION + '/*' @@ -46,8 +46,8 @@ def main(): print("Copying built files to temp location.") move('build/html', TEMP_LOCATION) - print("Moving to '%s'" % ZIPLINE_ROOT) - os.chdir(ZIPLINE_ROOT) + print("Moving to '%s'" % CATALYST_ROOT) + os.chdir(CATALYST_ROOT) print("Checking out gh-pages branch.") check_call( @@ -70,7 +70,7 @@ def main(): os.chdir(old_dir) print() - print("Updated documentation branch in directory %s" % ZIPLINE_ROOT) + print("Updated documentation branch in directory %s" % CATALYST_ROOT) print("If you are happy with these changes, commit and push to gh-pages.") if __name__ == '__main__': diff --git a/docs/make.bat b/docs/make.bat index 472630a9..1b28f18b 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -127,9 +127,9 @@ if "%1" == "qthelp" ( echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\zipline.qhcp + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\catalyst.qhcp echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\zipline.ghc + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\catalyst.ghc goto end ) diff --git a/docs/source/conf.py b/docs/source/conf.py index dd0304d0..3dc91ef9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -41,11 +41,11 @@ master_doc = 'index' # General information about the project. project = u'Catalyst' -copyright = u'2017, Enigma MPC, Inc.' +copyright = u'2018, Enigma MPC, Inc.' # The full version, including alpha/beta/rc tags, but excluding the commit hash #release = version.split('+', 1)[0] -release = '0.3' +release = '0.4' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. From a754497d65571e9071c9e6d1825493a68d6c0f3b Mon Sep 17 00:00:00 2001 From: Frederic Fortier Date: Fri, 19 Jan 2018 18:12:54 -0500 Subject: [PATCH 2/3] BLD: completed implementation of issue #60, authentication aliases --- catalyst/__main__.py | 12 ++++++++++++ catalyst/utils/run_algo.py | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/catalyst/__main__.py b/catalyst/__main__.py index def7838e..2c531e15 100644 --- a/catalyst/__main__.py +++ b/catalyst/__main__.py @@ -285,6 +285,7 @@ def run(ctx, analyze_live=None, live_graph=False, simulate_orders=True, + auth_aliases=None, stats_output=None, ) @@ -413,6 +414,15 @@ def catalyst_magic(line, cell=None): help='Simulating orders enable the paper trading mode. No orders will be ' 'sent to the exchange unless set to false.', ) +@click.option( + '--auth-aliases', + default=None, + help='Authentication file aliases for the specified exchanges. By default,' + 'each exchange uses the "auth.json" file in the exchange folder. ' + 'Specifying an "auth2" alias would use "auth2.json". It should be ' + 'specified like this: "[exchange_name],[alias],..." For example, ' + '"binance,auth2" or "binance,auth2,bittrex,auth2".', +) @click.pass_context def live(ctx, algofile, @@ -427,6 +437,7 @@ def live(ctx, base_currency, end, live_graph, + auth_aliases, simulate_orders): """Trade live with the given algorithm. """ @@ -480,6 +491,7 @@ def live(ctx, live_graph=live_graph, analyze_live=None, simulate_orders=simulate_orders, + auth_aliases=auth_aliases, stats_output=None, ) diff --git a/catalyst/utils/run_algo.py b/catalyst/utils/run_algo.py index 9285114a..a327e8a5 100644 --- a/catalyst/utils/run_algo.py +++ b/catalyst/utils/run_algo.py @@ -8,6 +8,8 @@ from time import sleep import click import pandas as pd +from six import string_types + from catalyst.data.bundles import load from catalyst.data.data_portal import DataPortal from catalyst.exchange.exchange_pricing_loader import ExchangePricingLoader, \ @@ -97,6 +99,7 @@ def _run(handle_data, This is shared between the cli and :func:`catalyst.run_algo`. """ + # TODO: refactor for more granularity if algotext is not None: if local_namespace: ip = get_ipython() # noqa @@ -163,6 +166,17 @@ def _run(handle_data, if exchange_name is None: raise ValueError('Please specify at least one exchange.') + if isinstance(auth_aliases, string_types): + aliases = auth_aliases.split(',') + if len(aliases) < 2 or len(aliases) % 2 != 0: + raise ValueError( + 'the `auth_aliases` parameter must contain an even list ' + 'of comma-delimited values. For example, ' + '"binance,auth2" or "binance,auth2,bittrex,auth2".' + ) + + auth_aliases = dict(zip(aliases[::2], aliases[1::2])) + exchange_list = [x.strip().lower() for x in exchange.split(',')] exchanges = dict() for name in exchange_list: From 575ac4a36dda271bd4df5f6d5673c6d439d481f0 Mon Sep 17 00:00:00 2001 From: Frederic Fortier Date: Fri, 19 Jan 2018 18:17:07 -0500 Subject: [PATCH 3/3] BLD: updated release notes for release 0.4.7 --- docs/source/releases.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/source/releases.rst b/docs/source/releases.rst index 0130ccce..635f2e95 100644 --- a/docs/source/releases.rst +++ b/docs/source/releases.rst @@ -2,6 +2,18 @@ Release Notes ============= +Version 0.4.7 +^^^^^^^^^^^^^ +**Release Date**: 2018-01-19 + +Bug Fixes +~~~~~~~~~ +- Fixing issue :issue:`137` impacting the CLI + +Build +~~~~~ +- Implemented authentication aliases (:issue:`60`) + Version 0.4.6 ^^^^^^^^^^^^^ **Release Date**: 2018-01-18