Skip to content

Commit c590046

Browse files
Merge branch 'release-1.8.1'
2 parents 3863447 + 6dd5fc8 commit c590046

File tree

600 files changed

+9296801
-8065942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

600 files changed

+9296801
-8065942
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
lint:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v3
9+
- uses: actions/checkout@v4
1010
- uses: psf/black@stable
1111
with:
1212
version: "23.11.0"

.github/workflows/quick-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ on:
99
jobs:
1010
build:
1111

12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
1515
python-version: [ 3.10.13 ]
1616

1717
steps:
1818

19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020

2121
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

.github/workflows/slow-test-develop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111

12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
1515
python-version: [ 3.10.13 ]

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Release notes
22

3+
## Version 1.8.1
4+
5+
- new Commission Report highlights where values need to be updated
6+
- parquet capital setup bugs fixed
7+
- ignore weekly GAS_US, LME contracts
8+
- add support for import of split frequency CSV prices
9+
- references to arctic updated in sysinit scripts
10+
- CONTRIBUTING.md updated
11+
-
312
## Version 1.80
413

514
- *NO LONGER REQUIRES ARCTIC* Time series data is stored in parquet, install pyarrow

CONTRIBUTING.md

Lines changed: 148 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,141 @@
11
# Pysystemtrade contributing guide
22

3+
Welcome and thank you for your interest in contributing to the project. This document aims to describe the preferred workflow
4+
5+
## Contributing
6+
7+
For small bugs, typos, documentation improvements, and minor changes - follow the steps in the [Working on topic branches](#working-on-topic-branches) section below to create a Pull Request.
8+
9+
For large changes, or new feature requests - please start an **Ideas** discussion first. Explain your idea, include some reasoning, perhaps some implementation ideas.
10+
11+
## Setup
12+
13+
> Credit to the [QuantConnect Lean project](https://github.com/QuantConnect/Lean), where most of these instructions originated
14+
15+
* Set up a [GitHub](https://github.com/) account
16+
* [Fork](https://help.github.com/articles/fork-a-repo/) the [repository](https://github.com/robcarver17/pysystemtrade) of the project
17+
* Clone your fork locally
18+
19+
```bash
20+
$ git clone https://github.com/<your_username>/pysystemtrade.git
21+
```
22+
23+
* Navigate to the pysystemtrade directory and add a remote `upstream`
24+
25+
```bash
26+
$ cd pysystemtrade
27+
$ git remote add upstream https://github.com/robcarver17/pysystemtrade.git
28+
```
29+
30+
The *upstream* remote links your fork of the project with the original
31+
32+
## Keeping your repo up to date
33+
34+
Now that you've defined the upstream branch, you can refresh your local copy with the following commands:
35+
36+
```bash
37+
$ git checkout develop
38+
$ git pull
39+
```
40+
41+
This will checkout your local develop branch and then merge changes in from upstream
42+
43+
## Branching model
44+
45+
If you are not familiar with git branches, please read this [guide](https://www.atlassian.com/git/tutorials/using-branches/). Our branching model is based on the one outlined [here](https://nvie.com/posts/a-successful-git-branching-model/)
46+
47+
The following names will be used to differentiate between the different repositories:
48+
49+
* **upstream** - The 'official' pysystemtrade [repository](https://github.com/robcarver17/pysystemtrade.git) (what is on Rob's GitHub account)
50+
* **origin** - Your fork of the official repository on GitHub (what is on your GitHub account)
51+
* **local** - This will be your local clone of **origin** (what is on your computer)
52+
53+
As a **contributor** you will push your completed **local** topic branch to **origin**. As a **contributor** you will pull your updates from **upstream**. Assuming the change is accepted, a **collaborator** will merge branches from a **contributor** into **upstream**.
54+
55+
## Primary branches
56+
57+
The upstream repository has two branches:
58+
59+
* **upstream/master** - Stable releases
60+
* **upstream/develop** - where development work happens
61+
62+
From time to time, when **develop** is stable, everything on **develop** gets merged into **master**, and that becomes the new stable version.
63+
64+
## Topic branches
65+
66+
Topic branches are for contributors to develop bug fixes and new features so that they can be easily merged to **develop**. They must follow a few simple rules for consistency:
67+
68+
* Must branch off from **develop**
69+
* Must be merged back into **develop**
70+
* Ideally, should have the GitHub issue number in the branch name
71+
72+
Topic branches should exist in your **local** and **origin** repositories only. Submitting a pull request will request a merge from your topic branch to the **upstream/develop** branch.
73+
74+
## Working on topic branches
75+
76+
First create a new branch for the work you'd like to perform. When naming your branch, please use the following convention: `bug-<issue#>-<description>` or `feature-<issue#>-<description>`:
77+
78+
```bash
79+
$ git checkout -b bug-123-short-issue-description
80+
Switched to a new branch 'bug-123-short-issue-description'
81+
```
82+
83+
Now perform some work and commit changes. Always review your changes before committing
84+
85+
```bash
86+
$ git status
87+
$ git diff
88+
$ git add --all
89+
$ git commit
90+
```
91+
92+
You can push your changes to your fork's develop branch using:
93+
94+
```bash
95+
$ git push origin develop
96+
```
97+
98+
When committing, be sure to follow [best practices](https://github.com/erlang/otp/wiki/Writing-good-commit-messages) writing good commit descriptions.
99+
100+
After performing some work you'll want to merge in changes (if any) from the **upstream/develop**. You can use the following two commands in order to assist upstream merging:
101+
102+
```bash
103+
$ git fetch upstream
104+
$ git merge upstream/develop bug-123-short-issue-description
105+
```
106+
107+
The `git fetch upstream` command will download the **upstream** repository to your computer but not merge it. The `merge upstream/develop bug-123-short-issue-description` command will [merge](https://www.atlassian.com/git/tutorials/using-branches/git-merge) your changes on top of **upstream/develop**. This will make the review process easier for **collaborators**.
108+
109+
If you need to merge changes in after pushing your branch to **origin**, use the following:
110+
111+
```bash
112+
$ git pull upstream/develop
113+
```
114+
115+
When topic branches are finished and ready for review, they should be pushed back to **origin**.
116+
117+
```bash
118+
$ git push origin bug-123-short-issue-description
119+
To git@github.com:username/pysystemtrade.git
120+
* [new branch] bug-123-short-issue-description -> bug-123-short-issue-description
121+
```
122+
123+
Now you're ready to send a [pull request](https://help.github.com/articles/using-pull-requests/) from this branch to **upstream/develop** and update the GitHub issue tracker to let a collaborator know that your branch is ready to be reviewed and merged. If extra changes are required as part of the review process, make those changes on the topic branch and re-push. First re-checkout the topic branch you made your original changes on:
124+
125+
```bash
126+
$ git checkout bug-123-short-issue-description
127+
```
128+
129+
Now make responses to the review comments, commit, and re-push your changes:
130+
131+
```bash
132+
$ git add --all
133+
$ git commit
134+
$ git push
135+
```
3136

4137
## Unit tests
5-
This project has a few unit tests. They get run automatically when any PR is
6-
submitted. You'll see the result of the run in the PR page. To run the tests
7-
yourself locally, before submitting, you'll need `pytest` installed. Then run:
138+
This project has a few unit tests. They get run automatically when any PR is submitted. You'll see the result of the run in the PR page. To run the tests yourself locally, before submitting, you'll need `pytest` installed. Then run:
8139
```
9140
pytest
10141
```
@@ -19,38 +150,34 @@ To run all the tests except one module, use the `--ignore` flag
19150
pytest --ignore=sysinit/futures/tests/test_sysinit_futures.py
20151
```
21152

22-
Some tests are marked as `@pytest.mark.slow` because they take a long time. These
23-
run automatically every evening. If you want to run them locally, pass
24-
the `--runslow` flag
153+
Some tests are marked as `@pytest.mark.slow` because they take a long time. These run automatically every evening. If you want to run them locally, pass the `--runslow` flag
25154
```
26155
pytest --runslow
27156
```
28157

29158

30159
## Lint / Black
31160

32-
This project keeps its code pretty with
33-
[Black](https://black.readthedocs.io/en/stable/). Black gets automatically run
34-
over any PRs, and the PR won't be merged if it fails. To clean your code
35-
submission manually you'll need Black installed, instructions
36-
[here](https://black.readthedocs.io/en/stable/getting_started.html). Then
37-
run:
161+
This project keeps its code pretty with [Black](https://black.readthedocs.io/en/stable/). Black gets automatically run over any PRs, and the PR won't be merged if it fails. To clean your code submission manually you'll need Black installed, instructions [here](https://black.readthedocs.io/en/stable/getting_started.html). Then run:
162+
```
163+
black .
164+
```
165+
166+
If you have a virtual environment (venv), you will want to tell Black to ignore that. So if your venv is named `.venv`, the command would be:
167+
38168
```
39-
black path/to/module.py
169+
black . --exclude '/.venv\/.+/'
40170
```
41171

42-
Or, get your IDE or editor to automatically re-format files as you save. Configuration
43-
instructions [here](https://black.readthedocs.io/en/stable/integrations/editors.html)
172+
Or, get your IDE or editor to automatically re-format files as you save. Configuration instructions [here](https://black.readthedocs.io/en/stable/integrations/editors.html)
44173

45174
Note for pycharm users: The blackd plugin requires a blackd daemon to be running; add it to your crontab.
46175

47-
Or, configure your local git install to automatically check and fix your code
48-
as you commit. Configuration instructions
49-
[here](https://black.readthedocs.io/en/stable/integrations/source_version_control.html)
176+
Or, configure your local git install to automatically check and fix your code as you commit. Configuration instructions [here](https://black.readthedocs.io/en/stable/integrations/source_version_control.html)
50177

51178
### Black version
52179

53-
Black needs to be consistent between the version running in the CI build and your local environment. To check the currently used version, see the `[tool.black]` section of the project TOML file (https://github.com/robcarver17/pysystemtrade/blob/master/pyproject.toml)
180+
Black needs to be consistent between the version running in the CI build and your local environment. To check the currently used version, see the `[tool.black]` section of the project [TOML file](https://github.com/robcarver17/pysystemtrade/blob/develop/pyproject.toml)
54181

55182
## General code guidelines (INCOMPLETE)
56183

@@ -75,7 +202,7 @@ In general, we try and follow the original texts: [PEP 8](https://peps.python.or
75202

76203
### Error handling
77204

78-
- Production code should not throw an error unless things are completely unrecoverable; if it does throw an error it must also log.critical which will email the user
205+
- Production code should not throw an error unless things are completely unrecoverable; if it does throw an error it must also `log.critical()` which will email the user (with the default production log config)
79206

80207

81208
### Caching
@@ -85,7 +212,6 @@ FIXME This is a bit of a mess - Update when a unified cache system setup
85212

86213
### Testing
87214

88-
Doc tests should be removed from class methods, since they often require a lot of setup, and make the code harder to read. Unit tests are preferable.
89-
Doc tests make more sense for seperate, standalone, functions. This is especially the case when they can be used to quickly demonstrate how a function works.
215+
Doc tests should be removed from class methods, since they often require a lot of setup, and make the code harder to read. Unit tests are preferable. Doc tests make more sense for separate, standalone, functions. This is especially the case when they can be used to quickly demonstrate how a function works.
90216

91217
Test coverage is extremely sparse.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Rob Carver
77
[https://qoppac.blogspot.com/p/pysystemtrade.html](https://qoppac.blogspot.com/p/pysystemtrade.html)
88

99

10-
Version 1.80
10+
Version 1.8.1
1111

1212

13-
2023-11-22
13+
2024-11-06
1414

1515

1616

0 commit comments

Comments
 (0)