cotcube-level 0.3.4 → 0.3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/cotcube-level/intraday_stencil.rb +17 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71bc6b4ca29ab4ff089b95568a0d592d4bc2b3d8c1824ea9158d661792f1c5b7
|
4
|
+
data.tar.gz: 670d5a69457411fc7539542a1bd0ad1712ef9111f7b5a876b3c7bdd5d6de90c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3221bf00e3532ae51f62d98f191332273a2241ae34f0eff99e9840f28f41e339a816d23d100150aca70719855c6a1d0507f6509f2598cad75c880f86089286b3
|
7
|
+
data.tar.gz: 652072c05872418b438ca7ac937e3e5735a5967804c0d0e8f75b4e5381553b55e8b64ecf769cb820745650717077eae1ac7b0b844325725a1c0c78b6b2fbbf85
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 0.3.4.1 (October 09, 2021)
|
2
|
+
- intraday_stencil: fixing @index, that did not work when used outside active hours
|
3
|
+
|
1
4
|
## 0.3.4 (October 06, 2021)
|
2
5
|
- intraday_stencil: major rework resp. rebuild ... now beta-ready
|
3
6
|
- helpers: preparing puts_swap and get_jsonl_name to work intraday
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.4
|
1
|
+
0.3.4.1
|
@@ -39,17 +39,17 @@ module Cotcube
|
|
39
39
|
stencil: nil, # instead of preparing, use this one if set
|
40
40
|
warnings: true # be more quiet
|
41
41
|
)
|
42
|
-
@shiftset
|
43
|
-
@timezone
|
44
|
-
@debug
|
45
|
-
@interval
|
46
|
-
@swap_type
|
47
|
-
@warnings
|
48
|
-
datetime
|
49
|
-
datetime
|
50
|
-
@datetime
|
51
|
-
@datetime
|
52
|
-
@datetime
|
42
|
+
@shiftset = Intraday_Stencil.shiftset(asset: asset)
|
43
|
+
@timezone = Cotcube::Level::TIMEZONES[@shiftset[:tz]]
|
44
|
+
@debug = debug
|
45
|
+
@interval = interval
|
46
|
+
@swap_type = swap_type
|
47
|
+
@warnings = warnings
|
48
|
+
datetime ||= DateTime.now
|
49
|
+
datetime = @timezone.at(datetime.to_i) unless datetime.is_a? ActiveSupport::TimeWithZone
|
50
|
+
@datetime = datetime.beginning_of_day
|
51
|
+
@datetime += interval while @datetime <= datetime - interval
|
52
|
+
@datetime -= interval
|
53
53
|
|
54
54
|
const = "RAW_INTRA_STENCIL_#{@shiftset[:nr]}_#{interval.in_minutes.to_i}".to_sym
|
55
55
|
if Object.const_defined? const
|
@@ -120,22 +120,22 @@ module Cotcube
|
|
120
120
|
@base.select!{|x| %i[ pre rth post ].include?(x[:type]) }
|
121
121
|
when :rth
|
122
122
|
@base.select!{|x| x[:type] == :rth }
|
123
|
-
# to.map{ |x| [:high, :low, :volume].map{|z| x[z] = nil} if x[:block] }
|
124
123
|
when :flow
|
125
|
-
@base.reject!{|x| %i[
|
124
|
+
@base.reject!{|x| %i[ sow eow mpost mpost ].include?(x[:type]) }
|
126
125
|
@base.
|
127
126
|
map{ |x|
|
128
127
|
[:high, :low, :volume].map{|z| x[z] = nil} unless x[:type] == :rth
|
129
|
-
# [:high, :low, :volume].map{|z| x[z] = nil} if x[:block]
|
130
128
|
}
|
131
129
|
when :run
|
132
|
-
@base.select!{|x| %i[
|
130
|
+
@base.select!{|x| %i[ pre rth post ].include? x[:type]}
|
133
131
|
else
|
134
|
-
raise ArgumentError, "Unknown stencil/swap type '#{
|
132
|
+
raise ArgumentError, "Unknown stencil/swap type '#{swap_type}'"
|
135
133
|
end
|
136
134
|
@base.map!{|z| z.dup}
|
137
135
|
|
138
|
-
|
136
|
+
# zero is, were either x[:datetime] == @datetime (when we are intraday)
|
137
|
+
# or otherwise {x[:datetime] <= @datetime}.last (when on maintenance)
|
138
|
+
@index = @base.index{|x| x == @base.select{|y| y[:datetime] <= @datetime }.last }
|
139
139
|
@index -= 1 while %i[sow sod mpre mpost eod eow].include? @base[@index][:type]
|
140
140
|
@datetime = @base[@index][:datetime]
|
141
141
|
@zero = @base[@index]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cotcube-level
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.4
|
4
|
+
version: 0.3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin L. Tischendorf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|