Skip to content
New issue

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

Feet And Inches 1.0 #37

Open
wants to merge 53 commits into
base: master
Choose a base branch
from

Conversation

Randall-Scharpf
Copy link
Contributor

Fixes #22
The head of this PR is a direct future from the head of #27, so that issue should probably be merged first. Similarly, if there are issues with either PR, they can both be corrected on this request.
A considerable number of test cases has been given, considering the complexity and the density of special cases in this pull request.
It is also worth noting that because of the degree of complexity of this feature, the number of data structures in the code has multiplied, the number of functions has ballooned, and the simplicity of many functions has been lost. The test cases still run in only a few milliseconds, so the observed efficiency hit is small, but it is not negligible and this implementation should not be claimed to be optimal. However, this code is fully functional, so readability-enhancing and maintainability-enhancing refactors would, at this point, be simply extra. The same is true of any efficiency-improving refactors.
Currently, all the unit tests of this portion use input strings and output strings from the main method in unitconversions.py. It is worth considering to add test cases for the submethods, or to add test cases that only inspect certain aspects of the input and output strings, but again, at this point I believe, due to the full functionality of this feature, that such tests would be simply extra.
In any case, here's Feet And Inches 1,0!

create numSigFigs()
use function to set flag for number of significant figures
create numSigFigs()
use function to set flag for number of significant figures

rebase to beta
make the old test cases actually follow sig figs
this behavior is used with temperature scales
allows better expandability
fixes bugs related to NaN and zero
stophittingyourselfstophittingyourselfstophittingyourself
stophittingyourselfstophittingyourselfstophittingyourself
note to self dont rebase in the wrong direction, its painful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combined inch-foot mentions should be combined into one conversion of distance.
1 participant