NeurodataWithoutBorders / nwb-guide

NWB GUIDE is a desktop app that provides a no-code user interface for converting neurophysiology data to NWB.
https://nwb-guide.readthedocs.io/
MIT License
22 stars 4 forks source link

"2/1" reported by progress bar in single-session tutorial #844

Closed rly closed 3 months ago

rly commented 4 months ago

Describe the issue

When going through the single session tutorial on the 1.0 test release, on running the full conversion, the progress bar dialog showed:

  1. 1 empty bar
  2. after a couple seconds, 2 empty bars each showing 0/1
  3. bottom bar was filled and showed 1/1
  4. bottom bar updated to show 2/1
  5. top bar updated to show 1/1
  6. close dialog

https://github.com/NeurodataWithoutBorders/nwb-guide/assets/310197/ac4453ac-f8c9-4125-ac9d-36293b97c5ee

Console:

index-178c0fa4.js:7278 [main-process]: 
  0%|          | 0/1 [00:00<?, ?it/s]
(anonymous) @ index-178c0fa4.js:7278
index-178c0fa4.js:7278 [main-process]: 127.0.0.1 - - [08/Jun/2024 14:47:47] "POST /neuroconv/announce/progress HTTP/1.1" 200 -

(anonymous) @ index-178c0fa4.js:7278
index-178c0fa4.js:132072 parsed Object
onProgressMessage @ index-178c0fa4.js:132072
index-178c0fa4.js:7278 [main-process]: 
100%|██████████| 1/1 [00:00<00:00,  6.90it/s]
(anonymous) @ index-178c0fa4.js:7278
index-178c0fa4.js:7278 [main-process]: 127.0.0.1 - - [08/Jun/2024 14:47:48] "POST /neuroconv/announce/progress HTTP/1.1" 200 -

(anonymous) @ index-178c0fa4.js:7278
index-178c0fa4.js:132072 parsed Object
onProgressMessage @ index-178c0fa4.js:132072
index-178c0fa4.js:7278 [main-process]: 
2it [00:02,  1.27s/it]                       
(anonymous) @ index-178c0fa4.js:7278
index-178c0fa4.js:7278 [main-process]: 127.0.0.1 - - [08/Jun/2024 14:47:50] "POST /neuroconv/announce/progress HTTP/1.1" 200 -

(anonymous) @ index-178c0fa4.js:7278
index-178c0fa4.js:132072 parsed Object
onProgressMessage @ index-178c0fa4.js:132072
index-178c0fa4.js:7278 [main-process]: 

(anonymous) @ index-178c0fa4.js:7278
index-178c0fa4.js:7278 [main-process]: 
2it [00:02,  1.27s/it]
(anonymous) @ index-178c0fa4.js:7278
index-178c0fa4.js:7278 [main-process]: 
Total files converted: 100%|██████████| 1/1 [00:07<00:00,  7.43s/it]
(anonymous) @ index-178c0fa4.js:7278
index-178c0fa4.js:7278 [main-process]: 
Total files converted: 100%|██████████| 1/1 [00:07<00:00,  7.43s/it]

(anonymous) @ index-178c0fa4.js:7278
index-178c0fa4.js:132072 parsed Object
onProgressMessage @ index-178c0fa4.js:132072
index-178c0fa4.js:7278 [main-process]: 

NWB file saved at /Users/rly/NWB_GUIDE/conversions/Test/sub-Test/sub-Test_ses-Test.nwb!

Is the conversion happening twice? Or progress is being reported twice?

Not a big deal, but seemed odd.

Steps to Reproduce

Go through single-session tutorial

Operating System

Mac OS with Mac M1

GUIDE Version

1.0 test

Code of Conduct

Yes

Did you confirm this issue was not already reported?

Yes

rly commented 4 months ago

Similar behavior for the multi-session tutorial

https://github.com/NeurodataWithoutBorders/nwb-guide/assets/310197/28c32628-ad56-44a0-ab78-9cfb69bfe168

garrettmflynn commented 4 months ago

This is a known behavior when hooking into h5py. It's related to how it is manually updating the tqdm bar—though that's all I know at the moment.

CodyCBakerPhD commented 4 months ago

Maybe we can adjust the update call in tqdm_publisher to never set the n increment to larger than total?

garrettmflynn commented 4 months ago

Oh sorry, I meant hdmf in my last comment. Do we know why the total seems to be one less than what's actually done?

@CodyCBakerPhD I think we'd talked about this before but weren't sure it would persist on large files.

CodyCBakerPhD commented 3 months ago

https://github.com/hdmf-dev/hdmf/pull/1128 should fix this; nothing to do on the GUIDE side other than bump HDMF dependency and rebuild