toji 1.6.8 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/example/calendar.ipynb +383 -0
  3. data/example/{schedule.yaml → calendar.yaml} +6 -30
  4. data/example/calendar_file.ipynb +338 -0
  5. data/example/example_core.rb +354 -0
  6. data/example/kake_ingredient.rb +26 -0
  7. data/example/{koji_recipe.rb → koji_ingredient.rb} +1 -2
  8. data/example/koji_making.ipynb +16 -15
  9. data/example/koji_making.rb +2 -1
  10. data/example/koji_making.yaml +10 -9
  11. data/example/koji_making_multi.ipynb +27 -61
  12. data/example/moromi.ipynb +25 -24
  13. data/example/moromi.rb +1 -0
  14. data/example/moromi.yaml +10 -4
  15. data/example/recipe.rb +75 -0
  16. data/example/shubo.ipynb +15 -14
  17. data/example/shubo.rb +2 -1
  18. data/example/shubo.yaml +12 -11
  19. data/lib/toji.rb +3 -1
  20. data/lib/toji/brew.rb +4 -3
  21. data/lib/toji/brew/base.rb +8 -92
  22. data/lib/toji/brew/builder.rb +77 -6
  23. data/lib/toji/brew/graph/bmd.rb +1 -2
  24. data/lib/toji/brew/graph/multi_progress.rb +0 -121
  25. data/lib/toji/brew/graph/progress.rb +17 -52
  26. data/lib/toji/brew/koji.rb +2 -11
  27. data/lib/toji/brew/moromi.rb +4 -37
  28. data/lib/toji/brew/shubo.rb +2 -6
  29. data/lib/toji/brew/state.rb +90 -103
  30. data/lib/toji/brew/wrapped_state.rb +136 -0
  31. data/lib/toji/calendar.rb +123 -0
  32. data/lib/toji/{schedule → calendar}/date_column.rb +3 -6
  33. data/lib/toji/{schedule → calendar}/date_row.rb +6 -6
  34. data/lib/toji/ingredient.rb +10 -0
  35. data/lib/toji/ingredient/kake.rb +17 -0
  36. data/lib/toji/ingredient/kake/actual.rb +26 -0
  37. data/lib/toji/ingredient/kake/base.rb +18 -0
  38. data/lib/toji/ingredient/kake/expected.rb +40 -0
  39. data/lib/toji/ingredient/koji.rb +19 -0
  40. data/lib/toji/ingredient/koji/actual.rb +29 -0
  41. data/lib/toji/ingredient/koji/actual_fermentable.rb +15 -0
  42. data/lib/toji/ingredient/koji/base.rb +35 -0
  43. data/lib/toji/ingredient/koji/expected.rb +45 -0
  44. data/lib/toji/ingredient/koji/expected_fermentable.rb +15 -0
  45. data/lib/toji/{recipe → ingredient}/koji_rate.rb +1 -1
  46. data/lib/toji/ingredient/rice.rb +10 -0
  47. data/lib/toji/ingredient/rice/actual_steamable.rb +27 -0
  48. data/lib/toji/ingredient/rice/base.rb +40 -0
  49. data/lib/toji/ingredient/rice/expected_steamable.rb +27 -0
  50. data/lib/toji/ingredient/rice_rate.rb +23 -0
  51. data/lib/toji/product.rb +65 -0
  52. data/lib/toji/{schedule/product_event.rb → product/event.rb} +4 -4
  53. data/lib/toji/recipe.rb +111 -5
  54. data/lib/toji/recipe/step.rb +49 -64
  55. data/lib/toji/version.rb +1 -1
  56. metadata +33 -39
  57. data/example/rice_recipe.rb +0 -28
  58. data/example/schedule.ipynb +0 -393
  59. data/example/schedule_file.ipynb +0 -337
  60. data/example/three_step_mashing_recipe.rb +0 -67
  61. data/lib/toji/brew/state_accessor.rb +0 -13
  62. data/lib/toji/brew/state_record.rb +0 -72
  63. data/lib/toji/recipe/ingredient.rb +0 -10
  64. data/lib/toji/recipe/ingredient/koji.rb +0 -21
  65. data/lib/toji/recipe/ingredient/koji/actual.rb +0 -32
  66. data/lib/toji/recipe/ingredient/koji/actual_fermentable.rb +0 -17
  67. data/lib/toji/recipe/ingredient/koji/base.rb +0 -37
  68. data/lib/toji/recipe/ingredient/koji/expected.rb +0 -48
  69. data/lib/toji/recipe/ingredient/koji/expected_fermentable.rb +0 -17
  70. data/lib/toji/recipe/ingredient/rice.rb +0 -21
  71. data/lib/toji/recipe/ingredient/rice/actual.rb +0 -29
  72. data/lib/toji/recipe/ingredient/rice/actual_steamable.rb +0 -29
  73. data/lib/toji/recipe/ingredient/rice/base.rb +0 -51
  74. data/lib/toji/recipe/ingredient/rice/expected.rb +0 -43
  75. data/lib/toji/recipe/ingredient/rice/expected_steamable.rb +0 -31
  76. data/lib/toji/recipe/ingredient/yeast.rb +0 -21
  77. data/lib/toji/recipe/rice_rate.rb +0 -10
  78. data/lib/toji/recipe/rice_rate/base.rb +0 -21
  79. data/lib/toji/recipe/rice_rate/cooked.rb +0 -67
  80. data/lib/toji/recipe/rice_rate/steamed.rb +0 -30
  81. data/lib/toji/recipe/three_step_mashing.rb +0 -274
  82. data/lib/toji/recipe/yeast_rate.rb +0 -41
  83. data/lib/toji/schedule.rb +0 -11
  84. data/lib/toji/schedule/calendar.rb +0 -139
  85. data/lib/toji/schedule/date_interval_enumerator.rb +0 -45
  86. data/lib/toji/schedule/product.rb +0 -117
@@ -1,337 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "code",
5
- "execution_count": 3,
6
- "metadata": {
7
- "scrolled": false
8
- },
9
- "outputs": [
10
- {
11
- "name": "stdout",
12
- "output_type": "stream",
13
- "text": [
14
- "仕1 姫野国夫による酒母省略仕込\n"
15
- ]
16
- },
17
- {
18
- "data": {
19
- "text/html": [
20
- "\n",
21
- " <script>\n",
22
- " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
23
- " </script>\n",
24
- "\n",
25
- "\n",
26
- "<div id=\"39130064-7a13-4f3e-b33a-3bc1b965112b\" style=\"height: 100%; width: 100%;\"></div>\n",
27
- "\n",
28
- "<script>\n",
29
- " require(['plotly'], function(Plotly) { \n",
30
- "Plotly.newPlot(\n",
31
- " '39130064-7a13-4f3e-b33a-3bc1b965112b',\n",
32
- " [{\"type\":\"table\",\"header\":{\"values\":[\"\",\"moto\",\"soe\",\"naka\",\"tome\",\"yodan\",\"total\"]},\"cells\":{\"values\":[[\"rice_total\",\"rice\",\"koji\",\"alcohol\",\"water\",\"lactic_acid\"],[35.0,\"\",35.0,\"\",123.0,0.8],[65.0,65.0,\"\",\"\",\"\",\"\"],[200.0,150.0,50.0,\"\",200.0,\"\"],[300.0,245.0,55.0,\"\",400.0,\"\"],[\"\",\"\",\"\",\"\",128.0,\"\"],[600.0,460.0,140.0,\"\",851.0,0.8]]}}],\n",
33
- " {\"height\":350},\n",
34
- " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
35
- ")\n",
36
- "\n",
37
- "window.addEventListener('resize', function() {\n",
38
- " Plotly.Plots.resize(document.getElementById('39130064-7a13-4f3e-b33a-3bc1b965112b'))\n",
39
- "})\n",
40
- " }) \n",
41
- "</script>"
42
- ],
43
- "text/plain": [
44
- "#<Plotly::Offline::HTML:0x00007f9f66a736d8 @id=\"39130064-7a13-4f3e-b33a-3bc1b965112b\", @data=[{:type=>:table, :header=>{:values=>[\"\", :moto, :soe, :naka, :tome, :yodan, :total]}, :cells=>{:values=>[[:rice_total, :rice, :koji, :alcohol, :water, :lactic_acid], [35.0, \"\", 35.0, \"\", 123.0, 0.8], [65.0, 65.0, \"\", \"\", \"\", \"\"], [200.0, 150.0, 50.0, \"\", 200.0, \"\"], [300.0, 245.0, 55.0, \"\", 400.0, \"\"], [\"\", \"\", \"\", \"\", 128.0, \"\"], [600.0, 460.0, 140.0, \"\", 851.0, 0.8]]}}], @layout={:height=>350}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
45
- ]
46
- },
47
- "metadata": {},
48
- "output_type": "display_data"
49
- },
50
- {
51
- "name": "stdout",
52
- "output_type": "stream",
53
- "text": [
54
- "仕2 姫野国夫による酒母省略仕込\n"
55
- ]
56
- },
57
- {
58
- "data": {
59
- "text/html": [
60
- "\n",
61
- " <script>\n",
62
- " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
63
- " </script>\n",
64
- "\n",
65
- "\n",
66
- "<div id=\"2ed48f7b-70a7-4bd1-ae81-828cbfa7f566\" style=\"height: 100%; width: 100%;\"></div>\n",
67
- "\n",
68
- "<script>\n",
69
- " require(['plotly'], function(Plotly) { \n",
70
- "Plotly.newPlot(\n",
71
- " '2ed48f7b-70a7-4bd1-ae81-828cbfa7f566',\n",
72
- " [{\"type\":\"table\",\"header\":{\"values\":[\"\",\"moto\",\"soe\",\"naka\",\"tome\",\"yodan\",\"total\"]},\"cells\":{\"values\":[[\"rice_total\",\"rice\",\"koji\",\"alcohol\",\"water\",\"lactic_acid\"],[32.0,\"\",32.0,\"\",112.0,0.733],[60.0,60.0,\"\",\"\",\"\",\"\"],[184.0,138.0,46.0,\"\",183.0,\"\"],[275.0,225.0,50.0,\"\",367.0,\"\"],[\"\",\"\",\"\",\"\",117.0,\"\"],[551.0,423.0,128.0,\"\",779.0,0.733]]}}],\n",
73
- " {\"height\":350},\n",
74
- " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
75
- ")\n",
76
- "\n",
77
- "window.addEventListener('resize', function() {\n",
78
- " Plotly.Plots.resize(document.getElementById('2ed48f7b-70a7-4bd1-ae81-828cbfa7f566'))\n",
79
- "})\n",
80
- " }) \n",
81
- "</script>"
82
- ],
83
- "text/plain": [
84
- "#<Plotly::Offline::HTML:0x00007f9f66aa4418 @id=\"2ed48f7b-70a7-4bd1-ae81-828cbfa7f566\", @data=[{:type=>:table, :header=>{:values=>[\"\", :moto, :soe, :naka, :tome, :yodan, :total]}, :cells=>{:values=>[[:rice_total, :rice, :koji, :alcohol, :water, :lactic_acid], [32.0, \"\", 32.0, \"\", 112.0, 0.733], [60.0, 60.0, \"\", \"\", \"\", \"\"], [184.0, 138.0, 46.0, \"\", 183.0, \"\"], [275.0, 225.0, 50.0, \"\", 367.0, \"\"], [\"\", \"\", \"\", \"\", 117.0, \"\"], [551.0, 423.0, 128.0, \"\", 779.0, 0.733]]}}], @layout={:height=>350}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
85
- ]
86
- },
87
- "metadata": {},
88
- "output_type": "display_data"
89
- },
90
- {
91
- "name": "stdout",
92
- "output_type": "stream",
93
- "text": [
94
- "仕3 灘における仕込配合\n"
95
- ]
96
- },
97
- {
98
- "data": {
99
- "text/html": [
100
- "\n",
101
- " <script>\n",
102
- " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
103
- " </script>\n",
104
- "\n",
105
- "\n",
106
- "<div id=\"7798a74d-847a-4159-ba5c-50680a26309e\" style=\"height: 100%; width: 100%;\"></div>\n",
107
- "\n",
108
- "<script>\n",
109
- " require(['plotly'], function(Plotly) { \n",
110
- "Plotly.newPlot(\n",
111
- " '7798a74d-847a-4159-ba5c-50680a26309e',\n",
112
- " [{\"type\":\"table\",\"header\":{\"values\":[\"\",\"moto\",\"soe\",\"naka\",\"tome\",\"alcohol\",\"total\"]},\"cells\":{\"values\":[[\"rice_total\",\"rice\",\"koji\",\"alcohol\",\"water\",\"lactic_acid\"],[63.0,42.0,21.0,\"\",77.0,0.524],[143.0,98.0,45.0,\"\",122.0,\"\"],[254.0,190.0,64.0,\"\",302.0,\"\"],[440.0,366.0,74.0,\"\",599.0,\"\"],[\"\",\"\",\"\",405.0,\"\",\"\"],[900.0,696.0,204.0,405.0,1100.0,0.524]]}}],\n",
113
- " {\"height\":350},\n",
114
- " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
115
- ")\n",
116
- "\n",
117
- "window.addEventListener('resize', function() {\n",
118
- " Plotly.Plots.resize(document.getElementById('7798a74d-847a-4159-ba5c-50680a26309e'))\n",
119
- "})\n",
120
- " }) \n",
121
- "</script>"
122
- ],
123
- "text/plain": [
124
- "#<Plotly::Offline::HTML:0x00007f9f64356190 @id=\"7798a74d-847a-4159-ba5c-50680a26309e\", @data=[{:type=>:table, :header=>{:values=>[\"\", :moto, :soe, :naka, :tome, :alcohol, :total]}, :cells=>{:values=>[[:rice_total, :rice, :koji, :alcohol, :water, :lactic_acid], [63.0, 42.0, 21.0, \"\", 77.0, 0.524], [143.0, 98.0, 45.0, \"\", 122.0, \"\"], [254.0, 190.0, 64.0, \"\", 302.0, \"\"], [440.0, 366.0, 74.0, \"\", 599.0, \"\"], [\"\", \"\", \"\", 405.0, \"\", \"\"], [900.0, 696.0, 204.0, 405.0, 1100.0, 0.524]]}}], @layout={:height=>350}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
125
- ]
126
- },
127
- "metadata": {},
128
- "output_type": "display_data"
129
- },
130
- {
131
- "name": "stdout",
132
- "output_type": "stream",
133
- "text": [
134
- "仕4 酒造教本による標準型仕込配合\n"
135
- ]
136
- },
137
- {
138
- "data": {
139
- "text/html": [
140
- "\n",
141
- " <script>\n",
142
- " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
143
- " </script>\n",
144
- "\n",
145
- "\n",
146
- "<div id=\"24cc1c11-7b4e-4d22-99f6-e83c76860db3\" style=\"height: 100%; width: 100%;\"></div>\n",
147
- "\n",
148
- "<script>\n",
149
- " require(['plotly'], function(Plotly) { \n",
150
- "Plotly.newPlot(\n",
151
- " '24cc1c11-7b4e-4d22-99f6-e83c76860db3',\n",
152
- " [{\"type\":\"table\",\"header\":{\"values\":[\"\",\"moto\",\"soe\",\"naka\",\"tome\",\"yodan\",\"total\"]},\"cells\":{\"values\":[[\"rice_total\",\"rice\",\"koji\",\"alcohol\",\"water\",\"lactic_acid\"],[59.0,41.0,18.0,\"\",63.0,0.432],[126.0,90.0,36.0,\"\",117.0,\"\"],[248.0,194.0,54.0,\"\",297.0,\"\"],[396.0,324.0,72.0,\"\",567.0,\"\"],[72.0,72.0,\"\",\"\",108.0,\"\"],[901.0,721.0,180.0,\"\",1152.0,0.432]]}}],\n",
153
- " {\"height\":350},\n",
154
- " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
155
- ")\n",
156
- "\n",
157
- "window.addEventListener('resize', function() {\n",
158
- " Plotly.Plots.resize(document.getElementById('24cc1c11-7b4e-4d22-99f6-e83c76860db3'))\n",
159
- "})\n",
160
- " }) \n",
161
- "</script>"
162
- ],
163
- "text/plain": [
164
- "#<Plotly::Offline::HTML:0x00007f9f643864f8 @id=\"24cc1c11-7b4e-4d22-99f6-e83c76860db3\", @data=[{:type=>:table, :header=>{:values=>[\"\", :moto, :soe, :naka, :tome, :yodan, :total]}, :cells=>{:values=>[[:rice_total, :rice, :koji, :alcohol, :water, :lactic_acid], [59.0, 41.0, 18.0, \"\", 63.0, 0.432], [126.0, 90.0, 36.0, \"\", 117.0, \"\"], [248.0, 194.0, 54.0, \"\", 297.0, \"\"], [396.0, 324.0, 72.0, \"\", 567.0, \"\"], [72.0, 72.0, \"\", \"\", 108.0, \"\"], [901.0, 721.0, 180.0, \"\", 1152.0, 0.432]]}}], @layout={:height=>350}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
165
- ]
166
- },
167
- "metadata": {},
168
- "output_type": "display_data"
169
- },
170
- {
171
- "name": "stdout",
172
- "output_type": "stream",
173
- "text": [
174
- "仕5 灘における仕込配合\n"
175
- ]
176
- },
177
- {
178
- "data": {
179
- "text/html": [
180
- "\n",
181
- " <script>\n",
182
- " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
183
- " </script>\n",
184
- "\n",
185
- "\n",
186
- "<div id=\"ca599c2f-3651-4ffa-81c5-47869735f251\" style=\"height: 100%; width: 100%;\"></div>\n",
187
- "\n",
188
- "<script>\n",
189
- " require(['plotly'], function(Plotly) { \n",
190
- "Plotly.newPlot(\n",
191
- " 'ca599c2f-3651-4ffa-81c5-47869735f251',\n",
192
- " [{\"type\":\"table\",\"header\":{\"values\":[\"\",\"moto\",\"soe\",\"naka\",\"tome\",\"alcohol\",\"total\"]},\"cells\":{\"values\":[[\"rice_total\",\"rice\",\"koji\",\"alcohol\",\"water\",\"lactic_acid\"],[63.0,42.0,21.0,\"\",77.0,0.524],[143.0,98.0,45.0,\"\",122.0,\"\"],[254.0,190.0,64.0,\"\",302.0,\"\"],[440.0,366.0,74.0,\"\",599.0,\"\"],[\"\",\"\",\"\",405.0,\"\",\"\"],[900.0,696.0,204.0,405.0,1100.0,0.524]]}}],\n",
193
- " {\"height\":350},\n",
194
- " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
195
- ")\n",
196
- "\n",
197
- "window.addEventListener('resize', function() {\n",
198
- " Plotly.Plots.resize(document.getElementById('ca599c2f-3651-4ffa-81c5-47869735f251'))\n",
199
- "})\n",
200
- " }) \n",
201
- "</script>"
202
- ],
203
- "text/plain": [
204
- "#<Plotly::Offline::HTML:0x00007f9f66aede10 @id=\"ca599c2f-3651-4ffa-81c5-47869735f251\", @data=[{:type=>:table, :header=>{:values=>[\"\", :moto, :soe, :naka, :tome, :alcohol, :total]}, :cells=>{:values=>[[:rice_total, :rice, :koji, :alcohol, :water, :lactic_acid], [63.0, 42.0, 21.0, \"\", 77.0, 0.524], [143.0, 98.0, 45.0, \"\", 122.0, \"\"], [254.0, 190.0, 64.0, \"\", 302.0, \"\"], [440.0, 366.0, 74.0, \"\", 599.0, \"\"], [\"\", \"\", \"\", 405.0, \"\", \"\"], [900.0, 696.0, 204.0, 405.0, 1100.0, 0.524]]}}], @layout={:height=>350}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
205
- ]
206
- },
207
- "metadata": {},
208
- "output_type": "display_data"
209
- },
210
- {
211
- "name": "stdout",
212
- "output_type": "stream",
213
- "text": [
214
- "仕6 酒造教本による標準型仕込配合\n"
215
- ]
216
- },
217
- {
218
- "data": {
219
- "text/html": [
220
- "\n",
221
- " <script>\n",
222
- " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
223
- " </script>\n",
224
- "\n",
225
- "\n",
226
- "<div id=\"8e361747-1c89-45d0-b67a-9e8b300479c8\" style=\"height: 100%; width: 100%;\"></div>\n",
227
- "\n",
228
- "<script>\n",
229
- " require(['plotly'], function(Plotly) { \n",
230
- "Plotly.newPlot(\n",
231
- " '8e361747-1c89-45d0-b67a-9e8b300479c8',\n",
232
- " [{\"type\":\"table\",\"header\":{\"values\":[\"\",\"moto\",\"soe\",\"naka\",\"tome\",\"yodan\",\"total\"]},\"cells\":{\"values\":[[\"rice_total\",\"rice\",\"koji\",\"alcohol\",\"water\",\"lactic_acid\"],[59.0,41.0,18.0,\"\",63.0,0.432],[126.0,90.0,36.0,\"\",117.0,\"\"],[248.0,194.0,54.0,\"\",297.0,\"\"],[396.0,324.0,72.0,\"\",567.0,\"\"],[72.0,72.0,\"\",\"\",108.0,\"\"],[901.0,721.0,180.0,\"\",1152.0,0.432]]}}],\n",
233
- " {\"height\":350},\n",
234
- " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
235
- ")\n",
236
- "\n",
237
- "window.addEventListener('resize', function() {\n",
238
- " Plotly.Plots.resize(document.getElementById('8e361747-1c89-45d0-b67a-9e8b300479c8'))\n",
239
- "})\n",
240
- " }) \n",
241
- "</script>"
242
- ],
243
- "text/plain": [
244
- "#<Plotly::Offline::HTML:0x00007f9f66b1d688 @id=\"8e361747-1c89-45d0-b67a-9e8b300479c8\", @data=[{:type=>:table, :header=>{:values=>[\"\", :moto, :soe, :naka, :tome, :yodan, :total]}, :cells=>{:values=>[[:rice_total, :rice, :koji, :alcohol, :water, :lactic_acid], [59.0, 41.0, 18.0, \"\", 63.0, 0.432], [126.0, 90.0, 36.0, \"\", 117.0, \"\"], [248.0, 194.0, 54.0, \"\", 297.0, \"\"], [396.0, 324.0, 72.0, \"\", 567.0, \"\"], [72.0, 72.0, \"\", \"\", 108.0, \"\"], [901.0, 721.0, 180.0, \"\", 1152.0, 0.432]]}}], @layout={:height=>350}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
245
- ]
246
- },
247
- "metadata": {},
248
- "output_type": "display_data"
249
- },
250
- {
251
- "data": {
252
- "text/html": [
253
- "\n",
254
- " <script>\n",
255
- " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
256
- " </script>\n",
257
- "\n",
258
- "\n",
259
- "<div id=\"49661286-297c-4903-b104-ec162ad2613a\" style=\"height: 100%; width: 100%;\"></div>\n",
260
- "\n",
261
- "<script>\n",
262
- " require(['plotly'], function(Plotly) { \n",
263
- "Plotly.newPlot(\n",
264
- " '49661286-297c-4903-b104-ec162ad2613a',\n",
265
- " [{\"type\":\"table\",\"header\":{\"values\":[\"date\",\"moto_koji\",\"moromi_koji\",\"moto\",\"soe\",\"naka\",\"tome\",\"yodan\"]},\"cells\":{\"values\":[[\"02/20\",\"02/21\",\"02/22\",\"02/23\",\"02/24\",\"02/25\",\"02/26\",\"02/27\",\"02/28\",\"02/29\",\"03/01\",\"03/02\",\"03/03\",\"03/04\",\"03/05\",\"03/06\",\"03/07\",\"03/08\",\"03/09\",\"03/10\",\"03/11\",\"03/12\",\"03/13\",\"03/14\",\"03/15\",\"03/16\",\"03/17\",\"03/18\",\"03/19\",\"03/20\",\"03/21\",\"03/22\"],[\"仕3: 21\\u003cbr\\u003e仕4: 18\",\"\",\"\",\"\",\"\",\"\",\"\",\"仕5: 21\\u003cbr\\u003e仕6: 18\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"],[\"\",\"\",\"\",\"\",\"仕1: 140\",\"\",\"\",\"仕2: 128\",\"\",\"\",\"\",\"仕3: 183\",\"\",\"\",\"仕4: 162\",\"\",\"\",\"\",\"仕5: 183\",\"\",\"\",\"仕6: 162\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"],[\"\",\"\",\"\",\"\",\"\",\"仕3: 42\\u003cbr\\u003e仕4: 41\",\"\",\"\",\"\",\"\",\"仕1: 0\",\"\",\"仕2: 0\\u003cbr\\u003e仕5: 42\\u003cbr\\u003e仕6: 41\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"],[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"仕1: 65\",\"\",\"仕2: 60\",\"\",\"\",\"\",\"\",\"仕3: 98\",\"\",\"仕4: 90\",\"\",\"\",\"\",\"\",\"仕5: 98\",\"\",\"仕6: 90\",\"\",\"\",\"\",\"\"],[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"仕1: 150\",\"\",\"\",\"仕2: 138\",\"\",\"\",\"\",\"仕3: 190\",\"\",\"仕4: 194\",\"\",\"\",\"\",\"\",\"仕5: 190\",\"\",\"仕6: 194\",\"\",\"\"],[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"仕1: 245\",\"\",\"\",\"仕2: 225\",\"\",\"\",\"\",\"仕3: 366\",\"\",\"仕4: 324\",\"\",\"\",\"\",\"\",\"仕5: 366\",\"\",\"仕6: 324\",\"\"],[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"仕4: 72\",\"\",\"\",\"\",\"\",\"\",\"\",\"仕6: 72\"]]}}],\n",
266
- " {\"height\":1000},\n",
267
- " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
268
- ")\n",
269
- "\n",
270
- "window.addEventListener('resize', function() {\n",
271
- " Plotly.Plots.resize(document.getElementById('49661286-297c-4903-b104-ec162ad2613a'))\n",
272
- "})\n",
273
- " }) \n",
274
- "</script>"
275
- ],
276
- "text/plain": [
277
- "#<Plotly::Offline::HTML:0x00007f9f639ab050 @id=\"49661286-297c-4903-b104-ec162ad2613a\", @data=[{:type=>:table, :header=>{:values=>[:date, :moto_koji, :moromi_koji, :moto, :soe, :naka, :tome, :yodan]}, :cells=>{:values=>[[\"02/20\", \"02/21\", \"02/22\", \"02/23\", \"02/24\", \"02/25\", \"02/26\", \"02/27\", \"02/28\", \"02/29\", \"03/01\", \"03/02\", \"03/03\", \"03/04\", \"03/05\", \"03/06\", \"03/07\", \"03/08\", \"03/09\", \"03/10\", \"03/11\", \"03/12\", \"03/13\", \"03/14\", \"03/15\", \"03/16\", \"03/17\", \"03/18\", \"03/19\", \"03/20\", \"03/21\", \"03/22\"], [\"仕3: 21<br>仕4: 18\", \"\", \"\", \"\", \"\", \"\", \"\", \"仕5: 21<br>仕6: 18\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"], [\"\", \"\", \"\", \"\", \"仕1: 140\", \"\", \"\", \"仕2: 128\", \"\", \"\", \"\", \"仕3: 183\", \"\", \"\", \"仕4: 162\", \"\", \"\", \"\", \"仕5: 183\", \"\", \"\", \"仕6: 162\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"], [\"\", \"\", \"\", \"\", \"\", \"仕3: 42<br>仕4: 41\", \"\", \"\", \"\", \"\", \"仕1: 0\", \"\", \"仕2: 0<br>仕5: 42<br>仕6: 41\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"], [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"仕1: 65\", \"\", \"仕2: 60\", \"\", \"\", \"\", \"\", \"仕3: 98\", \"\", \"仕4: 90\", \"\", \"\", \"\", \"\", \"仕5: 98\", \"\", \"仕6: 90\", \"\", \"\", \"\", \"\"], [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"仕1: 150\", \"\", \"\", \"仕2: 138\", \"\", \"\", \"\", \"仕3: 190\", \"\", \"仕4: 194\", \"\", \"\", \"\", \"\", \"仕5: 190\", \"\", \"仕6: 194\", \"\", \"\"], [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"仕1: 245\", \"\", \"\", \"仕2: 225\", \"\", \"\", \"\", \"仕3: 366\", \"\", \"仕4: 324\", \"\", \"\", \"\", \"\", \"仕5: 366\", \"\", \"仕6: 324\", \"\"], [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"仕4: 72\", \"\", \"\", \"\", \"\", \"\", \"\", \"仕6: 72\"]]}}], @layout={:height=>1000}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
278
- ]
279
- },
280
- "metadata": {},
281
- "output_type": "display_data"
282
- },
283
- {
284
- "data": {
285
- "text/plain": [
286
- "#<CZTop::Socket::PUB:0x7f9f6818f480 last_endpoint=\"tcp://127.0.0.1:49446\">"
287
- ]
288
- },
289
- "execution_count": 3,
290
- "metadata": {},
291
- "output_type": "execute_result"
292
- }
293
- ],
294
- "source": [
295
- "$LOAD_PATH << File.dirname(__FILE__) + \"/../lib\"\n",
296
- "require 'toji'\n",
297
- "require 'rbplotly'\n",
298
- "\n",
299
- "cal = Toji::Schedule::Calendar.load_yaml_file(\"schedule.yaml\")\n",
300
- "\n",
301
- "cal.products.each {|product|\n",
302
- " puts \"%s %s\" % [product.name, product.description]\n",
303
- " \n",
304
- " product.recipe.table.tap {|t|\n",
305
- " t.layout.height = 350\n",
306
- " }.show\n",
307
- "}\n",
308
- "\n",
309
- "cal.table.tap {|t|\n",
310
- " t.layout.height = 1000\n",
311
- "}.show"
312
- ]
313
- },
314
- {
315
- "cell_type": "code",
316
- "execution_count": null,
317
- "metadata": {},
318
- "outputs": [],
319
- "source": []
320
- }
321
- ],
322
- "metadata": {
323
- "kernelspec": {
324
- "display_name": "Ruby 2.7.0",
325
- "language": "ruby",
326
- "name": "ruby"
327
- },
328
- "language_info": {
329
- "file_extension": ".rb",
330
- "mimetype": "application/x-ruby",
331
- "name": "ruby",
332
- "version": "2.6.3"
333
- }
334
- },
335
- "nbformat": 4,
336
- "nbformat_minor": 2
337
- }
@@ -1,67 +0,0 @@
1
- require 'toji'
2
- require 'terminal-table'
3
-
4
- recipe = Toji::Recipe::ThreeStepMashing::TEMPLATES[:sokujo_nada].scale(900)
5
- step_names = recipe.steps.map(&:name)
6
-
7
- table = Terminal::Table.new do |t|
8
- t << [""] + step_names
9
- t << :separator
10
- t << ["[原料]"]
11
- t << ["酵母(g)", recipe.yeast.yeast&.round(2)]
12
- t << ["酵母吸水", recipe.yeast.water&.round(2)]
13
- t << ["乳酸(ml)"] + recipe.steps.map(&:lactic_acid).map{|v| v&.round(6)}
14
- t << ["掛米(g)"] + recipe.steps.map(&:rice).map(&:raw).map{|v| v&.round(2)}
15
- t << ["麹米(g)"] + recipe.steps.map(&:koji).map(&:raw).map{|v| v&.round(2)}
16
- t << ["汲水(ml)"] + recipe.steps.map(&:water).map{|v| v&.round(2)}
17
- t << ["醸造アルコール(ml)"] + recipe.steps.map(&:alcohol).map{|v| v&.round(2)}
18
- t << :separator
19
- t << ["[合計]"]
20
- t << ["総米(g)"] + recipe.steps.map(&:rice_total).map{|v| v&.round(2)}
21
- t << ["麹歩合(%)"] + recipe.steps.map{|s| s.koji_rate * 100}.map{|v| v&.round(2)}
22
- t << ["汲水歩合(%)"] + recipe.steps.map{|s| s.water_rate * 100}.map{|v| v&.round(2)}
23
- t << :separator
24
- t << ["[累計]"]
25
- t << ["総米(g)"] + recipe.cumulative_rice_totals.map{|v| v&.round(2)}
26
- t << ["白米比率"] + recipe.rice_rates.map{|v| v&.round(2)}
27
- t << ["酒母歩合(%)"] + recipe.cumulative_shubo_rates.map{|s| s * 100}.map{|v| v&.round(2)}
28
- t << ["タンク内容量(ml)"] + recipe.cumulative_weight_totals.map{|v| v&.round(2)}
29
- end
30
- puts table
31
- puts
32
-
33
-
34
- puts "掛米"
35
- table = Terminal::Table.new do |t|
36
- t << ["工程", "原料"] + step_names
37
- t << :separator
38
- t << ["洗米・浸漬", "白米(g)"] + recipe.steps.map(&:rice).map(&:raw).map{|v| v&.round(2)}
39
- t << ["", "吸水増加量(ml)"] + recipe.steps.map(&:rice).map(&:soaking_water).map{|v| v&.round(2)}
40
- t << :separator
41
- t << ["水切り", "浸漬米(g)"] + recipe.steps.map(&:rice).map(&:soaked).map{|v| v&.round(2)}
42
- t << ["", "汲水(ml)"] + recipe.steps.map(&:rice).map(&:steaming_water).map{|v| v&.round(2)}
43
- t << :separator
44
- t << ["蒸し", "蒸米(g)"] + recipe.steps.map(&:rice).map(&:steamed).map{|v| v&.round(2)}
45
- end
46
- puts table
47
- puts
48
-
49
- puts "麹"
50
- table = Terminal::Table.new do |t|
51
- t << ["工程", "原料"] + step_names
52
- t << :separator
53
- t << ["洗米・浸漬", "白米(g)"] + recipe.steps.map(&:koji).map(&:raw).map{|v| v&.round(2)}
54
- t << ["", "吸水増加量(ml)"] + recipe.steps.map(&:koji).map(&:soaking_water).map{|v| v&.round(2)}
55
- t << :separator
56
- t << ["水切り", "浸漬米(g)"] + recipe.steps.map(&:koji).map(&:soaked).map{|v| v&.round(2)}
57
- t << ["", "汲水(ml)"] + recipe.steps.map(&:koji).map(&:steaming_water).map{|v| v&.round(2)}
58
- t << :separator
59
- t << ["蒸し", "蒸米(g)"] + recipe.steps.map(&:koji).map(&:steamed).map{|v| v&.round(2)}
60
- t << :separator
61
- t << ["放冷・引込み", "蒸米(g)"] + recipe.steps.map(&:koji).map(&:cooled).map{|v| v&.round(2)}
62
- t << ["", "種麹(g)"] + recipe.steps.map(&:koji).map(&:tanekoji).map{|v| v&.round(2)}
63
- t << :separator
64
- t << ["製麹", "麹(g)"] + recipe.steps.map(&:koji).map(&:dekoji).map{|v| v&.round(2)}
65
- end
66
- puts table
67
- puts
@@ -1,13 +0,0 @@
1
- module Toji
2
- module Brew
3
- module StateAccessor
4
- def state_reader(*args)
5
- args.each {|arg|
6
- define_method(arg) {
7
- @data[arg]
8
- }
9
- }
10
- end
11
- end
12
- end
13
- end
@@ -1,72 +0,0 @@
1
- module Toji
2
- module Brew
3
- class StateRecord
4
- KEYS = [
5
- :time,
6
- :elapsed_time,
7
- :mark,
8
- :temps,
9
- :preset_temp,
10
- :room_temp,
11
- :room_psychrometry,
12
- :baume,
13
- :nihonshudo,
14
- :acid,
15
- :amino_acid,
16
- :alcohol,
17
- :warmings,
18
- :note,
19
- ].freeze
20
-
21
- attr_accessor :time
22
- attr_accessor :elapsed_time
23
- attr_accessor :mark
24
- attr_accessor :temps
25
-
26
- attr_accessor :preset_temp
27
- attr_accessor :room_temp
28
- attr_accessor :room_psychrometry
29
-
30
- attr_accessor :baume
31
- attr_accessor :nihonshudo
32
- attr_accessor :acid
33
- attr_accessor :amino_acid
34
- attr_accessor :alcohol
35
-
36
- attr_accessor :warmings
37
- attr_accessor :note
38
-
39
- def temps=(val)
40
- @temps = [val].flatten.compact
41
- end
42
-
43
- def time=(val)
44
- @time = val&.to_time
45
- end
46
-
47
- def warmings=(val)
48
- @warmings = [val].flatten.compact
49
- end
50
-
51
- def self.create(r)
52
- if StateRecord===r
53
- r
54
- elsif State==r
55
- r.record
56
- elsif Hash===r
57
- record = new
58
- KEYS.each {|k|
59
- record.send("#{k}=", r[k])
60
- }
61
- record
62
- else
63
- record = new
64
- KEYS.each {|k|
65
- record.send("#{k}=", r.send(k))
66
- }
67
- record
68
- end
69
- end
70
- end
71
- end
72
- end