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
Suppress line numbers in tock()
#12
Comments
Hi @kretes Thanks for the feedback! I have to say that I totally agree with your rationale... The good news is that what you want to achieve is already achievable from the main branch.
You can set a format string such as: from ticktock import tick, set_format
set_format("[{tick_name}] {mean}") I agree with your comment that there remains confusion on the tick and tock names and their rendering. This is especially true with the function decorator and context manager. I need to go back and make sure that it is all consistent, which I hoped to do before releasing the package later this week. Could you check out that it works OK with the set format method? I will keep you posted! |
Thanks! When using the code from source I can use Still - a solution to control it at the level of tick-tock and not in the format would be beneficial |
Thanks again for the feedback. Bottom line is we have a clear bug with the decorator which I will try and fix soon. Controlling the format at the tick/tock level is also something that was requested in another issue 😬 . I originally was not convinced but I suppose now is the time to put it in! It should be done shortly, and I will push a new release afterwards! |
This is fixed in the current release! |
many thanks. It works as expected if combined with format set to include just |
Hello.
Thanks for your effort on the library, works really nice.
I would like to polish the output a bit - i.e. suppress the line numbers from the
tock
event, since In some cases they are redundant.For a :
I want:
[aaaa] 1s200 ms
and now I have[aaaa:3-5] 1s200 ms
And for a:
I want:
[train batch] 100ms
and now I get[train batch:11] 100ms
Rationale:
In the annotation case - this is obvious that a method with decorator will just get a single
tock()
for everytick
- and so there is no need to differentiate the times, and hence it would be best if the output shown would just contain the name passed to@ticktock()
In the manual case - I would say, that this should be user-controlled. I am not sure what the API would be best, but maybe something like
tick(single_tock=True)
ortock(only=True)
that would made thetock()
not record any name for thetock
and therefore the ouptut might just contain the name passed totick
?The text was updated successfully, but these errors were encountered: