knime-geospatial-extension
knime-geospatial-extension copied to clipboard
Report progress where ever possible especially during potentially long running processes e.g. reading files
KNIME provides a method provide progress information through the UI and we should make use of it as much as possible, Unfortunately Geopandas does not provide a build in mechanism for this. A potential way could be to use tqdm.
This is example code that converts tqdm to the KNIME progress methods:
@contextlib.contextmanager def tqdm_to_knime(exec_context: knext.ExecutionContext): from tqdm import tqdm
def mock_display(self, msg=None, pos=None):
# TODO set the message
exec_context.set_progress(self.n / self.total)
return True
real_display = tqdm.display
try:
tqdm.display = mock_display
yield
finally:
tqdm.display = real_display