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

ENH: Verbose tracking #714

Merged
merged 7 commits into from
Aug 16, 2023
Merged

Conversation

EmmaRenauld
Copy link
Contributor

@EmmaRenauld EmmaRenauld commented Apr 25, 2023

Just for a better user experience. Previously, option -v in scil_compute_local_tracking did not output any verbose at all. No way to know if the code has even started.

Using TQDM, with a refresh rate of 1% of the total number of seeds (only with option -v).

Also sneeking in a verification of the format with save_seed option.

Example of output:
image

@arnaudbore arnaudbore self-requested a review April 25, 2023 16:11
@arnaudbore
Copy link
Contributor

Build passed ! Good Job 🍻 !

1 similar comment
@arnaudbore
Copy link
Contributor

Build passed ! Good Job 🍻 !

@AntoineTheb
Copy link
Contributor

Yay ! I actually do it locally anyway, so I'm all for it.

Copy link
Contributor

@AntoineTheb AntoineTheb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Petite suggestion dans le tracking dipy. Idéalement, le tracking dev et le PFT seraient aussi verboses.

if scaled_min_length <= length(s) <= scaled_max_length))
if args.verbose:
filtered_streamlines, seeds = \
zip(*((s, p) for s, p in tqdm(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu pourrais wrapper tqdm pour sauver un if-else imbriqué. Au dessus de if args.save_seeds, tu pourrais déclarer un truc du genre (pas testé)

def tqdm_wrapper(generator, *args, **kwargs):
    if args.verbose:
         return tqdm(generator, args, kwargs)
    return generator

Pis après utiliser tqdm_wrapper(streamlines_generator) partout

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, bonne idée. Je vais checker ça.

@EmmaRenauld
Copy link
Contributor Author

Petite suggestion dans le tracking dipy. Idéalement, le tracking dev et le PFT seraient aussi verboses.

J'ai essayé dans le dev. Mais le tqdm dans la boucle for fonctionne pas avec le multi-processing. J'ai checké un peu et j'ai trouvé des solutions dans le cas de générateurs, mais pas dans des boucles qu'on update manuellement. Si tu trouves comment, hésite pas!

@EmmaRenauld
Copy link
Contributor Author

Thanks Antoine for the contribution. Now this works for the dev tracking too, even with multiprocessing.

image

@arnaudbore
Copy link
Contributor

@arnaudbore
Copy link
Contributor

@EmmaRenauld
Copy link
Contributor Author

Tests pass locally. @arnaudbore or @frheault can you help me find the bug?

@arnaudbore
Copy link
Contributor

@arnaudbore
Copy link
Contributor

Build passed ! Good Job 🍻 !

Copy link
Contributor

@arnaudbore arnaudbore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GTG

@arnaudbore arnaudbore merged commit 868df99 into scilus:master Aug 16, 2023
@EmmaRenauld EmmaRenauld deleted the verbose_tracking branch August 16, 2023 15:14
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 this pull request may close these issues.

4 participants