|
20 | 20 | }, |
21 | 21 | { |
22 | 22 | "cell_type": "code", |
23 | | - "execution_count": 2, |
| 23 | + "execution_count": 7, |
24 | 24 | "id": "bccf1e85", |
25 | 25 | "metadata": {}, |
26 | 26 | "outputs": [], |
|
90 | 90 | }, |
91 | 91 | { |
92 | 92 | "cell_type": "code", |
93 | | - "execution_count": 3, |
| 93 | + "execution_count": 9, |
94 | 94 | "id": "33ca4042", |
95 | 95 | "metadata": {}, |
96 | 96 | "outputs": [ |
97 | 97 | { |
98 | 98 | "data": { |
99 | 99 | "text/html": [ |
100 | | - "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Connecting engine server -> <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://absbox.org/api/dev</span>\n", |
| 100 | + "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Connecting engine server -> <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">http://localhost:8081</span>\n", |
101 | 101 | "</pre>\n" |
102 | 102 | ], |
103 | 103 | "text/plain": [ |
104 | | - "Connecting engine server -> \u001b[4;94mhttps://absbox.org/api/dev\u001b[0m\n" |
| 104 | + "Connecting engine server -> \u001b[4;94mhttp://localhost:8081\u001b[0m\n" |
105 | 105 | ] |
106 | 106 | }, |
107 | 107 | "metadata": {}, |
108 | 108 | "output_type": "display_data" |
109 | 109 | }, |
110 | | - { |
111 | | - "name": "stderr", |
112 | | - "output_type": "stream", |
113 | | - "text": [ |
114 | | - "/home/xiaoyu/repo/AbsBox/lib/python3.13/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'absbox.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings\n", |
115 | | - " warnings.warn(\n" |
116 | | - ] |
117 | | - }, |
118 | 110 | { |
119 | 111 | "data": { |
120 | 112 | "text/html": [ |
|
135 | 127 | }, |
136 | 128 | { |
137 | 129 | "cell_type": "code", |
138 | | - "execution_count": 4, |
139 | | - "id": "83f7a2f5", |
| 130 | + "execution_count": 10, |
| 131 | + "id": "affc23dc-659d-46da-8432-e5043c7c77f7", |
140 | 132 | "metadata": {}, |
141 | 133 | "outputs": [ |
142 | 134 | { |
143 | | - "name": "stderr", |
144 | | - "output_type": "stream", |
145 | | - "text": [ |
146 | | - "/home/xiaoyu/repo/AbsBox/lib/python3.13/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'absbox.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings\n", |
147 | | - " warnings.warn(\n" |
148 | | - ] |
149 | | - }, |
| 135 | + "data": { |
| 136 | + "text/plain": [ |
| 137 | + "{'BeginDistributionWF': {'periodTest': {'trgName': '',\n", |
| 138 | + " 'trgCondition': {'tag': 'IfRateByPeriodCurve',\n", |
| 139 | + " 'contents': ['GE',\n", |
| 140 | + " {'tag': 'CumulativePoolDefaultedRate', 'contents': None},\n", |
| 141 | + " {'tag': 'DealStatInt', 'contents': 'BondPaidPeriod'},\n", |
| 142 | + " {'tag': 'CurrentVal',\n", |
| 143 | + " 'contents': [[0, 0.014], [12, 0.035], [24, 0.06]]}]},\n", |
| 144 | + " 'trgEffects': {'tag': 'DealStatusTo',\n", |
| 145 | + " 'contents': {'tag': 'Ended', 'contents': None}},\n", |
| 146 | + " 'trgStatus': False,\n", |
| 147 | + " 'trgCurable': False}}}" |
| 148 | + ] |
| 149 | + }, |
| 150 | + "execution_count": 10, |
| 151 | + "metadata": {}, |
| 152 | + "output_type": "execute_result" |
| 153 | + } |
| 154 | + ], |
| 155 | + "source": [ |
| 156 | + "test01.json['contents']['triggers']" |
| 157 | + ] |
| 158 | + }, |
| 159 | + { |
| 160 | + "cell_type": "code", |
| 161 | + "execution_count": 11, |
| 162 | + "id": "83f7a2f5", |
| 163 | + "metadata": {}, |
| 164 | + "outputs": [ |
150 | 165 | { |
151 | | - "ename": "EngineError", |
152 | | - "evalue": "Error in $.triggers.BeginDistributionWF.periodTest.trgEffects: key \"contents\" not found", |
153 | | - "output_type": "error", |
154 | | - "traceback": [ |
155 | | - "\u001b[31m---------------------------------------------------------------------------\u001b[39m", |
156 | | - "\u001b[31mEngineError\u001b[39m Traceback (most recent call last)", |
157 | | - "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[4]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m r = \u001b[43mlocalAPI\u001b[49m\u001b[43m.\u001b[49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtest01\u001b[49m\n\u001b[32m 2\u001b[39m \u001b[43m \u001b[49m\u001b[43m,\u001b[49m\u001b[43mpoolAssump\u001b[49m\u001b[43m \u001b[49m\u001b[43m=\u001b[49m\u001b[43m \u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mPool\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mMortgage\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m{\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mCDR\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[32;43m0.02\u001b[39;49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[32m 3\u001b[39m \u001b[43m \u001b[49m\u001b[43m,\u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\n\u001b[32m 4\u001b[39m \u001b[43m \u001b[49m\u001b[43m,\u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[32m 5\u001b[39m \u001b[43m \u001b[49m\u001b[43m,\u001b[49m\u001b[43mread\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n", |
158 | | - "\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/absbox/client.py:357\u001b[39m, in \u001b[36mAPI.run\u001b[39m\u001b[34m(self, deal, poolAssump, runAssump, read, showWarning, rtn, debug)\u001b[39m\n\u001b[32m 354\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m debug:\n\u001b[32m 355\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m req\n\u001b[32m--> \u001b[39m\u001b[32m357\u001b[39m result = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_send_req\u001b[49m\u001b[43m(\u001b[49m\u001b[43mreq\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 359\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m result \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mor\u001b[39;00m \u001b[33m'\u001b[39m\u001b[33merror\u001b[39m\u001b[33m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m result \u001b[38;5;129;01mor\u001b[39;00m \u001b[33m'\u001b[39m\u001b[33mLeft\u001b[39m\u001b[33m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m result:\n\u001b[32m 360\u001b[39m leftVal = result.get(\u001b[33m\"\u001b[39m\u001b[33mLeft\u001b[39m\u001b[33m\"\u001b[39m,\u001b[33m\"\u001b[39m\u001b[33m\"\u001b[39m)\n", |
159 | | - "\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/absbox/client.py:825\u001b[39m, in \u001b[36mAPI._send_req\u001b[39m\u001b[34m(self, _req, _url, timeout, headers)\u001b[39m\n\u001b[32m 823\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m AbsboxError(\u001b[33m\"\u001b[39m\u001b[33m❌ Failed to get response from server\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 824\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m r.status_code != \u001b[32m200\u001b[39m:\n\u001b[32m--> \u001b[39m\u001b[32m825\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m EngineError(r)\n\u001b[32m 826\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 827\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m json.loads(r.text)\n", |
160 | | - "\u001b[31mEngineError\u001b[39m: Error in $.triggers.BeginDistributionWF.periodTest.trgEffects: key \"contents\" not found" |
161 | | - ] |
| 166 | + "data": { |
| 167 | + "text/html": [ |
| 168 | + "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Warning Message from server:Bond A1 is not paid off\n", |
| 169 | + "Bond B is not paid off\n", |
| 170 | + "Oustanding pool cashflow hasn't been collected yetfromList <span style=\"font-weight: bold\">[(</span>PoolConsol,<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">20</span><span style=\"font-weight: bold\">)]</span>\n", |
| 171 | + "</pre>\n" |
| 172 | + ], |
| 173 | + "text/plain": [ |
| 174 | + "Warning Message from server:Bond A1 is not paid off\n", |
| 175 | + "Bond B is not paid off\n", |
| 176 | + "Oustanding pool cashflow hasn't been collected yetfromList \u001b[1m[\u001b[0m\u001b[1m(\u001b[0mPoolConsol,\u001b[1;36m20\u001b[0m\u001b[1m)\u001b[0m\u001b[1m]\u001b[0m\n" |
| 177 | + ] |
| 178 | + }, |
| 179 | + "metadata": {}, |
| 180 | + "output_type": "display_data" |
162 | 181 | } |
163 | 182 | ], |
164 | 183 | "source": [ |
|
171 | 190 | }, |
172 | 191 | { |
173 | 192 | "cell_type": "code", |
174 | | - "execution_count": 22, |
| 193 | + "execution_count": 12, |
175 | 194 | "id": "315c009c", |
176 | 195 | "metadata": {}, |
177 | 196 | "outputs": [ |
|
209 | 228 | " <tr>\n", |
210 | 229 | " <th>2021-07-26</th>\n", |
211 | 230 | " <td>False</td>\n", |
212 | | - " <td><Tag:Right 6.290909090909091e-3 GE Just 1.4e-2></td>\n", |
| 231 | + " <td><Tag:Right 6.290909090909091e-3 >= Just 1.4e-2></td>\n", |
213 | 232 | " </tr>\n", |
214 | 233 | " <tr>\n", |
215 | 234 | " <th>2021-08-20</th>\n", |
216 | 235 | " <td>False</td>\n", |
217 | | - " <td><Tag:Right 7.736363636363637e-3 GE Just 1.4e-2></td>\n", |
| 236 | + " <td><Tag:Right 7.736363636363637e-3 >= Just 1.4e-2></td>\n", |
218 | 237 | " </tr>\n", |
219 | 238 | " <tr>\n", |
220 | 239 | " <th>2021-09-20</th>\n", |
221 | 240 | " <td>False</td>\n", |
222 | | - " <td><Tag:Right 9.172727272727273e-3 GE Just 1.4e-2></td>\n", |
| 241 | + " <td><Tag:Right 9.172727272727273e-3 >= Just 1.4e-2></td>\n", |
223 | 242 | " </tr>\n", |
224 | 243 | " <tr>\n", |
225 | 244 | " <th>2021-10-20</th>\n", |
226 | 245 | " <td>False</td>\n", |
227 | | - " <td><Tag:Right 1.0554545454545455e-2 GE Just 1.4e-2></td>\n", |
| 246 | + " <td><Tag:Right 1.0554545454545455e-2 >= Just 1.4e-2></td>\n", |
228 | 247 | " </tr>\n", |
229 | 248 | " <tr>\n", |
230 | 249 | " <th>2021-11-20</th>\n", |
231 | 250 | " <td>False</td>\n", |
232 | | - " <td><Tag:Right 1.1836363636363636e-2 GE Just 1.4e-2></td>\n", |
| 251 | + " <td><Tag:Right 1.1836363636363636e-2 >= Just 1.4e-2></td>\n", |
233 | 252 | " </tr>\n", |
234 | 253 | " <tr>\n", |
235 | 254 | " <th>2021-12-20</th>\n", |
236 | 255 | " <td>False</td>\n", |
237 | | - " <td><Tag:Right 1.3109090909090909e-2 GE Just 1.4e-2></td>\n", |
| 256 | + " <td><Tag:Right 1.3109090909090909e-2 >= Just 1.4e-2></td>\n", |
238 | 257 | " </tr>\n", |
239 | 258 | " <tr>\n", |
240 | 259 | " <th>2022-01-20</th>\n", |
241 | 260 | " <td>True</td>\n", |
242 | | - " <td><Tag:Right 1.4281818181818182e-2 GE Just 1.4e-2></td>\n", |
| 261 | + " <td><Tag:Right 1.4281818181818182e-2 >= Just 1.4e-2></td>\n", |
243 | 262 | " </tr>\n", |
244 | 263 | " </tbody>\n", |
245 | 264 | "</table>\n", |
|
248 | 267 | "text/plain": [ |
249 | 268 | " status memo\n", |
250 | 269 | "date \n", |
251 | | - "2021-07-26 False <Tag:Right 6.290909090909091e-3 GE Just 1.4e-2>\n", |
252 | | - "2021-08-20 False <Tag:Right 7.736363636363637e-3 GE Just 1.4e-2>\n", |
253 | | - "2021-09-20 False <Tag:Right 9.172727272727273e-3 GE Just 1.4e-2>\n", |
254 | | - "2021-10-20 False <Tag:Right 1.0554545454545455e-2 GE Just 1.4e-2>\n", |
255 | | - "2021-11-20 False <Tag:Right 1.1836363636363636e-2 GE Just 1.4e-2>\n", |
256 | | - "2021-12-20 False <Tag:Right 1.3109090909090909e-2 GE Just 1.4e-2>\n", |
257 | | - "2022-01-20 True <Tag:Right 1.4281818181818182e-2 GE Just 1.4e-2>" |
| 270 | + "2021-07-26 False <Tag:Right 6.290909090909091e-3 >= Just 1.4e-2>\n", |
| 271 | + "2021-08-20 False <Tag:Right 7.736363636363637e-3 >= Just 1.4e-2>\n", |
| 272 | + "2021-09-20 False <Tag:Right 9.172727272727273e-3 >= Just 1.4e-2>\n", |
| 273 | + "2021-10-20 False <Tag:Right 1.0554545454545455e-2 >= Just 1.4e-2>\n", |
| 274 | + "2021-11-20 False <Tag:Right 1.1836363636363636e-2 >= Just 1.4e-2>\n", |
| 275 | + "2021-12-20 False <Tag:Right 1.3109090909090909e-2 >= Just 1.4e-2>\n", |
| 276 | + "2022-01-20 True <Tag:Right 1.4281818181818182e-2 >= Just 1.4e-2>" |
258 | 277 | ] |
259 | 278 | }, |
260 | | - "execution_count": 22, |
| 279 | + "execution_count": 12, |
261 | 280 | "metadata": {}, |
262 | 281 | "output_type": "execute_result" |
263 | 282 | } |
264 | 283 | ], |
265 | 284 | "source": [ |
266 | 285 | "r['triggers']['BeginDistributionWF']['periodTest']" |
267 | 286 | ] |
| 287 | + }, |
| 288 | + { |
| 289 | + "cell_type": "code", |
| 290 | + "execution_count": null, |
| 291 | + "id": "c3613ed9-381c-471e-80fd-01a2d25ac7ed", |
| 292 | + "metadata": {}, |
| 293 | + "outputs": [], |
| 294 | + "source": [] |
268 | 295 | } |
269 | 296 | ], |
270 | 297 | "metadata": { |
|
0 commit comments