genedan / TmVal

Time Value of Money - a Python package for mathematical interest theory, annuity, and bond calculations.
https://genedan.com/tmval/docs
GNU General Public License v3.0
30 stars 4 forks source link

refactor cases for convert_rate #24

Closed genedan closed 4 years ago

genedan commented 4 years ago

convert_rate can be refactored to reduce the number of cases

we should have an if/else for the known patterns, each of which then calls its own specialized conversion function (which I need to make) for the case.

for example, there are 4 x 4 different cases for the 4 different patterns, if each pattern had its own function for converting to the other patterns, we'd need just 4 cases, otherwise the function will grow exponentially as we discover more patterns

genedan commented 4 years ago

solved yesterday