[ENH]: Introduce get_xfm for fetching transformation files #297
No reviewers
Labels
No labels
CRITICAL
Stale
WIP
bug
concept
coordinate
dataset
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
maintenance
maps
marker
mask
on hold
parcellation
preprocess
question
ready
storage
template-space
triage
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
juaml/junifer!297
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/xfm-download"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR introduces a new function
junifer.data.get_xfm()to fetch transformation files for moving between template spaces.Codecov Report
All modified and coverable lines are covered by tests ✅
Additional details and impacted files
100.00% <ø> (ø)89.24% <100.00%> (+0.01%)Flags with carried forward coverage won't be shown. Click here to find out more.
70.47% <ø> (ø)96.35% <ø> (ø)100.00% <100.00%> (ø)100.00% <100.00%> (ø)100.00% <ø> (ø)92.39% <ø> (ø)76.19% <ø> (ø)100.00% <ø> (ø)100.00% <ø> (ø)100.00% <ø> (ø)@ -0,0 +1,91 @@"""Provide functions for template spaces."""Can we make it the juaml organization in g-node.org?
@ -0,0 +85,4 @@)else:with open(xfm_file_path, "ab") as f:for chunk in resp.iter_bytes():Is
iter_bytesstill streaming? or the content is already in memory? If it is still streaming, an exception might occur here an it will not be catch.@ -0,0 +12,4 @@@pytest.mark.skipif(socket.gethostname() != "juseless",Why only for juseless?
@ -47,3 +47,4 @@"importlib_metadata; python_version<'3.10'","h5py>=3.8.0,<3.10","httpx[http2]==0.26.0",]Is it that strict the dependency?
@ -0,0 +1,91 @@"""Provide functions for template spaces."""Yeah we can, since I don't have permission to make a repo in the org, I made it in my account.
@ -0,0 +85,4 @@)else:with open(xfm_file_path, "ab") as f:for chunk in resp.iter_bytes():It's a generator basically thus it's still streaming. I don't find any exceptions being raised there in
httpx's source code.@ -0,0 +12,4 @@@pytest.mark.skipif(socket.gethostname() != "juseless",The download takes well around 10 mins from Gin.
@ -47,3 +47,4 @@"importlib_metadata; python_version<'3.10'","h5py>=3.8.0,<3.10","httpx[http2]==0.26.0",]It's always recommended to keep it like so when dealing with libraries which aren't 1.0 yet as the APIs can change very often.
@ -0,0 +1,91 @@"""Provide functions for template spaces."""Now you have !
@ -0,0 +85,4 @@)else:with open(xfm_file_path, "ab") as f:for chunk in resp.iter_bytes():Not from httpx, but mostly from an underlying connection issue if the connection is cut
@ -0,0 +12,4 @@@pytest.mark.skipif(socket.gethostname() != "juseless",damn, we need to create a "slow test" suite that we use it to check only when about to merge or something like that. For the moment we keep it like this.
@ -47,3 +47,4 @@"importlib_metadata; python_version<'3.10'","h5py>=3.8.0,<3.10","httpx[http2]==0.26.0",]perfect
@ -0,0 +85,4 @@)else:with open(xfm_file_path, "ab") as f:for chunk in resp.iter_bytes():You will get error from
httpcore, which is the underlying HTTP library, like you get fromurllib3when usingrequests.@ -0,0 +12,4 @@@pytest.mark.skipif(socket.gethostname() != "juseless",Yeah that's a good idea. Well the essential issue is that Gin is not really as powerful as GitHub when you consider infrastructure, so the octet-stream downloads are not cached from what I understand.
@ -0,0 +1,91 @@"""Provide functions for template spaces."""Transferred.
@ -0,0 +85,4 @@)else:with open(xfm_file_path, "ab") as f:for chunk in resp.iter_bytes():Exactly, I thought of catching any exception and giving a more user-friendly error message of what's going
@ -0,0 +85,4 @@)else:with open(xfm_file_path, "ab") as f:for chunk in resp.iter_bytes():Ideally it should be dealt by the underlying http lib. You won't get an exception to catch when doing
iter_bytes(), having an exception block there would not serve the purpose imo.