Frix-x / klippain-shaketune

Klipper streamlined input shaper workflow and calibration tools
GNU General Public License v3.0
670 stars 80 forks source link

Running VIBRATIONS_CALIBRATION after AXIS_MAP_CALIBRATION cause error #55

Closed j16sdiz closed 5 months ago

j16sdiz commented 9 months ago

K-Shake&Tune module branch

Version

v2.5.0-3-geab10ce5

Describe the bug and expected behavior

The script took *-axemap.csv as a vibration test output. It should be ignored.

Additional information and klippy.log

raise ValueError("File %s does not contain speed in its name and therefore "
ValueError: File /home/biqu/printer_data/config/K-ShakeTune_results/vibrations/vibr_20240129_155151-axemap.csv does not contain speed in its name and therefore is not supported by this script.
15:52:07
raw_speeds = [extract_speed(filename) for filename in lognames]
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_vibrations.py", line 327, in extract_speed
15:52:07
create_vibrations_graph(axis_name=options.axis_name, accel=options.accel_used, chip_name=options.chip_name, keep_csv=options.keep_csv)
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 165, in create_vibrations_graph
fig = vibrations_calibration(lognames, KLIPPER_FOLDER, axis_name, accel)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_vibrations.py", line 353, in vibrations_calibration
raw_speeds = [extract_speed(filename) for filename in lognames]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_vibrations.py", line 353, in
15:52:07
speed = re.search('sp(.+?)n', os.path.basename(logname)).group(1).replace('_','.')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 299, in
main()
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 288, in main
Frix-x commented 8 months ago

Yes, this is indeed a known issue due to the fact that the AXE_MAP_CALIBRATION variable is quite experimental and its level of integration is not on par with the other macros: it currently does not clean up the /tmp folder and that's why this bug happens. I have it in my backlog to fix it in the next version :)

Frix-x commented 5 months ago

I'm closing this issue in favor of #99 that is a duplicate of the AXES_MAP_CALIBRATION not working correctly. The feature will soon be fixed. In the meantime, avoid using it, the rest should work correctly.