Skip to content

Commit

Permalink
url -> self.url in checkConditions print logic. fixed #539 (#540)
Browse files Browse the repository at this point in the history
* url -> self.url in checkConditions print logic. fixed #539

* further fixes to bugs introduced in checkConditions refactor
  • Loading branch information
sbenthall authored Feb 24, 2020
1 parent 5f19fb7 commit 8e94853
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions HARK/ConsumptionSaving/ConsIndShockModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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



Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -2275,15 +2275,15 @@ 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
self.violated = True
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):
Expand Down Expand Up @@ -2314,15 +2314,15 @@ 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
self.violated = True
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):
Expand Down Expand Up @@ -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()


Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8e94853

Please sign in to comment.