-
-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progress callback is called too soon ? #741
Comments
|
If the |
So it turns out that the problem is the sort call after reading the data. I added some quick print statements to the
The bulk of the processing time is for DTBLOCKs |
It takes around 4s for one iteration of the following for block (I added the progress stuff):
I have 575 groups in total so it will take about 30-35 minutes. |
Damn, how big is the file? |
About 574 MBs |
please try the development branch code |
I had a look at the changes. I tried to think of a way to update the progress while sorting is taking place. Then you could call the progress function inside the sort() call, updating by the increment every time. |
Added progress information while sorting all the groups. - Added 102 extra steps in the load progress, 100 for sorting and 2 after sorting is completed. - When incrementing the progress updates during sorting we first compute a step, based on the total number of steps we have (100), the number of groups and the total items and then we increment each sorting by the step count. - If the previous step count (integer) is greater than the current step (integer) then we can update the progress. This avoids calling the callback function with floating values and avoids calling the callback function with the same current value of the progress bar - i.e. we only call when there's an update in progress.
I have created a pull request with my proposed solution implemented. |
You can use the following script to check the progress updates.
|
in the version 7.3.0 you will have to change the argument name to with asammdf.MDF(file, progress=progress_function) as mf4_file:
loading.close() # done with load progress |
Python version
Code
Code snippet
Description
The progress for loading the file finishes a lot faster than the file is actually loaded.
The progress for my file (but the file itself doesn't matter from what I can tell) has total set to
13903
or similar and the progress finishes in a few seconds, but the progress bar is closed and the log message sayingReading finished for {file}
is only written minutes laterThe text was updated successfully, but these errors were encountered: