Skip to content
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

How can I use @logprogress inside a function called within an @withprogress macro? #40

Open
HarrisonWilde opened this issue Mar 15, 2021 · 4 comments · May be fixed by #41
Open

How can I use @logprogress inside a function called within an @withprogress macro? #40

HarrisonWilde opened this issue Mar 15, 2021 · 4 comments · May be fixed by #41

Comments

@HarrisonWilde
Copy link

Hi, I keep getting the following error when trying to call @logprogress in a function call to update a progress bar inside @withprogress wrapping my main execution loop, it works fine when the @logprogress is in this main loop level, but fails with the following error when I try to update progress within a function call in the loop:

ERROR: `@logprogress` must be used inside `@withprogress` or with `_id` keyword argument

I am not sure how I can pass this _id kwarg, I tried doing:

progress && ProgressLogging.@logprogress _id=progress_id t / Ntotal

But it doesn't change anything, any help would be appreciated

@pfitzseb pfitzseb linked a pull request Mar 16, 2021 that will close this issue
@pfitzseb
Copy link
Member

Pretty sure that's just a bug which should be fixed by #41.

@HarrisonWilde
Copy link
Author

Great thank you, so once it is merged, will the usage be to specify a parentid on the @withprogress call, then _id on the @logprogress calls? And the ID should presumably be the result of say: UUIDs.uuid1(Random.GLOBAL_RNG) for example?

@pfitzseb
Copy link
Member

pfitzseb commented Mar 16, 2021

Just something like

@logprogress 0.2 _id=3 # it's up to you to ensure that "3" is unique :)

should do the trick. We have a global ID which will be used instead of the parentid with #41.

@HarrisonWilde
Copy link
Author

Sorry could you clarify on that last part what you mean about using a global ID instead of parentid? Other than that sounds great though thanks for sorting it so quickly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants