We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug RiskMeasure.from_dict(IRFwdRate.as_dict()) == IRFwdRate Returns False. Arguably this should return True.
What is the correct way to check for RiskMeasure equality?
For example: RiskMeasure.from_dict(IRFwdRate.as_dict()).measure_type == IRFwdRate.measure_type returns True, but this feels a little clunky.
I ask as I'd like to write code like: if risk_measure in (IRFwdRate, IRSpotRate, etc, etc):
where risk_measure has been created by RiskMeasure.from_dict(some_measure.as_dict()).
To Reproduce from gs_quant.risk import IRFwdRate from gs_quant.target.risk import RiskMeasure RiskMeasure.from_dict(IRFwdRate.as_dict()) == IRFwdRate
Returns False.
Expected behavior RiskMeasure.from_dict(IRFwdRate.as_dict()) == IRFwdRate to return True.
OR please explain how I should compare RiskMeasure types
The text was updated successfully, but these errors were encountered:
@AnastasiyaB Any thoughts on this? RiskMeasure.from_dict(IRFwdRate.as_dict()) != IRFwdRate feels a bit icky...
Sorry, something went wrong.
andrewphillipsn
No branches or pull requests
Describe the bug
RiskMeasure.from_dict(IRFwdRate.as_dict()) == IRFwdRate
Returns False. Arguably this should return True.
What is the correct way to check for RiskMeasure equality?
For example:
RiskMeasure.from_dict(IRFwdRate.as_dict()).measure_type == IRFwdRate.measure_type
returns True, but this feels a little clunky.
I ask as I'd like to write code like:
if risk_measure in (IRFwdRate, IRSpotRate, etc, etc):
where risk_measure has been created by RiskMeasure.from_dict(some_measure.as_dict()).
To Reproduce
from gs_quant.risk import IRFwdRate
from gs_quant.target.risk import RiskMeasure
RiskMeasure.from_dict(IRFwdRate.as_dict()) == IRFwdRate
Returns False.
Expected behavior
RiskMeasure.from_dict(IRFwdRate.as_dict()) == IRFwdRate to return True.
OR please explain how I should compare RiskMeasure types
The text was updated successfully, but these errors were encountered: