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的开发人员,希望为Zipline代码库或文档作出贡献的人员,或希望从源代码进行安装并对其Zipline副本进行本地更改的人员。

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.

所有贡献,错误报告,错误修复,文档改进,增强功能和创意都受到欢迎。 我们在GitHub上跟踪问题,并且还有一个邮件列表,您可以在其中提问。

Creating a Development Environment 创建开发环境

First, you’ll need to clone Zipline by running: 首先,您需要运行以下命令克隆Zipline:

$ 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:

以下部分假定您已经在系统上安装了virtualenvwrapper和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 如果您在设置新的virtualenv后出现运行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根目录中构建Dockerfile,然后构建Dockerfile-dev。 构建两个容器的指令可分别在Dockerfile和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来运行Zipline测试。 我们的持续集成工具将运行这些命令。

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:

而对于OS X上的TA-lib,你可以运行:

$ brew install ta-lib

Then run pip install TA-lib:

然后运行pip install TA-lib:

$ pip install -r ./etc/requirements_talib.txt

You should now be free to run tests:

您现在应该可以自由运行测试:

$ nosetests

Continuous Integration 持续集成

We use Travis CI for Linux-64 bit builds and AppVeyor for Windows-64 bit builds.

我们使用Travis CI进行Linux-64位构建,使用AppVeyor进行Windows-64位构建。

Note

We do not currently have CI for OSX-64 bit builds. 32-bit builds may work but are not included in our integration tests.

我们目前没有用于OSX-64位构建的CI。 32位构建可能可行,但不包括在我们的集成测试中。

Packaging 打包

To learn about how we build Zipline conda packages, you can read this section in our release process notes.

要了解我们如何构建Zipline 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.

如果您想对zipline.io文档作出贡献,您可以导航到docs/source/,其中每个reStructuredText(.rst)文件都是一个单独的部分。 要添加节,请创建一个名为some-descriptive-name.rst的新文件,并向appendix.rst中添加一些描述性名称。 要编辑节,只需打开一个现有文件,进行更改并保存。

We use Sphinx to generate documentation for Zipline, which you will need to install by running:

我们使用Sphinx为Zipline生成文档,您需要通过运行来安装它:

$ 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个字符。 提交的第一行应包含上述前缀之一。 提交主题和提交主体之间应该有一条空行。 一般来说,信息应该是必要时。 最佳做法不仅包括变化是什么,而且包括变更的原因。

Example:

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 格式化Docstrings

When adding or editing docstrings for classes, functions, etc, we use numpy as the canonical reference. 当为类,函数等添加或编辑文档字符串时,我们使用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文件,用于记录不同版本的Zipline之间发生的变化。 一旦您对Zipline进行了更改,请在您的合并请求中更新最新的whatsnew文件,并附带有关您更改内容的评论。 您可以在以前的whatsnew文件中找到示例。

转载于:https://www.cnblogs.com/fangbei/p/9077987.html

Zipline Development Guidelines相关推荐

  1. mysql sql在线测试_在线SQL

    adv 1. 对产品质量的认知理念,不仅是是确保没问题,而是通过自身与团队的价值提升产品的质量.潜在问题,竞类产品用户体验,bug产生分析图,流程控制 2. 责任心特质,正能量,热情激情,并且能感染团 ...

  2. GMP:了解GMF引擎功能Graphical Modeling Framework

    在OpenExpressApp make business engineers develop applications中说过先考虑使用EMF先实现一个TOGAF9的建模工具来综合的了解建模更方面的知 ...

  3. 玩转lib-notify (转自PT牛的博客)

    玩转libnotify 分类: Unix/Linux 发布于: 2009.05.22 星期五 Ubuntu 9.04一个特性就是新的通知机制Notify OSD,让人一眼看上去很酷的样子,其实只是基于 ...

  4. Android Studio的Model代码插件开发

    为什么80%的码农都做不了架构师?>>>    源码地址 背景 码工们做的很多工作,很多时候是为了减少这个世界上的重复工作.在为这个世界带来便捷的时候,当然也要不忘给自己的工作减负, ...

  5. Kony开发入门及学习路线介绍

    Kony开发基础资料 Kony的简介及作用: "编写一次,随处运行"是Kony对于移动端开发的一个最佳解释, Kony 为大企业提供开发环境及移动中间件,可以让其开发并发布企业及消 ...

  6. 基于ACE的服务定位器(图失效)

    军械工程学院本科毕业论文 基于ACE的服务定位器 2006届计算机工程专业 指导教员:张剑炜 学员姓名:庄泽南 军械工程学院 二零零六年六月 论 文 摘 要 ACE自适配通信环境(ADAPTIVE C ...

  7. GMP:了解GMF引擎功能(Graphical Modeling Framework)

    在OpenExpressApp make business engineers develop applications中说过先考虑使用EMF先实现一个TOGAF9的建模工具来综合的了解建模更方面的知 ...

  8. 回顾“90后”——MISRA的25年岁月

    谈起MISRA这个名字,大家应该都不陌生,但,我们真的了解它吗?从90年代初期MISRA组织的发起至2020年,MISRA已走过25个年头.25年过去,90后已成长为现代社会发展的中坚力量,同样作为& ...

  9. IOS - app账号appstoreconnect信息,审核,上传确认项,被拒记录 解决方案中心 回复 申诉 超级签

    目录 TF包 超级签 账号被关联原因 App Transport Security Settings权限 私有API 付费陪伴 网络文化经营许可证 网安信息    后台审核举报处理 物理设备演示信息 ...

最新文章

  1. 人人都能学会的python编程教程3:字符串和编码
  2. Scikit-Learn大变化:合并Pandas
  3. 【Pthon入门学习】多级菜单小例子
  4. 【记录】在云服务器安装tomcat部署自己的项目 通过ip无需加端口号直接访问
  5. 210307共享内存的读写
  6. 《通过C#学Proto.Actor模型》之 HelloWorld
  7. PostgreSQL中常见的14个用户安全配置
  8. BeginnersBook Java IO 教程
  9. vscode+vim使用技巧
  10. mysql lock trx id_MySQL中RR模式下死锁一例
  11. /etc/sudoers文件的分析以及sudo的高级用法
  12. mysql primary重复_mysql:键'PRIMARY'和奇怪的ID行为重复条目'0'
  13. 《Android 应用案例开发大全(第3版)》——第1.3节Android开发环境的搭建
  14. 药店千方百剂系统无法连接服务器,管家婆千方百剂软件常见问题解决办法分享...
  15. 计算机英语简历模板,计算机专业的英文简历模板
  16. 学习笔记0525----NFS文件共享和FTP服务器
  17. mac备份文件到windows
  18. 1分钟彻底搞懂关于nginx的proxy_pass
  19. 怎么在合同谈判,计划和执行阶段分别进行范围管理
  20. python 知乎 合并 pdf_有什么比较好的 PDF 分割、合并软件?

热门文章

  1. 微信系小程序 StorageSync
  2. 【面试题】使用 HashMap 还是 TreeMap
  3. 结果集耗尽时,检查是否关闭结果集时常用sql
  4. BZOJ5091摘苹果(概率、期望)
  5. PL/SQL 包的概念及创建使用
  6. Java之Object类与instanceof关键字
  7. 第一天--来个占位符,让自己有一席之地
  8. 金山卫士UI原理解析(2)CBkWindow
  9. 写了几天的软工课程设计,慢慢了解了点mvc
  10. 20090701随笔