diff --git a/klippy/chelper/__init__.py b/klippy/chelper/__init__.py index 671a5d2b..2aed107a 100644 --- a/klippy/chelper/__init__.py +++ b/klippy/chelper/__init__.py @@ -274,7 +274,7 @@ FFI_main = None FFI_lib = None pyhelper_logging_callback = None -# Hepler invoked from C errorf() code to log errors +# Helper invoked from C errorf() code to log errors def logging_callback(msg): logging.error(FFI_main.string(msg)) diff --git a/klippy/extras/angle.py b/klippy/extras/angle.py index 3b1f323e..73af67ca 100644 --- a/klippy/extras/angle.py +++ b/klippy/extras/angle.py @@ -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 diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py index 3f0498ff..a8e5764c 100644 --- a/klippy/extras/bed_mesh.py +++ b/klippy/extras/bed_mesh.py @@ -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 diff --git a/klippy/extras/display/__init__.py b/klippy/extras/display/__init__.py index 1cea00e0..da0e861c 100644 --- a/klippy/extras/display/__init__.py +++ b/klippy/extras/display/__init__.py @@ -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( diff --git a/klippy/extras/display/font8x14.py b/klippy/extras/display/font8x14.py index 3d16ee25..66592edb 100644 --- a/klippy/extras/display/font8x14.py +++ b/klippy/extras/display/font8x14.py @@ -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 = [ diff --git a/klippy/extras/firmware_retraction.py b/klippy/extras/firmware_retraction.py index bcecf8f2..da0d67af 100644 --- a/klippy/extras/firmware_retraction.py +++ b/klippy/extras/firmware_retraction.py @@ -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" diff --git a/klippy/extras/htu21d.py b/klippy/extras/htu21d.py index 01b3750d..688338d9 100644 --- a/klippy/extras/htu21d.py +++ b/klippy/extras/htu21d.py @@ -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: diff --git a/klippy/extras/load_cell.py b/klippy/extras/load_cell.py index 4117a92c..5ef2c5b7 100644 --- a/klippy/extras/load_cell.py +++ b/klippy/extras/load_cell.py @@ -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() diff --git a/klippy/extras/palette2.py b/klippy/extras/palette2.py index ec8631b0..4fe72080 100644 --- a/klippy/extras/palette2.py +++ b/klippy/extras/palette2.py @@ -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") diff --git a/klippy/extras/quad_gantry_level.py b/klippy/extras/quad_gantry_level.py index 7c6febcb..98cd53c5 100644 --- a/klippy/extras/quad_gantry_level.py +++ b/klippy/extras/quad_gantry_level.py @@ -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 # diff --git a/klippy/extras/resonance_tester.py b/klippy/extras/resonance_tester.py index a4d3876f..ff32dcac 100644 --- a/klippy/extras/resonance_tester.py +++ b/klippy/extras/resonance_tester.py @@ -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) diff --git a/klippy/extras/sht3x.py b/klippy/extras/sht3x.py index 79cd7bfe..c76ceb76 100644 --- a/klippy/extras/sht3x.py +++ b/klippy/extras/sht3x.py @@ -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 diff --git a/klippy/extras/smart_effector.py b/klippy/extras/smart_effector.py index 4b90c309..3caa4e6b 100644 --- a/klippy/extras/smart_effector.py +++ b/klippy/extras/smart_effector.py @@ -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() diff --git a/klippy/extras/sos_filter.py b/klippy/extras/sos_filter.py index 8c405782..293b2258 100644 --- a/klippy/extras/sos_filter.py +++ b/klippy/extras/sos_filter.py @@ -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) diff --git a/klippy/extras/temperature_probe.py b/klippy/extras/temperature_probe.py index 05eac34e..c480ddae 100644 --- a/klippy/extras/temperature_probe.py +++ b/klippy/extras/temperature_probe.py @@ -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))) diff --git a/klippy/extras/thermistor.py b/klippy/extras/thermistor.py index 16d6ca61..db26b50c 100644 --- a/klippy/extras/thermistor.py +++ b/klippy/extras/thermistor.py @@ -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. diff --git a/klippy/stepper.py b/klippy/stepper.py index 09f3dad9..86a92358 100644 --- a/klippy/stepper.py +++ b/klippy/stepper.py @@ -86,7 +86,7 @@ class MCU_stepper: if self._step_pulse_duration > MIN_BOTH_EDGE_DURATION: # If user has requested a very large step pulse duration # then disable step on both edges (rise and fall times may - # not be symetric) + # not be symmetric) want_both_edges = False elif sbe and self._step_pulse_duration>MIN_OPTIMIZED_BOTH_EDGE_DURATION: # Older MCU and user has requested large pulse duration diff --git a/klippy/webhooks.py b/klippy/webhooks.py index ddba60d9..9e17177a 100644 --- a/klippy/webhooks.py +++ b/klippy/webhooks.py @@ -12,7 +12,7 @@ except ImportError: import json # Json decodes strings as unicode types in Python 2.x. This doesn't - # play well with some parts of Klipper (particuarly displays), so we + # play well with some parts of Klipper (particularly displays), so we # need to create an object hook. This solution borrowed from: # # https://stackoverflow.com/questions/956867/ diff --git a/scripts/filter_workbench.ipynb b/scripts/filter_workbench.ipynb index e912ee86..1e1adfe7 100644 --- a/scripts/filter_workbench.ipynb +++ b/scripts/filter_workbench.ipynb @@ -69,7 +69,7 @@ "metadata": {}, "source": [ "## Sensor Information\n", - "Fill out the sensor's sample frequency, in samples per second, below. This must match the frquency of the captured data in `probe_data`." + "Fill out the sensor's sample frequency, in samples per second, below. This must match the frequency of the captured data in `probe_data`." ] }, { @@ -104,7 +104,7 @@ "metadata": {}, "outputs": [], "source": [ - "# set filter settig here. If you dont want a filter to be used, assign `None` to it\n", + "# set filter setting here. If you dont want a filter to be used, assign `None` to it\n", "drift_filter_cutoff_frequency = 0.8\n", "buzz_filter_cutoff_frequency = 150.0\n", "notch_filter_frequencies = [50.0, 60.0]\n", @@ -182,7 +182,7 @@ "### Calculate Filter Initial Consitions (zi)\n", "This block automatically calculates the filters starting conditions using `signal.sosfilt_zi`.\n", "\n", - "On the MCU, the tare functionality zeros out the grams value so the inital zi matrix doesnt have to be calculated and there will be no filter settling time." + "On the MCU, the tare functionality zeros out the grams value so the initial zi matrix doesnt have to be calculated and there will be no filter settling time." ] }, { @@ -214,7 +214,7 @@ "metadata": {}, "source": [ "## Display Filter Frequency Response\n", - "This block plots the filter's response to sinals from 0 up to the [nyquist frequency]() which is 1/2 the `sensor_frequency`. " + "This block plots the filter's response to signals from 0 up to the [nyquist frequency]() which is 1/2 the `sensor_frequency`. " ] }, { @@ -260,7 +260,7 @@ "## Test Filter Performance\n", "Test `filter_design` on `probe_data`. This shows plots of the filters performance when filtering the force graph in `probe_data`.\n", "\n", - "To help decorate the graphs please prvide the desired trigger threashold of the probe:" + "To help decorate the graphs please provide the desired trigger threshold of the probe:" ] }, { @@ -339,7 +339,7 @@ "metadata": {}, "source": [ "#### `force` vs force filtered with `filter_design`\n", - "In this graph we are looking to see the 'Filtered Force' line remain inside the red lines denoting the trigger force. A Properly filtered force grpah will be horizontal." + "In this graph we are looking to see the 'Filtered Force' line remain inside the red lines denoting the trigger force. A Properly filtered force graph will be horizontal." ] }, { diff --git a/scripts/flash-sdcard.sh b/scripts/flash-sdcard.sh index 08886409..6a08eab1 100755 --- a/scripts/flash-sdcard.sh +++ b/scripts/flash-sdcard.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This script launches flash_sdcard.py, a utitlity that enables +# This script launches flash_sdcard.py, a utility that enables # unattended firmware updates on boards with "SD Card" bootloaders # Non-standard installations may need to change this location diff --git a/scripts/graph_shaper.py b/scripts/graph_shaper.py index 0ea19458..b9a6627c 100755 --- a/scripts/graph_shaper.py +++ b/scripts/graph_shaper.py @@ -20,7 +20,7 @@ SHAPER_DAMPING_RATIO=0.1 STEP_SIMULATION_RESONANCE_FREQ=60. STEP_SIMULATION_DAMPING_RATIO=0.15 -# If set, defines which range of frequencies to plot shaper frequency responce +# If set, defines which range of frequencies to plot shaper frequency response PLOT_FREQ_RANGE = [] # If empty, will be automatically determined #PLOT_FREQ_RANGE = [10., 100.] @@ -159,7 +159,7 @@ def find_shaper_plot_range(shaper, vib_tol): return (left, right) def gen_shaper_response(shaper): - # Calculate shaper vibration responce on a range of requencies + # Calculate shaper vibration response on a range of frequencies response = [] freqs = [] freq, freq_end = find_shaper_plot_range(shaper, vib_tol=0.25) diff --git a/scripts/motan/readlog.py b/scripts/motan/readlog.py index 4c078c9b..43c01619 100644 --- a/scripts/motan/readlog.py +++ b/scripts/motan/readlog.py @@ -234,7 +234,7 @@ class HandleStepQ: step_data.append((step_time, step_halfpos, step_pos)) LogHandlers["stepq"] = HandleStepQ -# Extract tmc currect and stallguard data from the log +# Extract tmc current and stallguard data from the log class HandleStallguard: SubscriptionIdParts = 2 ParametersMin = 2 diff --git a/scripts/spi_flash/spi_flash.py b/scripts/spi_flash/spi_flash.py index 2a4b48ad..e45e0b7c 100644 --- a/scripts/spi_flash/spi_flash.py +++ b/scripts/spi_flash/spi_flash.py @@ -46,7 +46,7 @@ def calc_crc7(data, with_padding=True): crc ^= b & 0xFF for i in range(8): crc = (crc << 1) ^ poly if crc & 0x80 else crc << 1 - # The sdcard protocol likes the crc left justfied with a + # The sdcard protocol likes the crc left justified with a # padded bit if not with_padding: return crc @@ -566,7 +566,7 @@ class SDCardSPI: # At this time MMC is not supported if len(resp) == 5: if self.sd_version == 1 and resp[0] == 1: - # Check acceptable volatage range for V1 cards + # Check acceptable voltage range for V1 cards if resp[2] != 0xFF: raise OSError("flash_sdcard: card does not support" " 3.3v range") @@ -903,7 +903,7 @@ class SDCardSDIO: " out of IDLE after reset") if len(resp) == 4: if self.sd_version == 1: - # Check acceptable volatage range for V1 cards + # Check acceptable voltage range for V1 cards if resp[1] != 0xFF: raise OSError("flash_sdcard: card does not support" " 3.3v range") @@ -1643,7 +1643,7 @@ def main(): logging.basicConfig(level=log_level) flash_args = board_defs.lookup_board(args.board) if flash_args is None: - output_line("Unable to find defintion for board: %s" % (args.board,)) + output_line("Unable to find definition for board: %s" % (args.board,)) sys.exit(-1) flash_args['device'] = args.device flash_args['baud'] = args.baud diff --git a/scripts/update_chitu.py b/scripts/update_chitu.py index a1ef4d8b..cf7fcfe9 100755 --- a/scripts/update_chitu.py +++ b/scripts/update_chitu.py @@ -76,7 +76,7 @@ def encode_file(input, output_file, file_length): xor_crc = 0xef3d4323; - # the input file is exepcted to be in chunks of 0x800 + # the input file is expected to be in chunks of 0x800 # so round the size while len(input_file) % block_size != 0: input_file.extend(b'0x0')