I've had this idea for some time, but I decided to implement it today.
You use it like this:
pymodcalc <module> <module args>
<module> can be any module found in the modules sub directory.
to create your own module, create a python file in the modules directory using this
<your module name>.py
Then, in that file, define these two functions:
use print() to print out how to use your modules
currently there are no restrictions on what you can print
you should use the variable argument list
and raise a CalculationError (availible from helpers.calcerror)
with your reason. You can use CalculationError for whatever
problems you encounter while doing the calculation.
when you have the final result, return it.
Once you've done that, you can use it with pymodcalc, and do a pull request on BitBucket to get it included!
Modules availible currently:
add - add all numbers passed to it
subtract - subtract subsequent numbers from the first number
wcf - calculate Wind Chill Factor, may not be working right
complex - does equations in python, must follow python syntax, has math and decimal availible
dd_dms - Convert decimal degrees to degrees, minutes, and seconds, and back.
You can clone it from mecurial here: https://bitbucket.org/mnordland/pymodca … lc.tar.bz2
Last edited by mpnordland (2012-11-30 16:37:10)
New Module: dd_dms
Convert decimal degrees to degrees, minutes, and seconds, and back.