Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

lyse, TypeError in status bar widget

36 views
Skip to first unread message

Phelan Yu

unread,
Dec 9, 2024, 5:09:36 PM12/9/24
to the labscript suite
Hello labscripts devs,

I am new to labscripts, and have been doing some testing to see how it might be useful for our experiments. It looks really fantastic.

When trying to run multiple single-shot routines in Lyse, I noticed that an exception pops up related to the progress bar widget in the "shots" workflow.

__main__.py", line 1106, in paint
    progress_bar_option.progress = status_percent
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer 

I addressed this by basically forcing the the status percent variable to int by changing status_percent = self.model.data(index, self.ROLE_STATUS_PERCENT) to status_percent = round(self.model.data(index, self.ROLE_STATUS_PERCENT))

Was this a previously known bug?

All the best,
Phelan

dihm....@gmail.com

unread,
Jan 23, 2025, 1:49:28 PMJan 23
to the labscript suite
Phelan,

Thank you for reporting this. PyQT is slowly enforcing type consistency on inputs so these types of issues crop up randomly from time to time. What you have done is the correct fix. I'll add it to the list.

-David

dihm....@gmail.com

unread,
Jan 23, 2025, 1:55:27 PMJan 23
to the labscript suite
Apparently I should have checked the code before responding. This has been fixed on the current master branch already. Thank you again for the report though!

-David

Reply all
Reply to author
Forward
0 new messages