Opened 5 years ago

Last modified 3 years ago

#3007 new defect

pygrass.messages.Messenger.percent() smallest step is 2

Reported by: lrntct Owned by: grass-dev@…
Priority: normal Milestone: 7.2.4
Component: LibGIS Version: svn-trunk
Keywords: Cc:
CPU: x86-64 Platform: Linux

Description

Even when the measured task is several hours long, Messenger.percent() displays steps two by two, instead of an expected one by one. This could give the false impression that the execution has stalled.

Bellow is a minimum working example:

from grass.pygrass.messages import Messenger
import time
total_time = 1000
msgr = Messenger()
for i in range(total_time):
    msgr.percent(i, total_time, 1)
    time.sleep(0.5)

Change History (7)

comment:1 Changed 5 years ago by neteler

Milestone: 7.1.07.2.0

Milestone renamed

comment:2 Changed 5 years ago by zarch

Component: PyGRASSLibGIS

I change the component fom pygrass to LibGis? since I see the problem also with C code:

#include<unistd.h>
#include <grass/gis.h>


int main()
{
	int row;
	int nrows = 1352;

	G_message("Percent complete...");
	for (row = 0; row < nrows; row++)
	{
		G_percent(row, nrows, 1);
		usleep(10000); 
	}
	G_percent(1, 1, 1);
	return 0;
}

Looking at the G_percent code I don't understand when is used the function G_set_percent_routine(int (*percent_routine) (int)) within the GRASS code and where the default percent_routine is defined.

comment:3 Changed 4 years ago by neteler

Milestone: 7.2.07.2.1

Ticket retargeted after milestone closed

comment:4 Changed 4 years ago by martinl

Milestone: 7.2.17.2.2

comment:5 Changed 4 years ago by neteler

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:6 Changed 3 years ago by martinl

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:7 Changed 3 years ago by martinl

Milestone: 7.2.4
Note: See TracTickets for help on using tickets.