zipline-- 开发指南
Development Guidelines
开发指南
This page is intended for developers of Zipline, people who want to contribute to the Zipline codebase or documentation, or people who want to install from source and make local changes to their copy of Zipline.
这个页面是为Zipline开发、希望为ZiPin代码库或文档提供帮助,或者希望从源文件安装并对ZiPrin的副本进行本地修改的人编写的。
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome. We track issues on GitHub and also have a mailing list where you can ask questions.
所有的贡献、bug报告、bug修复、文档改进、增强和想法都是受欢迎的。我们跟踪GITHUB上的问题,也有一个邮件列表,你可以问问题。
Creating a Development Environment
创建开发环境
First, you’ll need to clone Zipline by running:
首先,你需要通过运行下面代码克隆ZIPLIN:
$ git clone git@github.com:your-github-username/zipline.git
Then check out to a new branch where you can make your changes:
然后检查到一下你可以做过修改的分支:
$ git checkout -b some-short-descriptive-name
If you don’t already have them, you’ll need some C library dependencies. You can follow the install guide to get the appropriate dependencies.
如果您还没有这些文件,则需要一些C库依赖项。您可以按照安装指南获得适当的依赖关系。
The following section assumes you already have virtualenvwrapper and pip installed on your system. Suggested installation of Python library dependencies used for development:
下面的部分假定您已经在系统上安装了ValualEnvRePrPress和PIP。建议安装用于开发的Python库依赖项:
$ mkvirtualenv zipline
$ ./etc/ordered_pip.sh ./etc/requirements.txt
$ pip install -r ./etc/requirements_dev.txt
$ pip install -r ./etc/requirements_blaze.txt
Finally, you can build the C extensions by running:
最后,您可以通过运行来构建C扩展:
$ python setup.py build_ext --inplace
To finish, make sure tests pass.
要完成,确保测试通过。
If you get an error running nosetests after setting up a fresh virtualenv, please try running
如果在创建新的虚拟机后运行nosetests出错,请尝试运行
# where zipline is the name of your virtualenv
$ deactivate zipline
$ workon zipline
Development with Docker
使用Docker开发
If you want to work with zipline using a Docker container, you’ll need to build the Dockerfile in the Zipline root directory, and then build Dockerfile-dev. Instructions for building both containers can be found in Dockerfile and Dockerfile-dev, respectively.
如果您想使用Docker容器与Zipline一起工作,则需要在zipline的root目录中构建Dockerfile文件,然后构建Dockerfile-dev。在Dockerfile and Dockerfile-dev中分别找到用于构建这两个容器的指令。
Style Guide & Running Tests
样式指南;运行测试
We use flake8 for checking style requirements and nosetests to run Zipline tests. Our continuous integration tools will run these commands.
我们使用FLAKE8来检查样式需求和nosetests来运行ZiPiLin测试。我们的连续集成工具将运行这些命令。
Before submitting patches or pull requests, please ensure that your changes pass when running:
在提交补丁或提请请求之前,请确保在运行时您的更改通过测试:
$ flake8 zipline tests
In order to run tests locally, you’ll need TA-lib, which you can install on Linux by running:
为了在本地运行测试,您需要TA LIB,您可以通过在Linux上安装运行:
$ wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
$ tar -xvzf ta-lib-0.4.0-src.tar.gz
$ cd ta-lib/
$ ./configure --prefix=/usr
$ make
$ sudo make install
And for TA-lib on OS X you can just run:
对于OSX上的TA LIB,您可以运行:
$ brew install ta-lib
Then run pip install TA-lib:
然后运行PIP安装TA LIB:
$ pip install -r ./etc/requirements_talib.txt
You should now be free to run tests:
您现在应该可以自由运行测试:
$ nosetests
Continuous Integration
持续集成
We use CI for Linux-64 bit builds and AppVeyor for Windows-64 bit builds.
我们使用Travis CI为Linux-64位构建和 AppVeyor为Windows 64位构建。
Packaging
包装
To learn about how we build Zipline conda packages, you can read this section in our release process notes.
要了解我们如何构建ZiPin CONDA软件包,您可以在我们的发布过程日记中阅读这一部分。
Contributing to the Docs
对文档的贡献
If you’d like to contribute to the documentation on zipline.io, you can navigate to docs/source/ where each reStructuredText (.rst) file is a separate section there. To add a section, create a new file called some-descriptive-name.rst and add some-descriptive-name to appendix.rst. To edit a section, simply open up one of the existing files, make your changes, and save them.
如果您想为ZiPix.IO的文档作出贡献,您可以导航到docs/source/的每个 reStructuredText (.rst)文件,其中的每一个都是单独的一个部分。要添加一个部分,创建一个名为some-descriptive-name.rst的新文件,并将some-descriptive-name添加到appendix.rst。要编辑一个部分,只需打开现有文件中的一个,进行更改,然后保存它们。
We use Sphinx to generate documentation for Zipline, which you will need to install by running:
我们使用Sphinx生成ZIPLIN文档,您需要通过运行来安装:
$ pip install -r ./etc/requirements_docs.txt
To build and view the docs locally, run:
要在本地构建和查看文档,请运行:
# assuming you're in the Zipline root directory
$ cd docs
$ make html
$ {BROWSER} build/html/index.html
Commit messages
提交消息
Standard prefixes to start a commit message:
启动提交消息的标准前缀:
BLD: change related to building Zipline
BUG: bug fix
DEP: deprecate something, or remove a deprecated object
DEV: development tool or utility
DOC: documentation
ENH: enhancement
MAINT: maintenance commit (refactoring, typos, etc)
REV: revert an earlier commit
STY: style fix (whitespace, PEP8, flake8, etc)
TST: addition or modification of tests
REL: related to releasing Zipline
PERF: performance enhancements
Some commit style guidelines:
一些提交风格指南:
Commit lines should be no longer than 72 characters. The first line of the commit should include one of the above prefixes. There should be an empty line between the commit subject and the body of the commit. In general, the message should be in the imperative tense. Best practice is to include not only what the change is, but why the change was made.
提交行不应超过72个字符。提交的第一行应该包括上面的前缀之一。在提交主体和提交主体之间应该有一个空行。一般来说,信息应该是祈使语气。最好的做法是不仅包括改变是什么,而且包括改变的原因。
例如:
MAINT: Remove unused calculations of max_leverage, et al. In the performance period the max_leverage, max_capital_used,
cumulative_capital_used were calculated but not used. At least one of those calculations, max_leverage, was causing a
divide by zero error. Instead of papering over that error, the entire calculation was
a bit suspect so removing, with possibility of adding it back in
later with handling the case (or raising appropriate errors) when
the algorithm has little cash on hand.
Formatting Docstrings
格式化文档字符串
When adding or editing docstrings for classes, functions, etc, we use numpy as the canonical reference.
当为类、函数等添加或编辑docstrings时,我们使用numpy作为规范引用。
Updating the Whatsnew
更新新事物
We have a set of whatsnew files that are used for documenting changes that have occurred between different versions of Zipline. Once you’ve made a change to Zipline, in your Pull Request, please update the most recent whatsnew file with a comment about what you changed. You can find examples in previous whatsnew files.
我们有一套whatsnew文件用于记录不同版本的ZIPLIN之间发生的变化。一旦你改变了ZIPLIN,在你提需求,请更新最新的Whatsnew并说明你改变了什么。你可以在以前的whatsnew中找到例子。
zipline-- 开发指南的更多相关文章
- ASP.NET Aries 开源开发框架:开发指南(一)
前言: 上周开源了Aries开发框架后,好多朋友都Download了源码,在运行过程里,有一些共性的问题会问到. 所以本篇打算写一下简单的开发指南,照顾一下不是太看的懂源码的同学,同时也会讲解一下框架 ...
- FreeMarker模板开发指南知识点梳理
freemarker是什么? 有什么用? 怎么用? (问得好,这些都是我想知道的问题) freemarker是什么? FreeMarker 是一款 模板引擎: 即一种基于模板和要改变的数据, 并用来生 ...
- Jetty使用教程(四:21-22)—Jetty开发指南
二十一.嵌入式开发 21.1 Jetty嵌入式开发HelloWorld 本章节将提供一些教程,通过Jetty API快速开发嵌入式代码 21.1.1 下载Jetty的jar包 Jetty目前已经把所有 ...
- JVM 平台上的各种语言的开发指南
JVM 平台上的各种语言的开发指南 为什么我们需要如此多的JVM语言? 在2013年你可以有50中JVM语言的选择来用于你的下一个项目.尽管你可以说出一大打的名字,你会准备为你的下一个项目选择一种新的 ...
- iOS原生地图开发指南续——大头针与自定义标注
iOS原生地图开发指南续——大头针与自定义标注 出自:http://www.sxt.cn/info-6042-u-7372.html 在上一篇博客中http://my.oschina.net/u/23 ...
- Angularjs中文版本开发指南发布
从本人开始在写关于Angularjs的文章开始,也算是见证了Angularjs在国内慢慢的火起来,如今的Angularjs正式如日中天.想知道为什么Angularjs会这么火,请移步angularjs ...
- nodejs开发指南读后感
nodejs开发指南读后感 阅读目录 使用nodejs创建http服务器; supervisor的使用及nodejs常见的调式代码命令了解; 了解Node核心模块; ejs模板引擎 Express 理 ...
- Libgdx 开发指南——目录
本系列文档选译自libgdx github项目 wiki : https://github.com/libgdx/libgdx/wiki 由于关于Libgdx的中文文档非常稀缺,因此在这里对官方Wik ...
- jQuery MiniUI 开发指南+API组件参考手册
jQuery MiniUI 开发指南 本文档将逐步的讲解jQuery MiniUI的方方面面,从此您将踏上jQuery MiniUI的深入探索之旅. 1.Hello M ...
- 《CSS3专业网页开发指南》笔记
书本:<CSS3专业网页开发指南>(the book of css3) Peter Gasston 著 李景媛 吴晓嘉 译 第1章: 1.box-sizing : IE8及以上版本 ...
随机推荐
- ASP.NET学习笔记 —— 一般处理程序之图片上传
简单图片上传功能目标:实现从本地磁盘读取图片文件,展示到浏览器页面.步骤:(1). 首先创建一个用于上传图片的HTML模板,命名为ImageUpload.html: <!DOCTYPE html ...
- NVIDIA-SMI系列命令总结
1 NVIDIA-SMI介绍 nvidia-smi简称NVSMI,提供监控GPU使用情况和更改GPU状态的功能,是一个跨平台工具,它支持所有标准的NVIDIA驱动程序支持的Linux发行版以及从Wi ...
- pyspider 初次使用
一 安装 pip install pyspider 请安装PhantomJS:http://phantomjs.org/build.html 二 检验是否启动成功 cmd中输入: pyspider 安 ...
- maven编译开源项目报enforce错解决
刚下载一个开源项目源码,用maven编译发现报错: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plu ...
- IO模型介绍
先理解几个问题: (1)为什么读取文件的时候,需要用户进程通过系统调用内核完成(系统不能自己调用内核)什么是用户态和内核态?为什么要区分内核态和用户态呢? 在 CPU 的所有指令中,有些指令是非常危险 ...
- 修改DEDECMS文章标题长度,解决DEDECMS文章标题显示不全
dedecms系统使用过程中,常遇到输入的标题原本输入的字数跟保存成功后的数字长度不一样,这个是因为 织梦dedecms系统默认的文章标题字数限制是60,也就是只能输入30个汉字,超过的会自动截断删除 ...
- 安装Rocky版OpenStack 1控制节点+1计算节点环境部署脚本
在上一篇文章中叙述了具体的安装部署过程,在这里把相应的部署脚本写出来,供大家参考: 一.执行部署的setup.sh脚本: #!/bin/bash ########################### ...
- dpdk-18.11开发库编译安装
简介 dpdk官网 安装 下载 点击下载地址,选择合适的版本下载.这里下载DPDK 18.11.0 (LTS)版本. 编译 将下载的dpdk-18.11.tar.xz上传服务器,解压,这里放在了/op ...
- 排序—时间复杂度为O(n2)的三种排序算法
1 如何评价.分析一个排序算法? 很多语言.数据库都已经封装了关于排序算法的实现代码.所以我们学习排序算法目的更多的不是为了去实现这些代码,而是灵活的应用这些算法和解决更为复杂的问题,所以更重要的是学 ...
- Springboot读取Jar文件中的resource
如题,碰到了问题. 事情是这样的. 一个导入模板, 因为比较少, 所以就直接放在后台的resources中了.调试的时候是下载没有问题的. 等到发布后,下载就出问题了. 参照: ***.jar!\BO ...