diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-03-02 18:18:35 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-03-04 09:56:50 -0500 |
commit | fa07be93463d9ce0262ae383259e68eea625bc4d (patch) | |
tree | ec028add97cd891fe9ebd85b140c1219e062eaaa /klippy/extras/bed_tilt.py | |
parent | 7290ed5f73f4c649099fec5b13cd7c3f7a29b2d2 (diff) | |
download | kutter-fa07be93463d9ce0262ae383259e68eea625bc4d.tar.gz kutter-fa07be93463d9ce0262ae383259e68eea625bc4d.tar.xz kutter-fa07be93463d9ce0262ae383259e68eea625bc4d.zip |
mathutil: Move coordinate_descent() to new file
Add a new python file (mathutil.py) and move the coordinate_descent()
code to it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/bed_tilt.py')
-rw-r--r-- | klippy/extras/bed_tilt.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/klippy/extras/bed_tilt.py b/klippy/extras/bed_tilt.py index f7e61052..a6254a29 100644 --- a/klippy/extras/bed_tilt.py +++ b/klippy/extras/bed_tilt.py @@ -4,7 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import logging -import probe +import probe, mathutil class BedTilt: def __init__(self, config): @@ -73,7 +73,8 @@ class BedTiltCalibrate: for pos in positions: total_error += adjusted_height(pos, params)**2 return total_error - new_params = probe.coordinate_descent(params.keys(), params, errorfunc) + new_params = mathutil.coordinate_descent( + params.keys(), params, errorfunc) logging.info("Calculated bed_tilt parameters: %s", new_params) for pos in positions: logging.info("orig: %s new: %s", adjusted_height(pos, params), |