toji 2.6.0 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/example_core.rb +3 -2
- data/example/{shubo.rb → moto.rb} +2 -2
- data/example/{shubo.yaml → moto.yaml} +0 -0
- data/lib/toji/brew.rb +1 -1
- data/lib/toji/brew/{shubo.rb → moto.rb} +1 -1
- data/lib/toji/calendar.rb +2 -2
- data/lib/toji/calendar/date_column.rb +4 -4
- data/lib/toji/product.rb +22 -34
- data/lib/toji/product/action_event.rb +13 -0
- data/lib/toji/product/event.rb +2 -38
- data/lib/toji/product/event_factory.rb +86 -0
- data/lib/toji/product/rice_event.rb +27 -0
- data/lib/toji/product/rice_event_group.rb +20 -0
- data/lib/toji/recipe.rb +19 -5
- data/lib/toji/recipe/action.rb +8 -0
- data/lib/toji/version.rb +1 -1
- metadata +11 -7
- data/example/shubo.ipynb +0 -121
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 706d23865cd25f83d8ef3fdaf68ee9caf3e3e4654073e008dd8042ac7788ad41
|
4
|
+
data.tar.gz: f8e7be6bea2d1b077ebabddd4ae759be33bd7dc70d18338054c20ab557f544aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b7ba7232869e9e9e570199976bfe6a30e38b1ee07a186f75535f3436272efbad584b82e6dee4e06a49d1b646e5059090d54322f92d3704a74de8c1e93eea40d
|
7
|
+
data.tar.gz: 1618a172204ce57437e1a9ccbe9a14dbc3fa0bd5617c8f7f7b6629fa1ee75cd5c544f2eef57bc5f9dbdd10896440ef6fb431af5834b12a84eb0f08454b4e7cb7
|
data/example/example_core.rb
CHANGED
@@ -56,8 +56,8 @@ module Example
|
|
56
56
|
include Toji::Brew::Koji
|
57
57
|
end
|
58
58
|
|
59
|
-
class
|
60
|
-
include Toji::Brew::
|
59
|
+
class Moto < Base
|
60
|
+
include Toji::Brew::Moto
|
61
61
|
end
|
62
62
|
|
63
63
|
class Moromi < Base
|
@@ -68,6 +68,7 @@ module Example
|
|
68
68
|
|
69
69
|
class Step
|
70
70
|
include Toji::Recipe::Step
|
71
|
+
attr_accessor :name
|
71
72
|
|
72
73
|
def self.create(name:, kake: 0, koji: 0, water: 0, lactic_acid: 0, alcohol: 0, yeast: 0, koji_interval_days: 0, kake_interval_days: 0)
|
73
74
|
new.tap {|o|
|
@@ -2,12 +2,12 @@ require 'toji'
|
|
2
2
|
require_relative 'example_core'
|
3
3
|
require 'terminal-table'
|
4
4
|
|
5
|
-
|
5
|
+
moto = Example::Brew::Moto.load_yaml_file(File.dirname(__FILE__)+"/moto.yaml")
|
6
6
|
|
7
7
|
table = Terminal::Table.new do |t|
|
8
8
|
t << ["作業", "日数", "品温(度)", "ボーメ", "酸度", "経過時間", "日時"]
|
9
9
|
t << :separator
|
10
|
-
|
10
|
+
moto.wrapped_states.each {|s|
|
11
11
|
temp = s.temps.map(&:to_s).join(" / ")
|
12
12
|
t << [s.mark, s.day_label, temp, s.baume, s.acid, s.elapsed_time, s.display_time]
|
13
13
|
}
|
File without changes
|
data/lib/toji/brew.rb
CHANGED
data/lib/toji/calendar.rb
CHANGED
@@ -16,7 +16,7 @@ module Toji
|
|
16
16
|
alias_method :add, :<<
|
17
17
|
|
18
18
|
def date_rows
|
19
|
-
events = @products.map{|product| product.
|
19
|
+
events = @products.map{|product| product.rice_events}.flatten
|
20
20
|
|
21
21
|
result = {}
|
22
22
|
events.each {|event|
|
@@ -28,7 +28,7 @@ module Toji
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def table_data
|
31
|
-
events = @products.map{|product| product.
|
31
|
+
events = @products.map{|product| product.rice_events}.flatten
|
32
32
|
|
33
33
|
koji_len = events.select{|e| e.type==:koji}.map(&:group_index).max + 1
|
34
34
|
kake_len = events.select{|e| e.type==:kake}.map(&:group_index).max + 1
|
@@ -1,19 +1,19 @@
|
|
1
1
|
module Toji
|
2
2
|
class Calendar
|
3
3
|
class DateColumn
|
4
|
-
attr_reader :
|
4
|
+
attr_reader :rice_events
|
5
5
|
|
6
6
|
def initialize
|
7
|
-
@
|
7
|
+
@rice_events = []
|
8
8
|
end
|
9
9
|
|
10
10
|
def <<(event)
|
11
|
-
@
|
11
|
+
@rice_events << event
|
12
12
|
end
|
13
13
|
alias_method :add, :<<
|
14
14
|
|
15
15
|
def event_groups
|
16
|
-
@
|
16
|
+
@rice_events.group_by {|e|
|
17
17
|
e.group_key
|
18
18
|
}.values
|
19
19
|
end
|
data/lib/toji/product.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
require 'toji/product/event'
|
2
|
+
require 'toji/product/rice_event'
|
3
|
+
require 'toji/product/rice_event_group'
|
4
|
+
require 'toji/product/action_event'
|
5
|
+
require 'toji/product/event_factory'
|
2
6
|
|
3
7
|
module Toji
|
4
8
|
module Product
|
@@ -7,6 +11,12 @@ module Toji
|
|
7
11
|
attr_accessor :recipe
|
8
12
|
attr_accessor :base_date
|
9
13
|
|
14
|
+
attr_accessor :koji_events
|
15
|
+
attr_accessor :kake_events
|
16
|
+
attr_accessor :koji_event_groups
|
17
|
+
attr_accessor :kake_event_groups
|
18
|
+
attr_accessor :action_events
|
19
|
+
|
10
20
|
def koji_dates
|
11
21
|
date = base_date
|
12
22
|
recipe.steps.map {|step|
|
@@ -21,45 +31,23 @@ module Toji
|
|
21
31
|
}
|
22
32
|
end
|
23
33
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
events << Event.new(self, :koji, i)
|
34
|
+
def action_dates
|
35
|
+
date = base_date
|
36
|
+
recipe.actions.map {|action|
|
37
|
+
date = date.next_day(action.interval_days)
|
29
38
|
}
|
39
|
+
end
|
30
40
|
|
31
|
-
|
32
|
-
|
33
|
-
Event.new(self, :kake, i)
|
34
|
-
}
|
35
|
-
.delete_if {|e|
|
36
|
-
4<=e.index && e.weight==0
|
37
|
-
}
|
38
|
-
.each {|e|
|
39
|
-
events << e
|
40
|
-
}
|
41
|
-
|
42
|
-
events
|
41
|
+
def rice_events
|
42
|
+
koji_events + kake_events
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
46
|
-
|
47
|
-
|
48
|
-
}.map {|group_key,events|
|
49
|
-
breakdown = events.map {|event|
|
50
|
-
{index: event.index, weight: event.weight}
|
51
|
-
}
|
52
|
-
if 1<breakdown.length
|
53
|
-
breakdown = breakdown.select{|event| 0<event[:weight]}
|
54
|
-
end
|
45
|
+
def rice_event_groups
|
46
|
+
koji_event_groups + kake_event_groups
|
47
|
+
end
|
55
48
|
|
56
|
-
|
57
|
-
|
58
|
-
type: events.first.type,
|
59
|
-
weight: events.map(&:weight).sum,
|
60
|
-
breakdown: breakdown,
|
61
|
-
}
|
62
|
-
}
|
49
|
+
def events
|
50
|
+
rice_event_groups + action_events
|
63
51
|
end
|
64
52
|
end
|
65
53
|
end
|
data/lib/toji/product/event.rb
CHANGED
@@ -1,44 +1,8 @@
|
|
1
1
|
module Toji
|
2
2
|
module Product
|
3
|
-
|
4
|
-
attr_reader :
|
3
|
+
module Event
|
4
|
+
attr_reader :date
|
5
5
|
attr_reader :type
|
6
|
-
attr_reader :index
|
7
|
-
|
8
|
-
def initialize(product, type, index)
|
9
|
-
@product = product
|
10
|
-
@type = type
|
11
|
-
@index = index
|
12
|
-
end
|
13
|
-
|
14
|
-
def date
|
15
|
-
method = "#{@type}_dates".to_sym
|
16
|
-
@product.send(method)[@index]
|
17
|
-
end
|
18
|
-
|
19
|
-
def group_index
|
20
|
-
method = "#{@type}_dates".to_sym
|
21
|
-
dates = @product.send(method)
|
22
|
-
date = dates[@index]
|
23
|
-
|
24
|
-
if @type==:koji && dates.all? {|d| d==date}
|
25
|
-
1
|
26
|
-
else
|
27
|
-
dates.index(date)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def group_key
|
32
|
-
a = []
|
33
|
-
a << product.reduce_key
|
34
|
-
a << type
|
35
|
-
a << group_index
|
36
|
-
a.map(&:to_s).join(":")
|
37
|
-
end
|
38
|
-
|
39
|
-
def weight
|
40
|
-
@product.recipe.steps[@index].send(@type)
|
41
|
-
end
|
42
6
|
end
|
43
7
|
end
|
44
8
|
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
module Toji
|
2
|
+
module Product
|
3
|
+
module EventFactory
|
4
|
+
|
5
|
+
def create_rice_event(product:, date:, rice_type:, index:, group_index:, weight:)
|
6
|
+
raise Error, "implement required: create_rice_event"
|
7
|
+
end
|
8
|
+
|
9
|
+
def create_rice_event_group(date:, rice_type:, breakdown:)
|
10
|
+
raise Error, "implement required: create_rice_event_group"
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_action_event(product:, date:, type:, index:)
|
14
|
+
raise Error, "implement required: create_action_event"
|
15
|
+
end
|
16
|
+
|
17
|
+
def koji_events
|
18
|
+
koji_dates.map.with_index {|date,i|
|
19
|
+
create_rice_event(
|
20
|
+
product: self,
|
21
|
+
rice_type: :koji,
|
22
|
+
index: i,
|
23
|
+
group_index: koji_dates.find_index(date),
|
24
|
+
date: date,
|
25
|
+
weight: recipe.steps[i].koji,
|
26
|
+
)
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
def kake_events
|
31
|
+
kake_dates.map.with_index {|date,i|
|
32
|
+
create_rice_event(
|
33
|
+
product: self,
|
34
|
+
rice_type: :kake,
|
35
|
+
index: i,
|
36
|
+
group_index: kake_dates.find_index(date),
|
37
|
+
date: date,
|
38
|
+
weight: recipe.steps[i].kake,
|
39
|
+
)
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
def koji_event_groups
|
44
|
+
koji_events.select{|event|
|
45
|
+
0<event.weight
|
46
|
+
}.group_by{|event|
|
47
|
+
event.group_key
|
48
|
+
}.map {|group_key,events|
|
49
|
+
event = events.first
|
50
|
+
create_rice_event_group(
|
51
|
+
date: event.date,
|
52
|
+
rice_type: event.rice_type,
|
53
|
+
breakdown: events,
|
54
|
+
)
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
58
|
+
def kake_event_groups
|
59
|
+
kake_events.select{|event|
|
60
|
+
0<event.weight
|
61
|
+
}.group_by{|event|
|
62
|
+
event.group_key
|
63
|
+
}.map {|group_key,events|
|
64
|
+
event = events.first
|
65
|
+
create_rice_event_group(
|
66
|
+
date: event.date,
|
67
|
+
rice_type: event.rice_type,
|
68
|
+
breakdown: events,
|
69
|
+
)
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
def action_events
|
74
|
+
action_dates.map.with_index {|date,i|
|
75
|
+
action = recipe.actions[i]
|
76
|
+
create_action_event(
|
77
|
+
product: self,
|
78
|
+
date: date,
|
79
|
+
type: recipe.actions[i].type,
|
80
|
+
index: i,
|
81
|
+
)
|
82
|
+
}
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'toji/product/event'
|
2
|
+
|
3
|
+
module Toji
|
4
|
+
module Product
|
5
|
+
module RiceEvent
|
6
|
+
include Event
|
7
|
+
|
8
|
+
attr_reader :product
|
9
|
+
attr_reader :rice_type
|
10
|
+
attr_reader :index
|
11
|
+
attr_reader :group_index
|
12
|
+
attr_reader :weight
|
13
|
+
|
14
|
+
def type
|
15
|
+
:rice
|
16
|
+
end
|
17
|
+
|
18
|
+
def group_key
|
19
|
+
a = []
|
20
|
+
a << product.reduce_key
|
21
|
+
a << rice_type
|
22
|
+
a << group_index
|
23
|
+
a.map(&:to_s).join(":")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'toji/product/event'
|
2
|
+
|
3
|
+
module Toji
|
4
|
+
module Product
|
5
|
+
module RiceEventGroup
|
6
|
+
include Event
|
7
|
+
|
8
|
+
attr_reader :rice_type
|
9
|
+
attr_reader :breakdown
|
10
|
+
|
11
|
+
def type
|
12
|
+
:rice
|
13
|
+
end
|
14
|
+
|
15
|
+
def weight
|
16
|
+
breakdown.map(&:weight).sum
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/toji/recipe.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
require 'toji/recipe/step'
|
2
|
+
require 'toji/recipe/action'
|
2
3
|
require 'toji/recipe/ab_expect'
|
3
4
|
|
4
5
|
module Toji
|
5
6
|
module Recipe
|
6
7
|
attr_accessor :steps
|
8
|
+
attr_accessor :actions
|
9
|
+
attr_accessor :has_moto
|
10
|
+
attr_accessor :has_moromi
|
7
11
|
attr_accessor :ab_coef
|
8
12
|
attr_accessor :ab_expects
|
9
13
|
|
@@ -15,6 +19,11 @@ module Toji
|
|
15
19
|
|
16
20
|
self.class.new.tap {|o|
|
17
21
|
o.steps = new_steps
|
22
|
+
o.actions = actions.deep_dup
|
23
|
+
o.has_moto = has_moto
|
24
|
+
o.has_moromi = has_moromi
|
25
|
+
o.ab_coef = ab_coef
|
26
|
+
o.ab_expects = ab_expects.deep_dup
|
18
27
|
}
|
19
28
|
end
|
20
29
|
|
@@ -25,6 +34,11 @@ module Toji
|
|
25
34
|
|
26
35
|
self.class.new.tap {|o|
|
27
36
|
o.steps = new_steps
|
37
|
+
o.actions = actions.deep_dup
|
38
|
+
o.has_moto = has_moto
|
39
|
+
o.has_moromi = has_moromi
|
40
|
+
o.ab_coef = ab_coef
|
41
|
+
o.ab_expects = ab_expects.deep_dup
|
28
42
|
}
|
29
43
|
end
|
30
44
|
|
@@ -38,12 +52,12 @@ module Toji
|
|
38
52
|
end
|
39
53
|
|
40
54
|
# 酒母歩合の累計
|
41
|
-
def
|
55
|
+
def cumulative_moto_rates
|
42
56
|
rice_total = steps.map(&:rice_total)
|
43
|
-
|
57
|
+
moto = rice_total.first
|
44
58
|
|
45
59
|
rice_total.map.with_index {|x,i|
|
46
|
-
|
60
|
+
moto / rice_total[0..i].inject(&:+)
|
47
61
|
}
|
48
62
|
end
|
49
63
|
|
@@ -53,8 +67,8 @@ module Toji
|
|
53
67
|
# 汲水歩合が大きい高温糖化酒母では6%程度である
|
54
68
|
#
|
55
69
|
# 出典: 酒造教本 P96
|
56
|
-
def
|
57
|
-
|
70
|
+
def moto_rate
|
71
|
+
cumulative_moto_rates.last || 0.0
|
58
72
|
end
|
59
73
|
|
60
74
|
# 白米比率
|
data/lib/toji/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshida Tetsuya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -122,10 +122,9 @@ files:
|
|
122
122
|
- example/moromi.ipynb
|
123
123
|
- example/moromi.rb
|
124
124
|
- example/moromi.yaml
|
125
|
+
- example/moto.rb
|
126
|
+
- example/moto.yaml
|
125
127
|
- example/recipe.rb
|
126
|
-
- example/shubo.ipynb
|
127
|
-
- example/shubo.rb
|
128
|
-
- example/shubo.yaml
|
129
128
|
- lib/toji.rb
|
130
129
|
- lib/toji/brew.rb
|
131
130
|
- lib/toji/brew/base.rb
|
@@ -137,7 +136,7 @@ files:
|
|
137
136
|
- lib/toji/brew/graph/progress.rb
|
138
137
|
- lib/toji/brew/koji.rb
|
139
138
|
- lib/toji/brew/moromi.rb
|
140
|
-
- lib/toji/brew/
|
139
|
+
- lib/toji/brew/moto.rb
|
141
140
|
- lib/toji/brew/state.rb
|
142
141
|
- lib/toji/brew/wrapped_state.rb
|
143
142
|
- lib/toji/calendar.rb
|
@@ -161,9 +160,14 @@ files:
|
|
161
160
|
- lib/toji/ingredient/rice/expected_steamable.rb
|
162
161
|
- lib/toji/ingredient/rice_rate.rb
|
163
162
|
- lib/toji/product.rb
|
163
|
+
- lib/toji/product/action_event.rb
|
164
164
|
- lib/toji/product/event.rb
|
165
|
+
- lib/toji/product/event_factory.rb
|
166
|
+
- lib/toji/product/rice_event.rb
|
167
|
+
- lib/toji/product/rice_event_group.rb
|
165
168
|
- lib/toji/recipe.rb
|
166
169
|
- lib/toji/recipe/ab_expect.rb
|
170
|
+
- lib/toji/recipe/action.rb
|
167
171
|
- lib/toji/recipe/step.rb
|
168
172
|
- lib/toji/version.rb
|
169
173
|
- toji.gemspec
|
@@ -189,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
193
|
- !ruby/object:Gem::Version
|
190
194
|
version: '0'
|
191
195
|
requirements: []
|
192
|
-
rubygems_version: 3.
|
196
|
+
rubygems_version: 3.1.2
|
193
197
|
signing_key:
|
194
198
|
specification_version: 4
|
195
199
|
summary: Management tools for brewing japanese sake.
|
data/example/shubo.ipynb
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": 1,
|
6
|
-
"metadata": {},
|
7
|
-
"outputs": [
|
8
|
-
{
|
9
|
-
"data": {
|
10
|
-
"text/html": [
|
11
|
-
"\n",
|
12
|
-
" <script>\n",
|
13
|
-
" requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
|
14
|
-
" </script>\n",
|
15
|
-
"\n",
|
16
|
-
"\n",
|
17
|
-
"<div id=\"105867eb-e572-490c-8509-e506179e76ad\" style=\"height: 100%; width: 100%;\"></div>\n",
|
18
|
-
"\n",
|
19
|
-
"<script>\n",
|
20
|
-
" require(['plotly'], function(Plotly) { \n",
|
21
|
-
"Plotly.newPlot(\n",
|
22
|
-
" '105867eb-e572-490c-8509-e506179e76ad',\n",
|
23
|
-
" [{\"x\":[0.0,3600.0,86400.0,172800.0,172801.0,259200.0,259201.0,345600.0,345601.0,432000.0,518400.0,604800.0,691200.0,777600.0,864000.0,950400.0,1036800.0,1123200.0],\"y\":[12.0,20.0,14.0,8.0,11.0,10.0,13.0,12.0,15.0,14.0,20.0,20.0,20.0,20.0,15.0,12.0,10.0,9.0],\"text\":[\"01/16 00:00\",\"01/16 01:00\",\"01/17 00:00\",\"01/18 00:00\",\"01/18 00:00\",\"01/19 00:00\",\"01/19 00:00\",\"01/20 00:00\",\"01/20 00:00\",\"01/21 00:00\",\"01/22 00:00\",\"01/23 00:00\",\"01/24 00:00\",\"01/25 00:00\",\"01/26 00:00\",\"01/27 00:00\",\"01/28 00:00\",\"01/29 00:00\"],\"name\":\"temps\",\"line\":{\"dash\":\"solid\",\"shape\":\"linear\"},\"marker\":{\"color\":\"#1f77b4\"}},{\"x\":[86400.0,172800.0,259200.0,345600.0,432000.0,518400.0,604800.0,691200.0,777600.0,864000.0,950400.0,1036800.0,1123200.0],\"y\":[15.0,16.0,16.5,17.0,17.0,17.0,14.0,12.0,9.0,8.0,7.0,6.0,5.0],\"text\":[\"01/17 00:00\",\"01/18 00:00\",\"01/19 00:00\",\"01/20 00:00\",\"01/21 00:00\",\"01/22 00:00\",\"01/23 00:00\",\"01/24 00:00\",\"01/25 00:00\",\"01/26 00:00\",\"01/27 00:00\",\"01/28 00:00\",\"01/29 00:00\"],\"name\":\"baume\",\"line\":{\"dash\":\"solid\",\"shape\":\"linear\"},\"marker\":{\"color\":\"#9467bd\"}},{\"x\":[0.0,3600.0,86400.0,172800.0,259200.0,345600.0,432000.0,518400.0,604800.0,691200.0,777600.0,864000.0,950400.0,1036800.0,1123200.0],\"y\":[13.0,13.0,13.0,13.0,13.5,13.5,14.0,14.5,15.5,16.0,16.0,16.5,17.0,17.5,17.5],\"text\":[\"01/16 00:00\",\"01/16 01:00\",\"01/17 00:00\",\"01/18 00:00\",\"01/19 00:00\",\"01/20 00:00\",\"01/21 00:00\",\"01/22 00:00\",\"01/23 00:00\",\"01/24 00:00\",\"01/25 00:00\",\"01/26 00:00\",\"01/27 00:00\",\"01/28 00:00\",\"01/29 00:00\"],\"name\":\"acid\",\"line\":{\"dash\":\"solid\",\"shape\":\"linear\"},\"marker\":{\"color\":\"#8c564b\"}}],\n",
|
24
|
-
" {\"xaxis\":{\"dtick\":86400,\"tickvals\":[0,86400,172800,259200,345600,432000,518400,604800,691200,777600,864000,950400,1036800,1123200],\"ticktext\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\"]},\"annotations\":[{\"x\":0.0,\"y\":12.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"水麹\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":3600.0,\"y\":20.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"仕込み\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":86400.0,\"y\":14.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"打瀬\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40},{\"x\":777600.0,\"y\":20.0,\"xref\":\"x\",\"yref\":\"y\",\"text\":\"分け\",\"showarrow\":true,\"arrowhead\":1,\"ax\":0,\"ay\":-40}]},\n",
|
25
|
-
" {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
|
26
|
-
")\n",
|
27
|
-
"\n",
|
28
|
-
"window.addEventListener('resize', function() {\n",
|
29
|
-
" Plotly.Plots.resize(document.getElementById('105867eb-e572-490c-8509-e506179e76ad'))\n",
|
30
|
-
"})\n",
|
31
|
-
" }) \n",
|
32
|
-
"</script>"
|
33
|
-
],
|
34
|
-
"text/plain": [
|
35
|
-
"#<Plotly::Offline::HTML:0x00007f983ea69c48 @id=\"105867eb-e572-490c-8509-e506179e76ad\", @data=[{:x=>[0.0, 3600.0, 86400.0, 172800.0, 172801.0, 259200.0, 259201.0, 345600.0, 345601.0, 432000.0, 518400.0, 604800.0, 691200.0, 777600.0, 864000.0, 950400.0, 1036800.0, 1123200.0], :y=>[12.0, 20.0, 14.0, 8.0, 11.0, 10.0, 13.0, 12.0, 15.0, 14.0, 20.0, 20.0, 20.0, 20.0, 15.0, 12.0, 10.0, 9.0], :text=>[\"01/16 00:00\", \"01/16 01:00\", \"01/17 00:00\", \"01/18 00:00\", \"01/18 00:00\", \"01/19 00:00\", \"01/19 00:00\", \"01/20 00:00\", \"01/20 00:00\", \"01/21 00:00\", \"01/22 00:00\", \"01/23 00:00\", \"01/24 00:00\", \"01/25 00:00\", \"01/26 00:00\", \"01/27 00:00\", \"01/28 00:00\", \"01/29 00:00\"], :name=>\"temps\", :line=>{:dash=>:solid, :shape=>:linear}, :marker=>{:color=>\"#1f77b4\"}}, {:x=>[86400.0, 172800.0, 259200.0, 345600.0, 432000.0, 518400.0, 604800.0, 691200.0, 777600.0, 864000.0, 950400.0, 1036800.0, 1123200.0], :y=>[15.0, 16.0, 16.5, 17.0, 17.0, 17.0, 14.0, 12.0, 9.0, 8.0, 7.0, 6.0, 5.0], :text=>[\"01/17 00:00\", \"01/18 00:00\", \"01/19 00:00\", \"01/20 00:00\", \"01/21 00:00\", \"01/22 00:00\", \"01/23 00:00\", \"01/24 00:00\", \"01/25 00:00\", \"01/26 00:00\", \"01/27 00:00\", \"01/28 00:00\", \"01/29 00:00\"], :name=>\"baume\", :line=>{:dash=>:solid, :shape=>:linear}, :marker=>{:color=>\"#9467bd\"}}, {:x=>[0.0, 3600.0, 86400.0, 172800.0, 259200.0, 345600.0, 432000.0, 518400.0, 604800.0, 691200.0, 777600.0, 864000.0, 950400.0, 1036800.0, 1123200.0], :y=>[13.0, 13.0, 13.0, 13.0, 13.5, 13.5, 14.0, 14.5, 15.5, 16.0, 16.0, 16.5, 17.0, 17.5, 17.5], :text=>[\"01/16 00:00\", \"01/16 01:00\", \"01/17 00:00\", \"01/18 00:00\", \"01/19 00:00\", \"01/20 00:00\", \"01/21 00:00\", \"01/22 00:00\", \"01/23 00:00\", \"01/24 00:00\", \"01/25 00:00\", \"01/26 00:00\", \"01/27 00:00\", \"01/28 00:00\", \"01/29 00:00\"], :name=>\"acid\", :line=>{:dash=>:solid, :shape=>:linear}, :marker=>{:color=>\"#8c564b\"}}], @layout={:xaxis=>{:dtick=>86400, :tickvals=>[0, 86400, 172800, 259200, 345600, 432000, 518400, 604800, 691200, 777600, 864000, 950400, 1036800, 1123200], :ticktext=>[\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\"]}, :annotations=>[{:x=>0.0, :y=>12.0, :xref=>\"x\", :yref=>\"y\", :text=>\"水麹\", :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>3600.0, :y=>20.0, :xref=>\"x\", :yref=>\"y\", :text=>\"仕込み\", :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>86400.0, :y=>14.0, :xref=>\"x\", :yref=>\"y\", :text=>\"打瀬\", :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}, {:x=>777600.0, :y=>20.0, :xref=>\"x\", :yref=>\"y\", :text=>\"分け\", :showarrow=>true, :arrowhead=>1, :ax=>0, :ay=>-40}]}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
|
36
|
-
]
|
37
|
-
},
|
38
|
-
"metadata": {},
|
39
|
-
"output_type": "display_data"
|
40
|
-
},
|
41
|
-
{
|
42
|
-
"data": {
|
43
|
-
"text/html": [
|
44
|
-
"\n",
|
45
|
-
" <script>\n",
|
46
|
-
" requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
|
47
|
-
" </script>\n",
|
48
|
-
"\n",
|
49
|
-
"\n",
|
50
|
-
"<div id=\"23560ab9-b0dc-4006-9779-b9219ab608c6\" style=\"height: 100%; width: 100%;\"></div>\n",
|
51
|
-
"\n",
|
52
|
-
"<script>\n",
|
53
|
-
" require(['plotly'], function(Plotly) { \n",
|
54
|
-
"Plotly.newPlot(\n",
|
55
|
-
" '23560ab9-b0dc-4006-9779-b9219ab608c6',\n",
|
56
|
-
" [{\"type\":\"table\",\"header\":{\"values\":[\"day_label\",\"display_time\",\"mark\",\"temps\",\"display_baume\",\"acid\",\"warmings\"]},\"cells\":{\"values\":[[\"1\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\"],[\"01/16 00:00\",\"01/16 01:00\",\"01/17 00:00\",\"01/18 00:00\",\"01/19 00:00\",\"01/20 00:00\",\"01/21 00:00\",\"01/22 00:00\",\"01/23 00:00\",\"01/24 00:00\",\"01/25 00:00\",\"01/26 00:00\",\"01/27 00:00\",\"01/28 00:00\",\"01/29 00:00\"],[\"水麹\",\"仕込み\",\"打瀬\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"分け\",\"\",\"\",\"\",\"\"],[\"12.0\",\"20.0\",\"14.0\",\"8.0, 11.0\",\"10.0, 13.0\",\"12.0, 15.0\",\"14.0\",\"20.0\",\"20.0\",\"20.0\",\"20.0\",\"15.0\",\"12.0\",\"10.0\",\"9.0\"],[\"\",\"\",15.0,16.0,16.5,17.0,17.0,17.0,14.0,12.0,9.0,8.0,7.0,6.0,5.0],[13.0,13.0,13.0,13.0,13.5,13.5,14.0,14.5,15.5,16.0,16.0,16.5,17.0,17.5,17.5],[\"\",\"\",\"\",\"暖気\",\"暖気\",\"暖気\",\"行火\",\"行火\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]]}}],\n",
|
57
|
-
" {\"height\":650},\n",
|
58
|
-
" {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
|
59
|
-
")\n",
|
60
|
-
"\n",
|
61
|
-
"window.addEventListener('resize', function() {\n",
|
62
|
-
" Plotly.Plots.resize(document.getElementById('23560ab9-b0dc-4006-9779-b9219ab608c6'))\n",
|
63
|
-
"})\n",
|
64
|
-
" }) \n",
|
65
|
-
"</script>"
|
66
|
-
],
|
67
|
-
"text/plain": [
|
68
|
-
"#<Plotly::Offline::HTML:0x00007f9841041718 @id=\"23560ab9-b0dc-4006-9779-b9219ab608c6\", @data=[{:type=>:table, :header=>{:values=>[:day_label, :display_time, :mark, :temps, :display_baume, :acid, :warmings]}, :cells=>{:values=>[[\"1\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\"], [\"01/16 00:00\", \"01/16 01:00\", \"01/17 00:00\", \"01/18 00:00\", \"01/19 00:00\", \"01/20 00:00\", \"01/21 00:00\", \"01/22 00:00\", \"01/23 00:00\", \"01/24 00:00\", \"01/25 00:00\", \"01/26 00:00\", \"01/27 00:00\", \"01/28 00:00\", \"01/29 00:00\"], [\"水麹\", \"仕込み\", \"打瀬\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"分け\", \"\", \"\", \"\", \"\"], [\"12.0\", \"20.0\", \"14.0\", \"8.0, 11.0\", \"10.0, 13.0\", \"12.0, 15.0\", \"14.0\", \"20.0\", \"20.0\", \"20.0\", \"20.0\", \"15.0\", \"12.0\", \"10.0\", \"9.0\"], [\"\", \"\", 15.0, 16.0, 16.5, 17.0, 17.0, 17.0, 14.0, 12.0, 9.0, 8.0, 7.0, 6.0, 5.0], [13.0, 13.0, 13.0, 13.0, 13.5, 13.5, 14.0, 14.5, 15.5, 16.0, 16.0, 16.5, 17.0, 17.5, 17.5], [\"\", \"\", \"\", \"暖気\", \"暖気\", \"暖気\", \"行火\", \"行火\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"]]}}], @layout={:height=>650}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
|
69
|
-
]
|
70
|
-
},
|
71
|
-
"metadata": {},
|
72
|
-
"output_type": "display_data"
|
73
|
-
},
|
74
|
-
{
|
75
|
-
"data": {
|
76
|
-
"text/plain": [
|
77
|
-
"#<CZTop::Socket::PUB:0x7f984321b6b0 last_endpoint=\"tcp://127.0.0.1:56600\">"
|
78
|
-
]
|
79
|
-
},
|
80
|
-
"execution_count": 1,
|
81
|
-
"metadata": {},
|
82
|
-
"output_type": "execute_result"
|
83
|
-
}
|
84
|
-
],
|
85
|
-
"source": [
|
86
|
-
"$LOAD_PATH << File.dirname(__FILE__) + \"/../lib\"\n",
|
87
|
-
"require 'toji'\n",
|
88
|
-
"require './example_core'\n",
|
89
|
-
"require 'rbplotly'\n",
|
90
|
-
"\n",
|
91
|
-
"shubo = Example::Brew::Shubo.load_yaml_file(\"shubo.yaml\")\n",
|
92
|
-
"shubo.progress.plot.show\n",
|
93
|
-
"shubo.progress.table.tap {|t|\n",
|
94
|
-
" t.layout.height = 650\n",
|
95
|
-
"}.show"
|
96
|
-
]
|
97
|
-
},
|
98
|
-
{
|
99
|
-
"cell_type": "code",
|
100
|
-
"execution_count": null,
|
101
|
-
"metadata": {},
|
102
|
-
"outputs": [],
|
103
|
-
"source": []
|
104
|
-
}
|
105
|
-
],
|
106
|
-
"metadata": {
|
107
|
-
"kernelspec": {
|
108
|
-
"display_name": "Ruby 2.7.1",
|
109
|
-
"language": "ruby",
|
110
|
-
"name": "ruby"
|
111
|
-
},
|
112
|
-
"language_info": {
|
113
|
-
"file_extension": ".rb",
|
114
|
-
"mimetype": "application/x-ruby",
|
115
|
-
"name": "ruby",
|
116
|
-
"version": "2.6.3"
|
117
|
-
}
|
118
|
-
},
|
119
|
-
"nbformat": 4,
|
120
|
-
"nbformat_minor": 2
|
121
|
-
}
|