toji 1.6.8 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/calendar.ipynb +123 -0
- data/example/{schedule.yaml → calendar.yaml} +6 -30
- data/example/calendar_file.ipynb +338 -0
- data/example/example_core.rb +336 -0
- data/example/kake_recipe.rb +27 -0
- data/example/koji_making.ipynb +16 -15
- data/example/koji_making.rb +2 -1
- data/example/koji_making.yaml +9 -9
- data/example/koji_making_multi.ipynb +26 -25
- data/example/koji_recipe.rb +1 -1
- data/example/moromi.ipynb +25 -24
- data/example/moromi.rb +1 -0
- data/example/moromi.yaml +10 -4
- data/example/recipe.rb +75 -0
- data/example/shubo.ipynb +15 -14
- data/example/shubo.rb +2 -1
- data/example/shubo.yaml +10 -10
- data/lib/toji.rb +3 -1
- data/lib/toji/brew.rb +1 -2
- data/lib/toji/brew/base.rb +7 -71
- data/lib/toji/brew/builder.rb +47 -4
- data/lib/toji/brew/graph/bmd.rb +0 -1
- data/lib/toji/brew/graph/progress.rb +1 -1
- data/lib/toji/brew/koji.rb +0 -10
- data/lib/toji/brew/moromi.rb +2 -36
- data/lib/toji/brew/shubo.rb +0 -5
- data/lib/toji/brew/state.rb +58 -111
- data/lib/toji/brew/state_wrapper.rb +135 -0
- data/lib/toji/calendar.rb +123 -0
- data/lib/toji/{schedule → calendar}/date_column.rb +3 -6
- data/lib/toji/{schedule → calendar}/date_row.rb +6 -6
- data/lib/toji/ingredient.rb +10 -0
- data/lib/toji/ingredient/kake.rb +17 -0
- data/lib/toji/ingredient/kake/actual.rb +27 -0
- data/lib/toji/ingredient/kake/base.rb +18 -0
- data/lib/toji/ingredient/kake/expected.rb +41 -0
- data/lib/toji/ingredient/koji.rb +19 -0
- data/lib/toji/ingredient/koji/actual.rb +30 -0
- data/lib/toji/ingredient/koji/actual_fermentable.rb +15 -0
- data/lib/toji/ingredient/koji/base.rb +35 -0
- data/lib/toji/ingredient/koji/expected.rb +46 -0
- data/lib/toji/ingredient/koji/expected_fermentable.rb +15 -0
- data/lib/toji/{recipe → ingredient}/koji_rate.rb +1 -1
- data/lib/toji/ingredient/rice.rb +10 -0
- data/lib/toji/ingredient/rice/actual_steamable.rb +27 -0
- data/lib/toji/ingredient/rice/base.rb +41 -0
- data/lib/toji/ingredient/rice/expected_steamable.rb +29 -0
- data/lib/toji/ingredient/rice_rate.rb +35 -0
- data/lib/toji/product.rb +65 -0
- data/lib/toji/{schedule/product_event.rb → product/event.rb} +4 -4
- data/lib/toji/recipe.rb +120 -5
- data/lib/toji/recipe/step.rb +46 -59
- data/lib/toji/version.rb +1 -1
- metadata +32 -38
- data/example/rice_recipe.rb +0 -28
- data/example/schedule.ipynb +0 -393
- data/example/schedule_file.ipynb +0 -337
- data/example/three_step_mashing_recipe.rb +0 -67
- data/lib/toji/brew/state_accessor.rb +0 -13
- data/lib/toji/brew/state_record.rb +0 -72
- data/lib/toji/recipe/ingredient.rb +0 -10
- data/lib/toji/recipe/ingredient/koji.rb +0 -21
- data/lib/toji/recipe/ingredient/koji/actual.rb +0 -32
- data/lib/toji/recipe/ingredient/koji/actual_fermentable.rb +0 -17
- data/lib/toji/recipe/ingredient/koji/base.rb +0 -37
- data/lib/toji/recipe/ingredient/koji/expected.rb +0 -48
- data/lib/toji/recipe/ingredient/koji/expected_fermentable.rb +0 -17
- data/lib/toji/recipe/ingredient/rice.rb +0 -21
- data/lib/toji/recipe/ingredient/rice/actual.rb +0 -29
- data/lib/toji/recipe/ingredient/rice/actual_steamable.rb +0 -29
- data/lib/toji/recipe/ingredient/rice/base.rb +0 -51
- data/lib/toji/recipe/ingredient/rice/expected.rb +0 -43
- data/lib/toji/recipe/ingredient/rice/expected_steamable.rb +0 -31
- data/lib/toji/recipe/ingredient/yeast.rb +0 -21
- data/lib/toji/recipe/rice_rate.rb +0 -10
- data/lib/toji/recipe/rice_rate/base.rb +0 -21
- data/lib/toji/recipe/rice_rate/cooked.rb +0 -67
- data/lib/toji/recipe/rice_rate/steamed.rb +0 -30
- data/lib/toji/recipe/three_step_mashing.rb +0 -274
- data/lib/toji/recipe/yeast_rate.rb +0 -41
- data/lib/toji/schedule.rb +0 -11
- data/lib/toji/schedule/calendar.rb +0 -139
- data/lib/toji/schedule/date_interval_enumerator.rb +0 -45
- data/lib/toji/schedule/product.rb +0 -117
@@ -1,5 +1,5 @@
|
|
1
1
|
module Toji
|
2
|
-
|
2
|
+
class Calendar
|
3
3
|
class DateColumn
|
4
4
|
attr_reader :events
|
5
5
|
|
@@ -26,13 +26,10 @@ module Toji
|
|
26
26
|
}.join("<br>")
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
29
|
+
def column_events
|
30
30
|
event_groups.map {|es|
|
31
|
-
product = es.first.product
|
32
31
|
{
|
33
|
-
|
34
|
-
product_name: product.name,
|
35
|
-
product_color: product.color,
|
32
|
+
product: es.first.product,
|
36
33
|
weight: es.map(&:weight).sum,
|
37
34
|
}
|
38
35
|
}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
module Toji
|
2
|
-
|
2
|
+
class Calendar
|
3
3
|
class DateRow
|
4
4
|
attr_reader :date
|
5
5
|
attr_reader :kojis
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :kakes
|
7
7
|
|
8
8
|
def initialize(date)
|
9
9
|
@date = date
|
10
10
|
@kojis = []
|
11
|
-
@
|
11
|
+
@kakes = []
|
12
12
|
end
|
13
13
|
|
14
14
|
def <<(event)
|
@@ -17,10 +17,10 @@ module Toji
|
|
17
17
|
index = event.group_index
|
18
18
|
@kojis[index] ||= DateColumn.new
|
19
19
|
@kojis[index] << event
|
20
|
-
when :
|
20
|
+
when :kake
|
21
21
|
index = event.group_index
|
22
|
-
@
|
23
|
-
@
|
22
|
+
@kakes[index] ||= DateColumn.new
|
23
|
+
@kakes[index] << event
|
24
24
|
end
|
25
25
|
end
|
26
26
|
alias_method :add, :<<
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'toji/ingredient/kake/base'
|
2
|
+
require 'toji/ingredient/kake/expected'
|
3
|
+
require 'toji/ingredient/kake/actual'
|
4
|
+
|
5
|
+
module Toji
|
6
|
+
module Ingredient
|
7
|
+
module Kake
|
8
|
+
def self.expected(raw, rice_rate: Recipe::RiceRate::DEFAULT)
|
9
|
+
Expected.new(raw, rice_rate: rice_rate)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.actual(raw, soaked, steaming_water, steamed, cooled)
|
13
|
+
Actual.new(raw, soaked, steaming_water, steamed, cooled)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Toji
|
2
|
+
module Ingredient
|
3
|
+
module Kake
|
4
|
+
class Actual
|
5
|
+
include Base
|
6
|
+
include Rice::ActualSteamable
|
7
|
+
|
8
|
+
def initialize(raw, soaked, steaming_water, steamed, cooled)
|
9
|
+
@raw = raw
|
10
|
+
@soaked = soaked
|
11
|
+
@steaming_water = steaming_water
|
12
|
+
@steamed = steamed
|
13
|
+
@cooled = cooled
|
14
|
+
end
|
15
|
+
|
16
|
+
def *(other)
|
17
|
+
if Integer===other || Float===other
|
18
|
+
Actual.new(raw * other, soaked * other, steaming_water * other, steamed * other, cooled * other)
|
19
|
+
else
|
20
|
+
x, y = other.coerce(self)
|
21
|
+
x * y
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Toji
|
2
|
+
module Ingredient
|
3
|
+
module Kake
|
4
|
+
module Base
|
5
|
+
include Rice::Base
|
6
|
+
|
7
|
+
def +(other)
|
8
|
+
if Base===other
|
9
|
+
Actual.new(raw + other.raw, soaked + other.soaked, steaming_water + other.steaming_water, steamed + other.steamed, cooled + other.cooled)
|
10
|
+
else
|
11
|
+
x, y = other.coerce(self)
|
12
|
+
x + y
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Toji
|
2
|
+
module Ingredient
|
3
|
+
module Kake
|
4
|
+
class Expected
|
5
|
+
include Base
|
6
|
+
include Rice::ExpectedSteamable
|
7
|
+
|
8
|
+
def initialize(raw, rice_rate: RiceRate::DEFAULT)
|
9
|
+
@raw = raw.to_f
|
10
|
+
|
11
|
+
@rice_rate = rice_rate
|
12
|
+
@soaked_rate = rice_rate.soaked_rate
|
13
|
+
@before_steaming_rate = rice_rate.before_steaming_rate
|
14
|
+
@steamed_rate = rice_rate.steamed_rate
|
15
|
+
@cooled_rate = rice_rate.cooled_rate
|
16
|
+
end
|
17
|
+
|
18
|
+
def round(ndigit=0, half: :up)
|
19
|
+
self.class.new(@raw.round(ndigit, half: half), rice_rate: @rice_rate)
|
20
|
+
end
|
21
|
+
|
22
|
+
def *(other)
|
23
|
+
if Integer===other || Float===other
|
24
|
+
self.class.new(@raw * other, rice_rate: @rice_rate)
|
25
|
+
else
|
26
|
+
x, y = other.coerce(self)
|
27
|
+
x * y
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.create(x)
|
32
|
+
if self===x
|
33
|
+
x
|
34
|
+
else
|
35
|
+
new(x)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'toji/ingredient/koji/base'
|
2
|
+
require 'toji/ingredient/koji/expected_fermentable'
|
3
|
+
require 'toji/ingredient/koji/expected'
|
4
|
+
require 'toji/ingredient/koji/actual_fermentable'
|
5
|
+
require 'toji/ingredient/koji/actual'
|
6
|
+
|
7
|
+
module Toji
|
8
|
+
module Ingredient
|
9
|
+
module Koji
|
10
|
+
def self.expected(raw, rice_rate: Recipe::RiceRate::DEFAULT, koji_rate: Recipe::KojiRate::DEFAULT)
|
11
|
+
Expected.new(raw, rice_rate: rice_rate, koji_rate: koji_rate)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.actual(raw, soaked, steaming_water, steamed, cooled, tanekoji, dekoji)
|
15
|
+
Actual.new(raw, soaked, steaming_water, steamed, cooled, tanekoji, dekoji)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Toji
|
2
|
+
module Ingredient
|
3
|
+
module Koji
|
4
|
+
class Actual
|
5
|
+
include Base
|
6
|
+
include Rice::ActualSteamable
|
7
|
+
include ActualFermentable
|
8
|
+
|
9
|
+
def initialize(raw, soaked, steaming_water, steamed, cooled, tanekoji, dekoji)
|
10
|
+
@raw = raw
|
11
|
+
@soaked = soaked
|
12
|
+
@steaming_water = steaming_water
|
13
|
+
@steamed = steamed
|
14
|
+
@cooled = cooled
|
15
|
+
@tanekoji = tanekoji
|
16
|
+
@dekoji = dekoji
|
17
|
+
end
|
18
|
+
|
19
|
+
def *(other)
|
20
|
+
if Integer===other || Float===other
|
21
|
+
Actual.new(raw * other, soaked * other, steaming_water * other, steamed * other, cooled * other, tanekoji * other, dekoji * other)
|
22
|
+
else
|
23
|
+
x, y = other.coerce(self)
|
24
|
+
x * y
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Toji
|
2
|
+
module Ingredient
|
3
|
+
module Koji
|
4
|
+
module Base
|
5
|
+
include Rice::Base
|
6
|
+
|
7
|
+
# 種麹
|
8
|
+
#
|
9
|
+
# 総破精麹を造るには、種麹の量を麹米100kgあたり種麹100gとする
|
10
|
+
# 突き破精麹を造るには、種麹の量を麹米100kgあたり種麹80gとする
|
11
|
+
#
|
12
|
+
# 出典: 酒造教本 P66
|
13
|
+
attr_reader :tanekoji_rate
|
14
|
+
attr_reader :tanekoji
|
15
|
+
|
16
|
+
# 出麹歩合
|
17
|
+
#
|
18
|
+
# 出麹歩合17〜19%のものが麹菌の繁殖のほどよい麹である
|
19
|
+
#
|
20
|
+
# 出典: 酒造教本 P67
|
21
|
+
attr_reader :dekoji_rate
|
22
|
+
attr_reader :dekoji
|
23
|
+
|
24
|
+
def +(other)
|
25
|
+
if Base===other
|
26
|
+
Actual.new(raw + other.raw, soaked + other.soaked, steaming_water + other.steaming_water, steamed + other.steamed, cooled + other.cooled, tanekoji + other.tanekoji, dekoji + other.dekoji)
|
27
|
+
else
|
28
|
+
x, y = other.coerce(self)
|
29
|
+
x + y
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Toji
|
2
|
+
module Ingredient
|
3
|
+
module Koji
|
4
|
+
class Expected
|
5
|
+
include Base
|
6
|
+
include Rice::ExpectedSteamable
|
7
|
+
include ExpectedFermentable
|
8
|
+
|
9
|
+
def initialize(raw, rice_rate: RiceRate::DEFAULT, koji_rate: KojiRate::DEFAULT)
|
10
|
+
@raw = raw.to_f
|
11
|
+
|
12
|
+
@rice_rate = rice_rate
|
13
|
+
@soaked_rate = rice_rate.soaked_rate
|
14
|
+
@before_steaming_rate = rice_rate.before_steaming_rate
|
15
|
+
@steamed_rate = rice_rate.steamed_rate
|
16
|
+
@cooled_rate = rice_rate.cooled_rate
|
17
|
+
|
18
|
+
@koji_rate = koji_rate
|
19
|
+
@tanekoji_rate = koji_rate.tanekoji_rate
|
20
|
+
@dekoji_rate = koji_rate.dekoji_rate
|
21
|
+
end
|
22
|
+
|
23
|
+
def round(ndigit=0, half: :up)
|
24
|
+
self.class.new(@raw.round(ndigit, half: half), rice_rate: @rice_rate, koji_rate: @koji_rate)
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.create(x)
|
28
|
+
if self===x
|
29
|
+
x
|
30
|
+
else
|
31
|
+
new(x)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def *(other)
|
36
|
+
if Integer===other || Float===other
|
37
|
+
Expected.new(@raw * other, rice_rate: @rice_rate, koji_rate: @koji_rate)
|
38
|
+
else
|
39
|
+
x, y = other.coerce(self)
|
40
|
+
x * y
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Toji
|
2
|
+
module Ingredient
|
3
|
+
module Rice
|
4
|
+
module ActualSteamable
|
5
|
+
def soaked_rate
|
6
|
+
soaking_water / raw
|
7
|
+
end
|
8
|
+
|
9
|
+
def soaking_water
|
10
|
+
soaked - raw
|
11
|
+
end
|
12
|
+
|
13
|
+
def before_steaming_rate
|
14
|
+
# TODO
|
15
|
+
end
|
16
|
+
|
17
|
+
def steamed_rate
|
18
|
+
(steamed - raw) / raw
|
19
|
+
end
|
20
|
+
|
21
|
+
def cooled_rate
|
22
|
+
(cooled - raw) / raw
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Toji
|
2
|
+
module Ingredient
|
3
|
+
module Rice
|
4
|
+
module Base
|
5
|
+
# 白米
|
6
|
+
attr_reader :raw
|
7
|
+
|
8
|
+
# 浸漬米吸水率
|
9
|
+
#
|
10
|
+
# 標準的な白米吸水率は掛米で30〜35%、麹米で33%前後で許容範囲はかなり狭い
|
11
|
+
#
|
12
|
+
# 出典: 酒造教本 P38
|
13
|
+
attr_reader :soaked_rate
|
14
|
+
attr_reader :soaking_water
|
15
|
+
attr_reader :soaked
|
16
|
+
|
17
|
+
# 蒸米吸水率
|
18
|
+
#
|
19
|
+
# 蒸しにより通常甑置き前の浸漬白米の重量よりさらに12〜13%吸水する
|
20
|
+
# 蒸しにより吸水の増加が13%を超える場合は、蒸米の表面が柔らかくべとつく蒸米になりやすい
|
21
|
+
# 蒸米吸水率は麹米及び酒母米で41〜43%、掛米は39〜40%で、吟醸造りの場合は数%低い
|
22
|
+
#
|
23
|
+
# 出典: 酒造教本 P48
|
24
|
+
attr_reader :before_steaming_rate
|
25
|
+
attr_reader :steamed_rate
|
26
|
+
attr_reader :steaming_water
|
27
|
+
attr_reader :steamed
|
28
|
+
|
29
|
+
# 放冷
|
30
|
+
#
|
31
|
+
# 冷却法で若干異なるが蒸米の冷却により掛米で白米重量の10%、麹米で8%程度の水が失われる
|
32
|
+
# 出典: 酒造教本 P49
|
33
|
+
#
|
34
|
+
# 麹を造るのに適した蒸米は、引込時の吸水率が33%を理想とし、許容幅はプラスマイナス1%である
|
35
|
+
# 出典: 酒造教本 P59
|
36
|
+
attr_reader :cooled_rate
|
37
|
+
attr_reader :cooled
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Toji
|
2
|
+
module Ingredient
|
3
|
+
module Rice
|
4
|
+
module ExpectedSteamable
|
5
|
+
def soaking_water
|
6
|
+
raw * soaked_rate
|
7
|
+
end
|
8
|
+
|
9
|
+
def soaked
|
10
|
+
raw + raw * soaked_rate
|
11
|
+
end
|
12
|
+
|
13
|
+
def steaming_water
|
14
|
+
if before_steaming_rate
|
15
|
+
raw * (before_steaming_rate - soaked_rate)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def steamed
|
20
|
+
raw + raw * steamed_rate
|
21
|
+
end
|
22
|
+
|
23
|
+
def cooled
|
24
|
+
raw + raw * cooled_rate
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|