From 8e948537d6ac54a3f29db8cb6948fe47c514a392 Mon Sep 17 00:00:00 2001 From: Sebastian Benthall Date: Mon, 24 Feb 2020 07:10:24 -0500 Subject: [PATCH] url -> self.url in checkConditions print logic. fixed #539 (#540) * url -> self.url in checkConditions print logic. fixed #539 * further fixes to bugs introduced in checkConditions refactor --- HARK/ConsumptionSaving/ConsIndShockModel.py | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/HARK/ConsumptionSaving/ConsIndShockModel.py b/HARK/ConsumptionSaving/ConsIndShockModel.py index 7813703f2..a4f78e83f 100644 --- a/HARK/ConsumptionSaving/ConsIndShockModel.py +++ b/HARK/ConsumptionSaving/ConsIndShockModel.py @@ -1900,7 +1900,7 @@ def checkRIC(self, thorn,verbose,public_call): Evaluate and report on the Return Impatience Condition ''' - RIF = Thorn/self.Rfree + RIF = thorn/self.Rfree self.RIF = RIF if RIF<1: self.RIC = True @@ -1942,9 +1942,9 @@ def checkFHWC(self,verbose,public_call): if verbose: print('Therefore, the limiting consumption function is c(m)=Infinity for all m') print() - if verbose and violated and verbose_reference: + if verbose and self.violated and verbose_reference: print('[!] For more information on the conditions, see Table 3 in "Theoretical Foundations of Buffer Stock Saving" at http://econ.jhu.edu/people/ccarroll/papers/BufferStockTheory/') - return violated + return self.violated @@ -1975,7 +1975,7 @@ def checkConditions(self,verbose=False,verbose_reference=False,public_call=False return Thorn = (self.Rfree*self.DiscFac*self.LivPrb[0])**(1/self.CRRA) - self.Thorn = thorn + self.Thorn = Thorn self.checkAIC(Thorn,verbose,public_call) self.checkGICPF(Thorn,verbose,public_call) @@ -2275,7 +2275,7 @@ def checkGICInd(self,Thorn,verbose,public_call): if public_call or verbose: print('The value of the Individual Growth Impatience Factor for the supplied parameter values satisfies the Individual Growth Impatience Condition.', end = " ") if verbose: - print('Therefore, a target level of the individual market resources ratio m exists (see '+url+'/#onetarget for more).') + print('Therefore, a target level of the individual market resources ratio m exists (see '+self.url+'/#onetarget for more).') print() else: self.GICInd = False @@ -2283,7 +2283,7 @@ def checkGICInd(self,Thorn,verbose,public_call): print('The given parameter values violate the Individual Growth Impatience Condition; the GIFInd is: %2.4f' % (self.GIFInd), end = " ") if verbose: print('') - print('Therefore, a target ratio of individual market resources to individual permanent income does not exist. (see '+url+'/#onetarget for more).') + print('Therefore, a target ratio of individual market resources to individual permanent income does not exist. (see '+self.url+'/#onetarget for more).') print() def checkCIGAgg(self, Thorn,verbose,public_call): @@ -2314,7 +2314,7 @@ def checkWRIC(self, verbose,public_call): if WRIF<=1: self.WRIC = True if public_call or verbose: - print('The Weak Return Impatience Factor value for the supplied parameter values satisfies the Weak Return Impatience Condition (see '+url+'/#WRIC for more).') + print('The Weak Return Impatience Factor value for the supplied parameter values satisfies the Weak Return Impatience Condition (see '+self.url+'/#WRIC for more).') print() else: self.WRIC = False @@ -2322,7 +2322,7 @@ def checkWRIC(self, verbose,public_call): print('The given type violates the Weak Return Impatience Condition with the supplied parameter values. The WRIF is: %2.4f' % (WRIF), end = " ") if verbose: print('') - print('Therefore, a nondegenerate solution is not available (see '+url+'/#WRIC for more.') + print('Therefore, a nondegenerate solution is not available (see '+self.url+'/#WRIC for more.') print() def checkFVAC(self,verbose,public_call): @@ -2350,7 +2350,7 @@ def checkFVAC(self,verbose,public_call): print('The given type violates the Finite Value of Autarky Condition with the supplied parameter values. The FVAF is %2.4f' %(FVAF), end = " ") self.violated = True if public_call or verbose: - print('Therefore, a nondegenerate solution is not available (see '+url+'/#Conditions-Under-Which-the-Problem-Defines-a-Contraction-Mapping') + print('Therefore, a nondegenerate solution is not available (see '+self.url+'/#Conditions-Under-Which-the-Problem-Defines-a-Contraction-Mapping') print() @@ -2383,7 +2383,7 @@ def checkConditions(self,verbose=False,public_call=True): # For theory, see hyperlink targets to expressions in # url=http://econ.jhu.edu/people/ccarroll/papers/BufferStockTheory # For example, the hyperlink to the relevant section of the paper - url='http://econ.jhu.edu/people/ccarroll/papers/BufferStockTheory' + self.url='http://econ.jhu.edu/people/ccarroll/papers/BufferStockTheory' # would be referenced below as: # [url]/#Uncertainty-Modified-Conditions @@ -2418,7 +2418,7 @@ def checkConditions(self,verbose=False,public_call=True): self.checkWRIC(verbose,public_call) if verbose and self.violated: - print('\n[!] For more information on the conditions, see Tables 3 and 4 in "Theoretical Foundations of Buffer Stock Saving" at '+url+'/#Factors-Defined-And-Compared') + print('\n[!] For more information on the conditions, see Tables 3 and 4 in "Theoretical Foundations of Buffer Stock Saving" at '+self.url+'/#Factors-Defined-And-Compared') print('') if verbose: