|
From: Ben W. <ben...@ma...> - 2021-10-05 07:04:59
|
Worked it out – they are just enumerated types not functions…
def roll_conventions(convention):
if convention in ['Following','F']:
return ql.Following
if convention in ['ModifiedFollowing','MF']:
return ql.ModifiedFollowing
if convention in ['Preceding' ,'P']:
return ql.Preceding
if convention in ['ModifiedPreceding','MP']:
return ql.ModifiedPreceding
if convention in ['Unadjusted','U']:
return ql.Unadjusted
return
From: Ben Watson <ben...@ma...>
Sent: Tuesday, 5 October 2021 5:27 PM
To: qua...@li...
Subject: QL Python - 'int' object is not callable
HiHi,
I have a simple python function to return the roll date conventions, but get 'int' object is not callable. Very odd – any work around?
def roll_conventions(convention):
if convention in ['Following','F']:
return ql.Following()
if convention in ['ModifiedFollowing','MF']:
return ql.ModifiedFollowing()
if convention in ['Preceding' ,'P']:
return ql.Preceding()
if convention in ['ModifiedPreceding','MP']:
return ql.ModifiedPreceding()
if convention in ['Unadjusted','U']:
return ql.Unadjusted()
return
Regards
Ben
|