-
Notifications
You must be signed in to change notification settings - Fork 95
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
[ENH] --debug flag appear now in the help & documentation #385
[ENH] --debug flag appear now in the help & documentation #385
Conversation
- writting report is the default behaviour - help is now provided for the --debug (enable report) option
Thanks so much, @benoitberanger ! I missed this conversation, so just to check in -- why are we changing this to be the default behavior ? |
Proposition Why ? Side notes |
Thanks for summarizing, @benoitberanger ! I think I understand the situation better, now. The test failure is just because it's checking the outputs of the files, and it's not expecting the report.txt to be an output. That being said, I'm not yet sure that this is something we should have on by default. For your specific situation: usually with e.g. SLURM schedulers, you should be able to request that the logs are written to a specific file. Or, could you just add the For a more general case: I think it's useful to have different levels of verbosity, depending on your interest. Maybe this is too optimistic, but I'd like to think (hope, aspire to) that whether the ICA converged won't be something that everyone wants access to, as it's assumed to be true. If it's something we definitely want folks to review, maybe we should think about putting it into the new What do you think ? |
@emdupre SLURM is writing log files, but only in one directory, not next to the nifti files being processed, making the parsing very difficult. The I do agree different levels of verbosity is more ergonomic, and an option to write down the log file by default is debatable. What do you think ? |
I agree that Sorry to be so late in joining this discussion. |
We should move discussion from this PR to the issue IMO. |
Since work has started, I'd prefer to keep it linked to the PR. That way we can more easily comment on the changes 😸
Absolutely ! Yes, this part of the PR I love. My concern is here: https://github.com/ME-ICA/tedana/pull/385/files#diff-10962f3ba21a7497257aefd948c6c750R199 I think we're all converging on:
to quote @jbteves. So, that would be a bit more of an extensive change -- we could keep the That might be out of scope for this PR, in which case I think this one could just document that |
OK I try to summarize :
Does everyone agree ? Side question : is everyone ok with "tedana_run.txt" ? I would like to change the name in something a bit more meaningful, such as tedana.log / tedana_log.txt / log.txt |
I have no strong feelings about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this behavior negates the option's existence, but I could be wrong. When I hear back I'll change my review status accordingly.
tedana/workflows/tedana.py
Outdated
help=('Logs in the terminal will have increased ' | ||
'verbosity, and also will also be written ' | ||
'into a .txt file in the output directory.'), | ||
default=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Yeah, debug's default should be set to False here and in the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, but then in this setup it won't get written because it requires --debug
to execute. Okay, this PR will unfortunately need changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, I'm ok if this PR is only to make the debug option visible in the documentation, and if we make the additional changes in a separate PR ! It's up to @benoitberanger how much to tackle, here.
But definitely agree that regardless, this and the other boolean will need to change back to False 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected in e9a5fb1
Yes, that sounds exactly right to me ! Thanks @benoitberanger
tedana.log sounds great. We could optionally timestamp it, too, so it'd look more like tedana-HHMMSS.log No strong preferences, just thinking out loud. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting these changes @benoitberanger ! Due to the behavior of the argument parser, these changes will unfortunately have --debug
behave in an always-on manner. Consequently, you will have to make the value default to False
as before, and then remove the check for --debug
's presence before creating the logfile. As I recall you'll basically need to edit the logic here only.
I agree that tedana.log is good, but we originally had the timestamps and those made checking the outputs in the CI difficult (impossible maybe?), which is why we switched to a single name with the backup ( |
@emdupre I strongly oppose timestamps! It makes testing much more difficult since the filenames aren't static. You can put the timestamp at the top of the file instead. |
Yes, I remember this now (thanks both for the reminder), but I wonder if the simpler solution isn't just to ignore them in testing. I think it's a much more natural pattern for users, and if they're written by default I think we should cater to users rather than developers. EDIT: It could be as simple as adding a Line 177 in 0e45577
(and to the 3 echo test as well, of course). |
@emdupre in what way do you think it's more natural? Timestamps only feel natural to me if the timing has some inherent meaning, for example if it marks an event that is time-sensitive, not a post-hoc data run. I would guess that non-power-users would find no timestamps more natural, and that power-users would be suited well enough by the |
I think this is a really common pattern in software and I'm reticent to introduce a new one to users, especially since on our end it's straightforward to implement. Why I think it's a common pattern is if, for example, I'm submitting a job on a SLURM cluster I get output logs by default. These are each stamped with the unique job ID, so I can easily trace back to each subject as appropriate. In the tedana context, a "new" and "old" qualifier won't work if, for example, I'm trying out all three of the PCA flags. it'd be more natural to give the time, so I can continue to experiment with parameters without looking at an "_old_old" file. |
That makes sense, I hadn't thought of that. I do have some programs that use the |
@jbteves @emdupre @tsalo thank you all for your comments.
The log file written by default will be assessed in another PR, to keep development segmented. |
That sounds awesome @benoitberanger, thank you! |
- typo correction - set to False, according to the PR discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thanks @benoitberanger! Feel free to squash and merge when ready. @all-contributors please add @benoitberanger for code.
This looks great, so I'm going to go ahead and merge. Thanks again, @benoitberanger ! |
@all-contributors please add @benoitberanger for code contributions ! |
I've put up a pull request to add @benoitberanger! 🎉 |
Hello,
This PR is a solution for #361, as discussed with @tsalo.
The changes are :
--debug
visible in the help--debug
option--debug
option is is now the default behaviorFor now, I see 2 drawbacks that can easily be fixed :
--debug yes/no
and / or
--report
or--log
and separate if from the--debug
optionWhat do you think ?
Best,
Benoît