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

DOC: Fixes the AFQ tract profile tutorial. #3178

Merged
merged 6 commits into from May 16, 2024

Conversation

arokem
Copy link
Contributor

@arokem arokem commented Apr 5, 2024

This also adds the capability to download AFQ derivatives for all of the HBN subjects from the FCP INDI bucket where those are stored as part of the HBN POD2 study.

Addresses #3175, hopefully once and for all.

Copy link

codecov bot commented Apr 6, 2024

Codecov Report

Attention: Patch coverage is 3.84615% with 50 lines in your changes are missing coverage. Please review.

Project coverage is 83.61%. Comparing base (f741b88) to head (0f49459).
Report is 5 commits behind head on master.

❗ Current head 0f49459 differs from pull request most recent head 12aa8fe. Consider uploading reports for the commit 12aa8fe to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3178      +/-   ##
==========================================
- Coverage   83.75%   83.61%   -0.15%     
==========================================
  Files         153      153              
  Lines       21343    21285      -58     
  Branches     3445     3438       -7     
==========================================
- Hits        17876    17797      -79     
- Misses       2611     2630      +19     
- Partials      856      858       +2     
Files Coverage Δ
dipy/data/fetcher.py 41.23% <3.84%> (-0.55%) ⬇️

... and 9 files with indirect coverage changes

@skoudoro skoudoro linked an issue Apr 6, 2024 that may be closed by this pull request
Copy link
Member

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

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

Hi @arokem,

Thank you for this.

No sure the reason, but the download was quite long and TQDM did not show up. So I did not know if the terminal was freezing or something was happening.

Can you look at this, and make sure that TQDM shows up. Even when the data are already in place, we do not have any information like the other fetcher.

Otherwise, Can you tell me if this result looks correct to you?
image

Apart from this 2 points, it looks good to go.

@arokem
Copy link
Contributor Author

arokem commented Apr 9, 2024

The result looks correct. I'll look into the tqdm issue and report back.

return data_files


def fetch_hbn(subjects, path=None, include_afq=False):
Copy link
Member

Choose a reason for hiding this comment

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

Also, We start to introduce keyword-only arguments in the codebase.

can you replace this by def fetch_hbn(subjects, *, path=None, include_afq=False):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in 5123bcd. Just noting that I've noticed that this transition is breaking downstream code. I guess folks will have to update all their calls if they want to update dipy.

Copy link
Member

Choose a reason for hiding this comment

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

if it breaks, put it back as it was before, I plan a decorator to handle this and warn user for the whole codebase.

Copy link
Member

Choose a reason for hiding this comment

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

sorry for that

@skoudoro
Copy link
Member

skoudoro commented Apr 16, 2024

Hi @arokem,

No sure the reason, but the download was quite long and TQDM did not show up. So I did not know if the terminal was freezing or something was happening.

Do you have an update on this ?

@skoudoro
Copy link
Member

Hi @arokem,

It would be great if you could finalize this PR. It seems very close to go!

Thanks

@arokem
Copy link
Contributor Author

arokem commented May 15, 2024

TBH, I am not sure what remains here. You mentioned that it takes a long time to download the data, and TQDM not showing up. The time is because this downloads a large amount of diffusion MRI and derivatives, and I can't replicate TQDM not showing up on my end.

@arokem
Copy link
Contributor Author

arokem commented May 15, 2024

Would it be helpful if we download only the bits of the data that are directly used here maybe? I can see pros and cons to that.

@skoudoro
Copy link
Member

Would it be helpful if we download only the bits of the data that are directly used here maybe? I can see pros and cons to that.

I am ok with the long time to download. it was the TQDM issue.

Let me try again to see if TQDM shows up.

Copy link
Member

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

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

Hi @arokem,

I confirm, all good with the fetcher.

See below my last comment and it is ready to go.

Apologize for the late review and thank you for updating this tutorial.

"bundles_cst.left.trk")
af_l_file = op.join(bundles_folder, "bundles_2_subjects", "subj_2", "bundles",
"bundles_af.left.trk")
fdict, path = fetch_hbn([subject], include_afq=True)
Copy link
Member

Choose a reason for hiding this comment

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

fetch_hbn is not imported so the tutorial fails

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in last series of commits

@skoudoro
Copy link
Member

Can you also address the code format issue. See https://github.com/dipy/dipy/actions/runs/8715096640/job/23906448911?pr=3178#step:4:130

This is just spacing issue. Thanks !

This also adds the capability to download AFQ derivatives for all of the
HBN subjects from the FCP INDI bucket where those are stored as part of the
HBN POD2 study.
@pep8speaks
Copy link

pep8speaks commented May 16, 2024

Hello @arokem, Thank you for updating !

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated at 2024-05-16 16:54:23 UTC

@arokem arokem force-pushed the fix_tract_profiles_example branch from 2b37c04 to 00a4758 Compare May 16, 2024 16:39
@arokem
Copy link
Contributor Author

arokem commented May 16, 2024

Now rebased on top of main and with ruff formatting applied.

@skoudoro
Copy link
Member

Thank you for the update @arokem. Merging since codespell and code format are ok, we do not have CI's for examples yet.
something to fix in a close future.

@skoudoro skoudoro merged commit e85e0c8 into dipy:master May 16, 2024
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tract profiles in afq example look all wrong
3 participants