mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 23:24:01 -06:00
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>
This commit is contained in:
parent
7290ed5f73
commit
fa07be9346
4 changed files with 45 additions and 39 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue