@@ -668,36 +668,23 @@ def runFirstLoss(self, deal, bName, poolAssump=None, runAssump=[], read=True, de
668668 :return: result of run, a dict of dataframe if `read` is True.
669669 :rtype: dict
670670 """
671-
672- if (poolAssump is None ):
673- raise AbsboxError (f"❌ poolAssump must be set for first loss run" )
674-
675- url = f"{ self .url } /{ Endpoints .RunRootFinder .value } "
676-
677- req = self .build_run_deal_req (("FL" , bName ), deal , poolAssump , runAssump )
678-
679- if debug :
680- return req
681-
682- result = self ._send_req (req , url )
683-
684- if result is None or 'error' in result or 'Left' in result :
685- leftVal = result .get ("Left" ,"" )
686- raise AbsboxError (f"❌ Failed to get response from run: { leftVal } " )
687-
688- if read :
689- return readAeson (result ['Right' ])
690- else :
691- result ['Right' ]
671+ return self .runRootFinder (deal , poolAssump , runAssump , ("firstLoss" , bName ), read , debug )
692672
693673 def runRootFinder (self , deal , poolAssump , runAssump , p , read = True , debug = False ) -> dict :
694674 """run root finder with deal and pool assumptions
695-
675+ :param deal: a deal object
676+ :type deal: Generic | SPV
677+ :param poolAssump: pool performance assumption, a tuple for single run/ a dict for multi-scenario run, defaults to None
678+ :type poolAssump: tuple, optional
679+ :param runAssump: deal level assumption, defaults to []
680+ :type runAssump: list, optional
681+ :param p: a tuple of root finder parameters
682+ :type p: tuple/string
696683 :param read: flag to convert result to pandas dataframe, defaults to True
697684 :type read: bool, optional
698685 :param debug: return request text instead of sending out such request, defaults to False
699686 :type debug: bool, optional
700- :return: result of run, a dict of dataframe if `read` is True.
687+ :return: result of run
701688 :rtype: dict
702689 """
703690
0 commit comments