Skip to content

Commit

Permalink
renamed to zipline
Browse files Browse the repository at this point in the history
  • Loading branch information
fawce committed Feb 14, 2012
1 parent 6730572 commit 2fd2808
Show file tree
Hide file tree
Showing 21 changed files with 59 additions and 59 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
# 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)
]

Expand Down
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
==========================
Expand All @@ -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 <qsim.sources.DataSource>`, 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 <qsim.sources.DataSource>` and combine them into a serial chronological stream.
All simulations start with a collection of :py:class:`DataSources <zipline.sources.DataSource>`, 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 <zipline.sources.DataSource>` 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
Expand Down
4 changes: 2 additions & 2 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
qsim
zipline
====

.. toctree::
:maxdepth: 4

qsim
zipline
4 changes: 2 additions & 2 deletions docs/notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions docs/qsim.rst
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
============
qsim Package
zipline Package
============

QSim API
===========================

:mod:`qsim` Package
:mod:`zipline` Package
-------------------

.. automodule:: qsim.__init__
.. automodule:: zipline.__init__
:members:
:undoc-members:
:show-inheritance:

:mod:`config` Module
--------------------

.. automodule:: qsim.config
.. automodule:: zipline.config
:members:
:undoc-members:
:show-inheritance:

:mod:`core` Module
------------------

.. automodule:: qsim.core
.. automodule:: zipline.core
:members:
:undoc-members:
:show-inheritance:

:mod:`messaging` Module
-----------------------

.. automodule:: qsim.messaging
.. automodule:: zipline.messaging
:members:
:undoc-members:
:show-inheritance:

:mod:`sources` Module
---------------------

.. automodule:: qsim.sources
.. automodule:: zipline.sources
:members:
:undoc-members:
:show-inheritance:

:mod:`util` Module
------------------

.. automodule:: qsim.util
.. automodule:: zipline.util
:members:
:undoc-members:
:show-inheritance:
Expand All @@ -58,6 +58,6 @@ Subpackages

.. toctree::

qsim.test
qsim.transforms
zipline.test
zipline.transforms

4 changes: 2 additions & 2 deletions docs/qsim.test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ test Package
:mod:`client` Module
--------------------

.. automodule:: qsim.test.client
.. automodule:: zipline.test.client
:members:
:undoc-members:
:show-inheritance:

:mod:`test_messaging` Module
----------------------------

.. automodule:: qsim.test.test_messaging
.. automodule:: zipline.test.test_messaging
:members:
:undoc-members:
:show-inheritance:
Expand Down
6 changes: 3 additions & 3 deletions docs/qsim.transforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ transforms Package
:mod:`core` Module
------------------

.. automodule:: qsim.transforms.core
.. automodule:: zipline.transforms.core
:members:
:undoc-members:
:show-inheritance:

:mod:`merge` Module
-------------------

.. automodule:: qsim.transforms.merge
.. automodule:: zipline.transforms.merge
:members:
:undoc-members:
:show-inheritance:

:mod:`technical` Module
-----------------------

.. automodule:: qsim.transforms.technical
.. automodule:: zipline.transforms.technical
:members:
:undoc-members:
:show-inheritance:
Expand Down
12 changes: 6 additions & 6 deletions etc/jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def parse_requirements(file_name):
builddir="_build",
sourcedir=""
),
setup = Bunch(name='qsim',
setup = Bunch(name='zipline',
version = version,
classifiers = [],
packages = find_packages(),
Expand All @@ -68,7 +68,7 @@ def parse_requirements(file_name):

# Because I'm lazy
stuff_i_want_in_my_debug_shell = [
('qutil', 'qsim.util', []),
('qutil', 'zipline.util', []),
('zmq', 'zmq', []),
]

Expand All @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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():
Expand All @@ -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)
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions qsim/core.py → zipline/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
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):
"""
Expand Down
2 changes: 1 addition & 1 deletion qsim/messaging.py → zipline/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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
Expand Down
4 changes: 2 additions & 2 deletions qsim/sources.py → zipline/sources.py
Original file line number Diff line number Diff line change
@@ -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):
"""
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion qsim/test/client.py → zipline/test/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import zmq
import json
import qsim.util as qutil
import zipline.util as qutil

class TestClient(object):

Expand Down
12 changes: 6 additions & 6 deletions qsim/test/test_messaging.py → zipline/test/test_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
==========
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"""
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):
"""
Expand Down
4 changes: 2 additions & 2 deletions qsim/util.py → zipline/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 2fd2808

Please sign in to comment.