Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package/PartSeg/_roi_analysis/export_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def sleep_with_rate(response: requests.Response):
reset = int(response.headers["X-RateLimit-Reset"])
sleep_time = reset - time.time()
if sleep_time > 0:
logging.info("Sleeping for %(sleep_time) seconds", extra={"sleep_time": sleep_time})
logging.info("Sleeping for %s seconds", sleep_time)
time.sleep(sleep_time)


Expand Down
8 changes: 7 additions & 1 deletion package/PartSeg/common_backend/segmentation_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def run(self):
if self.algorithm.image is None:
# assertion for running algorithm without image
logging.error(
"No image in class %(cls_name)", extra={"cls_name": self.algorithm.__class__}, stack_info=True
"No image in class %s",
self.algorithm.__class__,
stack_info=True,
)
return
try:
Expand All @@ -61,6 +63,10 @@ def run(self):
return
if segment_data is None:
return
if self._image is not None:
# image changed during calculation
return

self.execution_done.emit(segment_data)

def finished_task(self):
Expand Down
13 changes: 7 additions & 6 deletions package/PartSeg/common_gui/advanced_tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,24 @@ def __init__(self, parent=None):

def reload_algorithm_action(self):
"""Function for reload plugins and algorithms"""
msg = "Reloading %(mod_name)"
msg = "Reloading %s"
for val in register.reload_module_list:
logging.info(msg, extra={"mod_name": val.__name__})
logging.info(msg, val.__name__)
importlib.reload(val)
for el in plugins.get_plugins():
logging.info(msg, extra={"mod_name": el.__name__})
logging.info(msg, el.__name__)
importlib.reload(el)
for el in core_plugins.get_plugins():
logging.info(msg, extra={"mod_name": el.__name__})
logging.info(msg, el.__name__)
importlib.reload(el)
importlib.reload(register)
importlib.reload(plugins)
importlib.reload(core_plugins)
plugins.register()
core_plugins.register()
for el in self.parent().parent().reload_list:
el()
if hasattr(self.parent().parent(), "reload_list"):
for el in self.parent().parent().reload_list:
el()


class MaskControl(QWidget):
Expand Down