Skip to content

Commit e9fd5e7

Browse files
committed
notebook fix
1 parent 3f39a14 commit e9fd5e7

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

absbox/local/cf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def readInspect(r:dict) -> pd.DataFrame:
164164
else:
165165
u = pd.DataFrame()
166166

167-
w = r['waterfallInspect'].to_records() if ('waterfallInspect' in r and r['waterfallInspect']) else []
167+
w = r['waterfallInspect'].to_records() if ('waterfallInspect' in r and (not r['waterfallInspect'].empty)) else []
168168
wdf = tz.pipe(tz.groupby(lambda x:tz.nth(2,x), w)
169169
,lambda m: tz.valmap(lambda xs: [ (_[1],_[4]) for _ in xs],m)
170170
,lambda m: tz.valmap(lambda xs: pd.DataFrame(xs, columns =['Date', 'val']).set_index('Date'),m)

absbox/local/component.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ def mkFieldRule(z):
17151715
case ("ById",ids,assumps)| ("ByID",ids,assumps):
17161716
return mkTag(("ObligorById",[[vStr(i) for i in ids],mkPDF(*assumps)]))
17171717
case ("ByTag", tags, rule, assumps):
1718-
return mkTag(("ObligorByTag",[lmap(mkRule,tags), mkRule(rule),mkPDF(*assumps)]))
1718+
return mkTag(("ObligorByTag",[tags, mkRule(rule),mkPDF(*assumps)]))
17191719
case ("ByField", fieldRules, assumps):
17201720
return mkTag(("ObligorByField",[lmap(mkFieldRule,fieldRules),mkPDF(*assumps)]))
17211721
case ("ByDefault",assumps) | ("_",assumps):

docs/source/nbsample/AccountSetup.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@
776776
}
777777
],
778778
"source": [
779-
"readAccsCf(r['agg_accounts']).loc[\"2021-08-20\":\"2021-10-20\"]"
779+
"readAccsCf(r['accounts']).loc[\"2021-08-20\":\"2021-10-20\"]"
780780
]
781781
},
782782
{
@@ -1430,7 +1430,7 @@
14301430
}
14311431
],
14321432
"source": [
1433-
"readAccsCf(r2['agg_accounts']).loc[:\"2022-10-20\"]"
1433+
"readAccsCf(r2['accounts']).loc[:\"2022-10-20\"]"
14341434
]
14351435
},
14361436
{

docs/source/nbsample/MultiRunAssumption.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@
287287
}
288288
],
289289
"source": [
290-
"r[\"A\"][\"pool\"]['flow'].tail()"
290+
"r[\"A\"][\"pool\"]['flow']['PoolConsol'].tail()"
291291
]
292292
},
293293
{
@@ -486,7 +486,7 @@
486486
}
487487
],
488488
"source": [
489-
"r[\"B\"][\"pool\"]['flow'].tail()"
489+
"r[\"B\"][\"pool\"]['flow']['PoolConsol'].tail()"
490490
]
491491
},
492492
{

docs/source/nbsample/run_deal.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
},
118118
"outputs": [],
119119
"source": [
120-
"r['00']['pool']['flow'].head()"
120+
"r['00']['pool']['flow']['PoolConsol'].head()"
121121
]
122122
},
123123
{
@@ -129,7 +129,7 @@
129129
},
130130
"outputs": [],
131131
"source": [
132-
"r['stressed']['pool']['flow'].head()"
132+
"r['stressed']['pool']['flow']['PoolConsol'].head()"
133133
]
134134
},
135135
{

docs/source/nbsample/single_mortgage.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"source": [
4343
"from absbox import API,EnginePath\n",
4444
"\n",
45-
"localAPI = API(EnginePath.LOCAL,lang='english',check=False)"
45+
"localAPI = API(EnginePath.DEV,lang='english',check=False)"
4646
]
4747
},
4848
{

docs/source/nbsample/viewMultiResult.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@
390390
}
391391
],
392392
"source": [
393-
"readFlowsByScenarios(rs2, lens['pool']['flow']['Prepayment']).head()"
393+
"readFlowsByScenarios(rs2, lens['pool']['flow']['PoolConsol']['Prepayment']).head()"
394394
]
395395
},
396396
{
@@ -510,7 +510,7 @@
510510
],
511511
"source": [
512512
"readMultiFlowsByScenarios(rs2\n",
513-
" , (lens['pool']['flow'],[\"Balance\",'Prepayment'])).head()"
513+
" , (lens['pool']['flow']['PoolConsol'],[\"Balance\",'Prepayment'])).head()"
514514
]
515515
},
516516
{
@@ -879,7 +879,7 @@
879879
}
880880
],
881881
"source": [
882-
"readFieldsByScenarios(rs2, lens['pool']['flow'], 'Prepayment', flip=True)"
882+
"readFieldsByScenarios(rs2, lens['pool']['flow']['PoolConsol'], 'Prepayment', flip=True)"
883883
]
884884
},
885885
{
@@ -1032,7 +1032,7 @@
10321032
}
10331033
],
10341034
"source": [
1035-
"readFieldsByScenarios(rs2, lens['pool']['flow'], '2021-10-01')"
1035+
"readFieldsByScenarios(rs2, lens['pool']['flow']['PoolConsol'], '2021-10-01')"
10361036
]
10371037
}
10381038
],

docs/source/nbsample/viewMultipleCfs.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@
12331233
}
12341234
],
12351235
"source": [
1236-
"readAccsCf(r['agg_accounts'])"
1236+
"readAccsCf(r['accounts'])"
12371237
]
12381238
},
12391239
{

0 commit comments

Comments
 (0)