klippy: fix typos in python code (#6989)

Signed-off-by: Thijs Triemstra <info@collab.nl>
This commit is contained in:
Thijs Triemstra
2025-07-25 18:31:19 +02:00
committed by GitHub
parent ef4c76fe94
commit 60879fd298
24 changed files with 43 additions and 43 deletions

View File

@@ -97,7 +97,7 @@ class AngleCalibration:
return None
return self.mcu_stepper.mcu_to_commanded_position(self.mcu_pos_offset)
def load_calibration(self, angles):
# Calculate linear intepolation calibration buckets by solving
# Calculate linear interpolation calibration buckets by solving
# linear equations
angle_max = 1 << ANGLE_BITS
calibration_count = 1 << CALIBRATION_BITS

View File

@@ -34,7 +34,7 @@ def constrain(val, min_val, max_val):
def lerp(t, v0, v1):
return (1. - t) * v0 + t * v1
# retreive commma separated pair from config
# retrieve comma separated pair from config
def parse_config_pair(config, option, default, minval=None, maxval=None):
pair = config.getintlist(option, (default, default))
if len(pair) != 2:
@@ -54,7 +54,7 @@ def parse_config_pair(config, option, default, minval=None, maxval=None):
% (option, str(maxval)))
return pair
# retreive commma separated pair from a g-code command
# retrieve comma separated pair from a g-code command
def parse_gcmd_pair(gcmd, name, minval=None, maxval=None):
try:
pair = [int(v.strip()) for v in gcmd.get(name).split(',')]
@@ -74,7 +74,7 @@ def parse_gcmd_pair(gcmd, name, minval=None, maxval=None):
% (name, maxval))
return pair
# retreive commma separated coordinate from a g-code command
# retrieve comma separated coordinate from a g-code command
def parse_gcmd_coord(gcmd, name):
try:
v1, v2 = [float(v.strip()) for v in gcmd.get(name).split(',')]
@@ -914,7 +914,7 @@ class ProbeManager:
for i in range(y_cnt):
for j in range(x_cnt):
if not i % 2:
# move in positive directon
# move in positive direction
pos_x = min_x + j * x_dist
else:
# move in negative direction
@@ -1164,7 +1164,7 @@ class ProbeManager:
def _gen_arc(self, origin, radius, start, step, count):
end = start + step * count
# create a segent for every 3 degress of travel
# create a segent for every 3 degrees of travel
for angle in range(start, end, step):
rad = math.radians(angle % 360)
opp = math.sin(rad) * radius

View File

@@ -12,7 +12,7 @@ def load_config_prefix(config):
if not config.has_section('display'):
raise config.error(
"A primary [display] section must be defined in printer.cfg "
"to use auxilary displays")
"to use auxiliary displays")
name = config.get_name().split()[-1]
if name == "display":
raise config.error(

View File

@@ -13,7 +13,7 @@
# ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip
# (c) Joseph Gil
#
# Indivdual fonts are public domain
# Individual fonts are public domain
######################################################################
VGA_FONT = [

View File

@@ -43,7 +43,7 @@ class FirmwareRetraction:
self.unretract_length = (self.retract_length
+ self.unretract_extra_length)
self.is_retracted = False
cmd_GET_RETRACTION_help = ("Report firmware retraction paramters")
cmd_GET_RETRACTION_help = ("Report firmware retraction parameters")
def cmd_GET_RETRACTION(self, gcmd):
gcmd.respond_info("RETRACT_LENGTH=%.5f RETRACT_SPEED=%.5f"
" UNRETRACT_EXTRA_LENGTH=%.5f UNRETRACT_SPEED=%.5f"

View File

@@ -158,7 +158,7 @@ class HTU21D:
def _sample_htu21d(self, eventtime):
try:
# Read Temeprature
# Read Temperature
if self.hold_master_mode:
params = self.i2c.i2c_write([HTU21D_COMMANDS['HTU21D_TEMP']])
else:

View File

@@ -53,7 +53,7 @@ class ApiClientHelper(object):
wh = self.printer.lookup_object('webhooks')
wh.register_mux_endpoint(path, key, value, self._add_webhooks_client)
# Class for handling commands related ot load cells
# Class for handling commands related to load cells
class LoadCellCommandHelper:
def __init__(self, config, load_cell):
self.printer = config.get_printer()

View File

@@ -235,7 +235,7 @@ class Palette2:
"Initialize the print, and check connection with the Palette 2")
def cmd_O1(self, gcmd):
logging.info("Initializing print with Pallete 2")
logging.info("Initializing print with Palette 2")
if not self._check_P2(gcmd):
raise self.printer.command_error(
"Cannot initialize print, palette 2 is not connected")

View File

@@ -1,4 +1,4 @@
# Mechanicaly conforms a moving gantry to the bed with 4 Z steppers
# Mechanically conforms a moving gantry to the bed with 4 Z steppers
#
# Copyright (C) 2018 Maks Zolin <mzolin@vorondesign.com>
#

View File

@@ -295,7 +295,7 @@ class ResonanceTester:
return parsed_chips
def _get_max_calibration_freq(self):
return 1.5 * self.generator.get_max_freq()
cmd_TEST_RESONANCES_help = ("Runs the resonance test for a specifed axis")
cmd_TEST_RESONANCES_help = ("Runs the resonance test for a specified axis")
def cmd_TEST_RESONANCES(self, gcmd):
# Parse parameters
axis = _parse_axis(gcmd, gcmd.get("AXIS").lower())
@@ -345,7 +345,7 @@ class ResonanceTester:
gcmd.respond_info(
"Resonances data written to %s file" % (csv_name,))
cmd_SHAPER_CALIBRATE_help = (
"Simular to TEST_RESONANCES but suggest input shaper config")
"Similar to TEST_RESONANCES but suggest input shaper config")
def cmd_SHAPER_CALIBRATE(self, gcmd):
# Parse parameters
axis = gcmd.get("AXIS", None)

View File

@@ -100,12 +100,12 @@ class SHT3X:
self.i2c.i2c_write_wait_ack(
SHT3X_CMD['PERIODIC']['2HZ']['HIGH_REP']
)
# Wait <=15.5ms for first measurment
# Wait <=15.5ms for first measurement
self.reactor.pause(self.reactor.monotonic() + .0155)
def _sample_sht3x(self, eventtime):
try:
# Read measurment
# Read measurement
retries = 5
params = None
error = None

View File

@@ -129,7 +129,7 @@ class SmartEffectorProbe:
start_time = toolhead.get_last_move_time()
# Write generated bits to the control pin
end_time = self.control_pin.write_bits(start_time, bit_stream)
# Dwell to make sure no subseqent actions are queued together
# Dwell to make sure no subsequent actions are queued together
# with the SmartEffector programming
toolhead.dwell(end_time - start_time)
toolhead.wait_moves()

View File

@@ -116,7 +116,7 @@ class FixedPointSosFilter:
if col != 3: # omit column 3
fixed_coeff = to_fixed_32(coeff, self._coeff_int_bits)
fixed_section.append(fixed_coeff)
elif coeff != 1.0: # double check colum 3 is always 1.0
elif coeff != 1.0: # double check column 3 is always 1.0
raise ValueError("Coefficient 3 is expected to be 1.0"
" but was %f" % (coeff,))
sos_fixed.append(fixed_section)

View File

@@ -408,7 +408,7 @@ class TemperatureProbe:
except self.printer.command_error:
self._finalize_drift_cal(False, "Error during initial move")
raise
# Caputure start position and begin initial probe
# Capture start position and begin initial probe
toolhead = self.printer.lookup_object("toolhead")
self.start_pos = toolhead.get_position()[:2]
manual_probe.ManualProbeHelper(
@@ -637,7 +637,7 @@ class EddyDriftCompensation:
gcode = self.printer.lookup_object("gcode")
if len(cal_samples) < 3:
raise gcode.error(
"calbration error, not enough samples"
"calibration error, not enough samples"
)
min_temp, _ = cal_samples[0][0]
max_temp, _ = cal_samples[-1][0]
@@ -687,7 +687,7 @@ class EddyDriftCompensation:
return self._calc_freq(freq, origin_temp, self.cal_temp)
def unadjust_freq(self, freq, dest_temp=None):
# Given a frequency and its orignal sampled temp, find the
# Given a frequency and its original sampled temp, find the
# offset frequency based on the current temp
if not self.enabled or freq < self.min_freq:
return freq
@@ -703,7 +703,7 @@ class EddyDriftCompensation:
low_freq = poly(origin_temp)
if freq >= low_freq:
if high_freq is None:
# Freqency above max calibration value
# Frequency above max calibration value
err = poly(dest_temp) - low_freq
return freq + err
t = min(1., max(0., (freq - low_freq) / (high_freq - low_freq)))

View File

@@ -15,7 +15,7 @@ class Thermistor:
self.inline_resistor = inline_resistor
self.c1 = self.c2 = self.c3 = 0.
def setup_coefficients(self, t1, r1, t2, r2, t3, r3, name=""):
# Calculate Steinhart-Hart coefficents from temp measurements.
# Calculate Steinhart-Hart coefficients from temp measurements.
# Arrange samples as 3 linear equations and solve for c1, c2, and c3.
inv_t1 = 1. / (t1 - KELVIN_TO_CELSIUS)
inv_t2 = 1. / (t2 - KELVIN_TO_CELSIUS)
@@ -40,7 +40,7 @@ class Thermistor:
self.c2 = (inv_t12 - self.c3 * ln3_r12) / ln_r12
self.c1 = inv_t1 - self.c2 * ln_r1 - self.c3 * ln3_r1
def setup_coefficients_beta(self, t1, r1, beta):
# Calculate equivalent Steinhart-Hart coefficents from beta
# Calculate equivalent Steinhart-Hart coefficients from beta
inv_t1 = 1. / (t1 - KELVIN_TO_CELSIUS)
ln_r1 = math.log(r1)
self.c3 = 0.