This PR adds additional validation to the validate method in the AnalysisSerializer, to give immediate feedback to the user as to why the calculation failed. Namely, only one of (inflation rate, real or nominal discount rates) were provided. This will throw a ValidationError with a message.
Motivation and Context
At least two in (inflation rate, real discount rate, nominal discount rate) must be provided to calculate Analysis. However, in some cases, providing only one of these variables gets past validation, and throws an AssertionError in Analysis.py. This should be caught by the serializer validator so that feedback is given to the user as to why the calculation failed.
Description
This PR adds additional validation to the
validate
method in theAnalysisSerializer
, to give immediate feedback to the user as to why the calculation failed. Namely, only one of (inflation rate, real or nominal discount rates) were provided. This will throw aValidationError
with a message.Motivation and Context
At least two in (inflation rate, real discount rate, nominal discount rate) must be provided to calculate Analysis. However, in some cases, providing only one of these variables gets past validation, and throws an AssertionError in Analysis.py. This should be caught by the serializer validator so that feedback is given to the user as to why the calculation failed.
Closes #21