From 2fd2808e28f84307f27d5988ae973c8861c920f7 Mon Sep 17 00:00:00 2001 From: fawce Date: Tue, 14 Feb 2012 12:23:48 -0500 Subject: [PATCH] renamed to zipline --- README.md | 4 ++-- docs/conf.py | 2 +- docs/index.rst | 8 ++++---- docs/modules.rst | 4 ++-- docs/notes.rst | 4 ++-- docs/qsim.rst | 20 ++++++++++---------- docs/qsim.test.rst | 4 ++-- docs/qsim.transforms.rst | 6 +++--- etc/jenkins.sh | 12 ++++++------ pavement.py | 18 +++++++++--------- setup.cfg | 2 +- {qsim => zipline}/__init__.py | 0 {qsim => zipline}/core.py | 4 ++-- {qsim => zipline}/messaging.py | 2 +- {qsim => zipline}/sources.py | 4 ++-- {qsim => zipline}/test/__init__.py | 0 {qsim => zipline}/test/client.py | 2 +- {qsim => zipline}/test/test_messaging.py | 12 ++++++------ {qsim => zipline}/transforms/__init__.py | 2 +- {qsim => zipline}/transforms/technical.py | 4 ++-- {qsim => zipline}/util.py | 4 ++-- 21 files changed, 59 insertions(+), 59 deletions(-) rename {qsim => zipline}/__init__.py (100%) rename {qsim => zipline}/core.py (99%) rename {qsim => zipline}/messaging.py (99%) rename {qsim => zipline}/sources.py (97%) rename {qsim => zipline}/test/__init__.py (100%) rename {qsim => zipline}/test/client.py (98%) rename {qsim => zipline}/test/test_messaging.py (91%) rename {qsim => zipline}/transforms/__init__.py (90%) rename {qsim => zipline}/transforms/technical.py (95%) rename {qsim => zipline}/util.py (87%) diff --git a/README.md b/README.md index 2ee7f7ff..4d897a2e 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Running Initial `virtualenv` setup:: - $ mkvirtualenv qsim - $ workon qsim + $ mkvirtualenv zipline + $ workon zipline #go get coffee, this will compile a heap of C/C++ code $ ./etc/ordered_pip.sh requirements_sci.txt $ ./etc/ordered_pip.sh requirements.txt diff --git a/docs/conf.py b/docs/conf.py index 32b94b5c..f5432265 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -213,7 +213,7 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'qsim', u'QSim Documentation', + ('index', 'zipline', u'QSim Documentation', [u'Quantopian: jean, fawce, sdiehl'], 1) ] diff --git a/docs/index.rst b/docs/index.rst index 5cbf9309..d4a297ea 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,7 +17,7 @@ Quantopian Simulator: QSim Qsim runs backtests using asynchronous components and zeromq messaging for communication and coordination. -Simulator is the heart of QSim, and the primary access point for creating, launching, and tracking simulations. You can find it in :py:class:`~qsim.core.Simulator` +Simulator is the heart of QSim, and the primary access point for creating, launching, and tracking simulations. You can find it in :py:class:`~zipline.core.Simulator` Simulator Sub-Components ========================== @@ -28,17 +28,17 @@ via zeromq. DataSources -------------------- -A DataSource represents a historical event record, which will be played back during simulation. A simulation may have one or more DataSources, which will be combined in DataFeed. Generally, datasources read records from a persistent store (db, csv file, remote service), format the messages for downstream simulation components, and send them to a PUSH socket. See the base class for all datasources :py:class:`~qsim.sources.DataSource` +A DataSource represents a historical event record, which will be played back during simulation. A simulation may have one or more DataSources, which will be combined in DataFeed. Generally, datasources read records from a persistent store (db, csv file, remote service), format the messages for downstream simulation components, and send them to a PUSH socket. See the base class for all datasources :py:class:`~zipline.sources.DataSource` DataFeed -------------------- -All simulations start with a collection of :py:class:`DataSources `, which need to be fed to an algorithm. Each :py:class:`~qsim.sources.DataSource`can contain events of differing content (trades, quotes, corporate event) and frequency (quarterly, intraday). To simplify the process of managing the data sources, :py:class:`~qsim.core.DataFeed` can receive events from multiple :py:class:`DataSources ` and combine them into a serial chronological stream. +All simulations start with a collection of :py:class:`DataSources `, which need to be fed to an algorithm. Each :py:class:`~zipline.sources.DataSource`can contain events of differing content (trades, quotes, corporate event) and frequency (quarterly, intraday). To simplify the process of managing the data sources, :py:class:`~zipline.core.DataFeed` can receive events from multiple :py:class:`DataSources ` and combine them into a serial chronological stream. Transforms -------------------- -Often, an algorithm will require a running calculation on top of a :py:class:`~qsim.sources.DataSource`, or on the consolidated feed. A simple example is a technical indicator or a moving average. Transforms can be described in :py:class:`~qsim.core.Simulator`'s configuration. Subclass :py:class:`~qsim.transforms.core.Transform` to add your own Transform. Transforms must hold their own state between events, and serialize their current values into messages. +Often, an algorithm will require a running calculation on top of a :py:class:`~zipline.sources.DataSource`, or on the consolidated feed. A simple example is a technical indicator or a moving average. Transforms can be described in :py:class:`~zipline.core.Simulator`'s configuration. Subclass :py:class:`~zipline.transforms.core.Transform` to add your own Transform. Transforms must hold their own state between events, and serialize their current values into messages. Data Alignment diff --git a/docs/modules.rst b/docs/modules.rst index 3be31086..199e3784 100644 --- a/docs/modules.rst +++ b/docs/modules.rst @@ -1,7 +1,7 @@ -qsim +zipline ==== .. toctree:: :maxdepth: 4 - qsim + zipline diff --git a/docs/notes.rst b/docs/notes.rst index 93ca0282..bf2d2237 100644 --- a/docs/notes.rst +++ b/docs/notes.rst @@ -8,8 +8,8 @@ Running Initial `virtualenv` setup:: - $ mkvirtualenv qsim - $ workon qsim + $ mkvirtualenv zipline + $ workon zipline #go get coffee, this will compile a heap of C/C++ code $ ./etc/ordered_pip.sh requirements_sci.txt $ ./etc/ordered_pip.sh requirements.txt diff --git a/docs/qsim.rst b/docs/qsim.rst index f1e7216c..f710a703 100644 --- a/docs/qsim.rst +++ b/docs/qsim.rst @@ -1,14 +1,14 @@ ============ -qsim Package +zipline Package ============ QSim API =========================== -:mod:`qsim` Package +:mod:`zipline` Package ------------------- -.. automodule:: qsim.__init__ +.. automodule:: zipline.__init__ :members: :undoc-members: :show-inheritance: @@ -16,7 +16,7 @@ QSim API :mod:`config` Module -------------------- -.. automodule:: qsim.config +.. automodule:: zipline.config :members: :undoc-members: :show-inheritance: @@ -24,7 +24,7 @@ QSim API :mod:`core` Module ------------------ -.. automodule:: qsim.core +.. automodule:: zipline.core :members: :undoc-members: :show-inheritance: @@ -32,7 +32,7 @@ QSim API :mod:`messaging` Module ----------------------- -.. automodule:: qsim.messaging +.. automodule:: zipline.messaging :members: :undoc-members: :show-inheritance: @@ -40,7 +40,7 @@ QSim API :mod:`sources` Module --------------------- -.. automodule:: qsim.sources +.. automodule:: zipline.sources :members: :undoc-members: :show-inheritance: @@ -48,7 +48,7 @@ QSim API :mod:`util` Module ------------------ -.. automodule:: qsim.util +.. automodule:: zipline.util :members: :undoc-members: :show-inheritance: @@ -58,6 +58,6 @@ Subpackages .. toctree:: - qsim.test - qsim.transforms + zipline.test + zipline.transforms diff --git a/docs/qsim.test.rst b/docs/qsim.test.rst index bd33da08..5521f57e 100644 --- a/docs/qsim.test.rst +++ b/docs/qsim.test.rst @@ -4,7 +4,7 @@ test Package :mod:`client` Module -------------------- -.. automodule:: qsim.test.client +.. automodule:: zipline.test.client :members: :undoc-members: :show-inheritance: @@ -12,7 +12,7 @@ test Package :mod:`test_messaging` Module ---------------------------- -.. automodule:: qsim.test.test_messaging +.. automodule:: zipline.test.test_messaging :members: :undoc-members: :show-inheritance: diff --git a/docs/qsim.transforms.rst b/docs/qsim.transforms.rst index 6b8b05c9..9d95b7de 100644 --- a/docs/qsim.transforms.rst +++ b/docs/qsim.transforms.rst @@ -4,7 +4,7 @@ transforms Package :mod:`core` Module ------------------ -.. automodule:: qsim.transforms.core +.. automodule:: zipline.transforms.core :members: :undoc-members: :show-inheritance: @@ -12,7 +12,7 @@ transforms Package :mod:`merge` Module ------------------- -.. automodule:: qsim.transforms.merge +.. automodule:: zipline.transforms.merge :members: :undoc-members: :show-inheritance: @@ -20,7 +20,7 @@ transforms Package :mod:`technical` Module ----------------------- -.. automodule:: qsim.transforms.technical +.. automodule:: zipline.transforms.technical :members: :undoc-members: :show-inheritance: diff --git a/etc/jenkins.sh b/etc/jenkins.sh index 563111ae..8a649664 100755 --- a/etc/jenkins.sh +++ b/etc/jenkins.sh @@ -8,16 +8,16 @@ if [ ! -d $WORKON_HOME ]; then fi source /usr/local/bin/virtualenvwrapper.sh -#create the scientific python virtualenv and copy to provide qsim base +#create the scientific python virtualenv and copy to provide zipline base mkvirtualenv --no-site-packages scientific_base workon scientific_base ./etc/ordered_pip.sh ./etc/requirements_sci.txt deactivate -#re-base qsim -#rmvirtualenv qsim -cpvirtualenv scientific_base qsim +#re-base zipline +#rmvirtualenv zipline +cpvirtualenv scientific_base zipline -workon qsim +workon zipline ./etc/ordered_pip.sh ./etc/requirements.txt ./etc/ordered_pip.sh ./etc/requirements_dev.txt @@ -32,7 +32,7 @@ nosetests #run pylint checks cp ./pylint.rcfile /mnt/jenkins/.pylintrc #default location for config file... -pylint -f parseable qsim | tee pylint.out +pylint -f parseable zipline | tee pylint.out #run sloccount analysis sloccount --wide --details ./ > sloccount.sc diff --git a/pavement.py b/pavement.py index 3aa5bf5c..0fd32fd3 100644 --- a/pavement.py +++ b/pavement.py @@ -44,7 +44,7 @@ options( builddir="_build", sourcedir="" ), - setup = Bunch(name='qsim', + setup = Bunch(name='zipline', version = version, classifiers = [], packages = find_packages(), @@ -68,7 +68,7 @@ options.paved.clean.patterns.extend([ # Because I'm lazy stuff_i_want_in_my_debug_shell = [ - ('qutil', 'qsim.util', []), + ('qutil', 'zipline.util', []), ('zmq', 'zmq', []), ] @@ -82,7 +82,7 @@ def coverage(): Run the devsever under the coverage reporter, generate the coverage report. """ - call('nosetests qsim', shell=True) + call('nosetests zipline', shell=True) call('coverage html', shell=True) call('chromium %s/cover/index.html' % (os.path.abspath(".")), shell=True) @@ -94,13 +94,13 @@ def profile(): statistics about runtimes. """ try: - call('python -m cProfile -o qsim.prof qexec/web/devserver.py --hostsettings', shell=True) + call('python -m cProfile -o zipline.prof qexec/web/devserver.py --hostsettings', shell=True) except KeyboardInterrupt: pass import pstats time.sleep(1) # wait for disk io - p = pstats.Stats('qsim.prof') + p = pstats.Stats('zipline.prof') # Print the hundred heaviest function calls p.sort_stats('time').print_stats(100) @@ -156,21 +156,21 @@ def findbugs(): hotspots in your code where bugs are likely to occur based on their git history. """ - call('bugspot.py qsim', shell=True) + call('bugspot.py zipline', shell=True) @task def findtodos(): """ Grep for TODO """ - call('grep TODO qsim/*/*.py -C 3 ', shell=True) + call('grep TODO zipline/*/*.py -C 3 ', shell=True) @task def findpdb(): """ find references to debugger """ - call('grep "import pdb; pdb.set_trace()" qsim/*/*.py -C 3 ', shell=True) + call('grep "import pdb; pdb.set_trace()" zipline/*/*.py -C 3 ', shell=True) @task def guppy(): @@ -185,4 +185,4 @@ def apidocs(): Recursively autogenerate the Sphinx autodoc for the module and its submodules. """ - call('sphinx-apidoc -o docs/ qsim', shell=True) + call('sphinx-apidoc -o docs/ zipline', shell=True) diff --git a/setup.cfg b/setup.cfg index 3286ce2f..ac6880d1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ verbosity=2 detailed-errors=1 with-xcoverage=1 -cover-package=qsim +cover-package=zipline cover-erase=1 cover-html=1 cover-html-dir=docs/_build/html/cover diff --git a/qsim/__init__.py b/zipline/__init__.py similarity index 100% rename from qsim/__init__.py rename to zipline/__init__.py diff --git a/qsim/core.py b/zipline/core.py similarity index 99% rename from qsim/core.py rename to zipline/core.py index dd5f2eb2..47e99048 100644 --- a/qsim/core.py +++ b/zipline/core.py @@ -9,8 +9,8 @@ import threading import datetime import atexit -import qsim.util as qutil -import qsim.messaging as qmsg +import zipline.util as qutil +import zipline.messaging as qmsg class SimulatorBase(object): """ diff --git a/qsim/messaging.py b/zipline/messaging.py similarity index 99% rename from qsim/messaging.py rename to zipline/messaging.py index 0f8946c0..db36f219 100644 --- a/qsim/messaging.py +++ b/zipline/messaging.py @@ -5,7 +5,7 @@ import json import uuid import zmq -import qsim.util as qutil +import zipline.util as qutil class ParallelBuffer(object): """ holds several queues of events by key, allows retrieval in date order diff --git a/qsim/sources.py b/zipline/sources.py similarity index 97% rename from qsim/sources.py rename to zipline/sources.py index d5b387c5..b844855d 100644 --- a/qsim/sources.py +++ b/zipline/sources.py @@ -1,12 +1,12 @@ """ -Provides data handlers that can push messages to a qsim.core.DataFeed +Provides data handlers that can push messages to a zipline.core.DataFeed """ import datetime import zmq import json import random -import qsim.util as qutil +import zipline.util as qutil class DataSource(object): """ diff --git a/qsim/test/__init__.py b/zipline/test/__init__.py similarity index 100% rename from qsim/test/__init__.py rename to zipline/test/__init__.py diff --git a/qsim/test/client.py b/zipline/test/client.py similarity index 98% rename from qsim/test/client.py rename to zipline/test/client.py index 9705dbc8..0f4bc80a 100644 --- a/qsim/test/client.py +++ b/zipline/test/client.py @@ -1,6 +1,6 @@ import zmq import json -import qsim.util as qutil +import zipline.util as qutil class TestClient(object): diff --git a/qsim/test/test_messaging.py b/zipline/test/test_messaging.py similarity index 91% rename from qsim/test/test_messaging.py rename to zipline/test/test_messaging.py index ea75a81f..0e88ce9a 100644 --- a/qsim/test/test_messaging.py +++ b/zipline/test/test_messaging.py @@ -7,13 +7,13 @@ import unittest2 as unittest import multiprocessing import time -from qsim.core import ThreadSimulator, ProcessSimulator, DataFeed -from qsim.transforms.technical import MovingAverage -from qsim.sources import RandomEquityTrades -import qsim.util as qutil -import qsim.messaging as qmsg +from zipline.core import ThreadSimulator, ProcessSimulator, DataFeed +from zipline.transforms.technical import MovingAverage +from zipline.sources import RandomEquityTrades +import zipline.util as qutil +import zipline.messaging as qmsg -from qsim.test.client import TestClient +from zipline.test.client import TestClient class MessagingTestCase(unittest.TestCase): diff --git a/qsim/transforms/__init__.py b/zipline/transforms/__init__.py similarity index 90% rename from qsim/transforms/__init__.py rename to zipline/transforms/__init__.py index 789e9543..ea33ca7c 100644 --- a/qsim/transforms/__init__.py +++ b/zipline/transforms/__init__.py @@ -3,7 +3,7 @@ Transforms ========== Transforms provide re-useable components for stream processing. All -Transforms expect to receive data events from qsim.core.DataFeed +Transforms expect to receive data events from zipline.core.DataFeed asynchronously via zeromq. Each transform is designed to run in independent process space, independently of all other transforms, to allow for parallel computation. diff --git a/qsim/transforms/technical.py b/zipline/transforms/technical.py similarity index 95% rename from qsim/transforms/technical.py rename to zipline/transforms/technical.py index 63d7a164..fc19bd76 100644 --- a/qsim/transforms/technical.py +++ b/zipline/transforms/technical.py @@ -5,8 +5,8 @@ TODO: add trailing stop """ import datetime -from qsim.core import BaseTransform -import qsim.util as qutil +from zipline.core import BaseTransform +import zipline.util as qutil class MovingAverage(BaseTransform): """ diff --git a/qsim/util.py b/zipline/util.py similarity index 87% rename from qsim/util.py rename to zipline/util.py index fc796b56..e29f75a1 100644 --- a/qsim/util.py +++ b/zipline/util.py @@ -27,10 +27,10 @@ def format_date(dt): return dt_str def configure_logging(loglevel=logging.DEBUG): - """configures qsim.util.LOGGER to write a rotating file (10M per file, 5 files) to /var/log/qsim.log""" + """configures zipline.util.LOGGER to write a rotating file (10M per file, 5 files) to /var/log/zipline.log""" LOGGER.setLevel(loglevel) handler = logging.handlers.RotatingFileHandler( - "/var/log/qsim/{lfn}.log".format(lfn="qsim"), + "/var/log/zipline/{lfn}.log".format(lfn="zipline"), maxBytes=10*1024*1024, backupCount=5) handler.setFormatter(logging.Formatter( "%(asctime)s %(levelname)s %(filename)s %(funcName)s - %(message)s","%Y-%m-%d %H:%M:%S %Z"))