qc 0.5.5 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dea97901bebb4832afd9b48ada22bf143b50097a
4
- data.tar.gz: 4c662e04cbdb1b9bcf1df2cd3e18c948d36a641a
3
+ metadata.gz: ff30871c8e3cbbc76ca56e8486a54f1ecc6641b1
4
+ data.tar.gz: 6d537c573492c6d28283fdfdf781ef2e85b099e1
5
5
  SHA512:
6
- metadata.gz: be36dc53267171228371e9ea8f8e642df8b7313551316761feaa5ce1d2ce411a9d395fcefa3f84af078828e6fedc8ef86e1f73dadf23e5bb2a81aadd57919bef
7
- data.tar.gz: de7c763cb46ead17484db8a3d0676b742c65afc7ffcd040b2009274950866e1f5bd37080fe47fba9127dab07f451efeafe671c0eb3c1ea566ca0ac1db23df434
6
+ metadata.gz: 7520488335e8ed3ebb1dd726c2721d4f5426b103c419d9e18ff15bb87711a3445dc2bc69de3f67ba09ec0739b70618c68aa935996eb9f9777cd34533e0821d0f
7
+ data.tar.gz: 62cd3d02352a350b0258fcd335caa094cf21da8a92295c2b7cacdfcc33511b0eb50e080caeed35587270c4c336efd1de8877e5ecfd451017e59c33aed0dcb1c7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qc (0.5.5)
4
+ qc (0.5.6)
5
5
  rest-client (~> 2.0.2)
6
6
  vcr (~> 3.0.3)
7
7
  webmock (~> 3.1.0)
data/README.md CHANGED
@@ -47,10 +47,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
47
47
 
48
48
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
49
49
 
50
- ## Contributing
51
-
52
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/qc.
53
-
54
50
  ## License
55
51
 
56
52
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -10,5 +10,9 @@ module Qc
10
10
  def progress_in_percentage
11
11
  progress * 100
12
12
  end
13
+
14
+ def started?
15
+ progress > 0
16
+ end
13
17
  end
14
18
  end
@@ -4,7 +4,7 @@ module Qc
4
4
 
5
5
  SUPPORTED_COMMANDS =%i(login logout init push compile backtest)
6
6
  COMPILE_POLLING_DELAY_IN_SECONDS = 2
7
- BACKTEST_DELAY_IN_SECONDS = 2
7
+ BACKTEST_DELAY_IN_SECONDS = 3
8
8
 
9
9
  attr_reader :quant_connect_proxy
10
10
  attr_accessor :project_settings
@@ -102,6 +102,8 @@ module Qc
102
102
  end
103
103
 
104
104
  def run_push
105
+ show_title('Push files')
106
+
105
107
  return false unless validate_initialized_project!
106
108
 
107
109
  sync_changed_files
@@ -110,6 +112,7 @@ module Qc
110
112
  end
111
113
 
112
114
  def run_compile
115
+ show_title('Compile')
113
116
  return false unless validate_initialized_project!
114
117
 
115
118
  compile = quant_connect_proxy.create_compile project_settings.project_id
@@ -131,6 +134,7 @@ module Qc
131
134
  end
132
135
 
133
136
  def run_backtest
137
+ show_title('Run backtest')
134
138
  return false unless validate_initialized_project!
135
139
 
136
140
  unless project_settings.last_compile_id
@@ -151,12 +155,23 @@ module Qc
151
155
  !failed
152
156
  end
153
157
 
158
+ def show_title(title)
159
+ separator = '-' * title.length
160
+ puts "\n#{separator}"
161
+ puts title
162
+ puts "#{separator}\n"
163
+ end
164
+
154
165
  def do_run_backtest
155
166
  backtest = quant_connect_proxy.create_backtest project_settings.project_id, project_settings.last_compile_id, "backtest-#{project_settings.last_compile_id}"
156
167
  puts "Backtest for compile #{project_settings.last_compile_id} sent to the queue with id #{backtest.id}"
157
168
 
158
169
  begin
159
- puts "Waiting for backtest to finish (#{backtest.progress_in_percentage}\% completed)..."
170
+ if backtest.started?
171
+ puts "Waiting for backtest to finish (#{backtest.progress_in_percentage}\% completed)..."
172
+ else
173
+ puts "Waiting for backtest to start..."
174
+ end
160
175
  backtest = quant_connect_proxy.read_backtest project_settings.project_id, backtest.id
161
176
  sleep BACKTEST_DELAY_IN_SECONDS if backtest.completed?
162
177
  end while !backtest.completed?
@@ -213,8 +228,12 @@ module Qc
213
228
 
214
229
 
215
230
  def sync_changed_files
231
+ if changed_files.empty?
232
+ puts "No changes detected"
233
+ end
234
+
216
235
  changed_files.each do |file|
217
- puts "uploading #{file}..."
236
+ puts "Uploading #{file}..."
218
237
  content = ::File.read file
219
238
  quant_connect_proxy.put_file project_settings.project_id, file, content
220
239
  end
@@ -1,3 +1,3 @@
1
1
  module Qc
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jorge Manrubia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-12 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client