-
Notifications
You must be signed in to change notification settings - Fork 576
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
[WIP][ENH] Move surface image API from experimental to stable API #4229
Conversation
👋 @ymzayek Thanks for creating a PR! Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft. Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.
For new features:
For bug fixes:
We will review it as quick as possible, feel free to ping us with questions if needed. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4229 +/- ##
==========================================
+ Coverage 91.87% 92.03% +0.16%
==========================================
Files 144 136 -8
Lines 16421 16217 -204
Branches 3434 3409 -25
==========================================
- Hits 15086 14925 -161
+ Misses 792 749 -43
Partials 543 543 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
||
PolyData = Dict[str, np.ndarray] | ||
|
||
|
||
class Mesh(abc.ABC): | ||
class _Mesh(abc.ABC): |
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.
If we want this to be a public class then need to deprecate surface.py's Mesh
named tuple right away. Either way, we will need to deprecated the named tuples
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.
Probably worth pinning this one for later.
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.
looks good so far.
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.
TODO
- move this file out of the experimental example
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.
Do in a follow up PR after we have dealt with:
I think I would keep this for another PR probably one with example that shows basic "loading" of surface images because at the moment how to compose those SurfaceImage instances is hidden in our dataset utility functions like |
nilearn/surface/surface_image.py
Outdated
|
||
n_vertices: int | ||
n_vertices: ... |
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.
OK I am sorry but I am putting types back in here because ...
is just worse than mentioning the type.
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.
Fair. I wasn't sure what to do about these so it's a bit unfinished. I think you should add back PolyMesh and PolyData as well
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.
No worries. I was just confused as to why we were "ellisping" here.
In general, still sad we are removing type hints that were already here though.
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.
you could remove the whole line or leave the type.
In general, still sad we are removing type hints that were already here though.
if they are complete enough within a sub-package that this part can successfully pass the mypy check we could leave them. what I would like to avoid is broken type hints, which is bound to happen if we don't run mypy in the ci
# TODO check attribute names after PR 3761 | ||
# and harmonize with volume labels masker if necessary. | ||
# https://github.com/nilearn/nilearn/pull/3761 | ||
def __init__(self, labels_img, label_names=None): |
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.
TODO in a follow up PR
For the moment I would deprecate as little as possible: have both APIs coexist in the next release and then slowly start redirect to the new API after that. |
let's integrate plotting first before moving out of experimental |
TODO
|
yeah but for one of those I was getting an "empty file" error: will try to investigate a bit more
there is some documentation in
https://github.com/nilearn/nilearn/blob/main/nilearn/datasets/tests/_testing.py
but it probably needs to be expanded.
If you need help figuring out what this thing does LMK
|
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 remain a couple of "to fix" and codecov complaints (maybe wrong ?)
but I don't see anything fishy with the PR.
Nevertheless, we're not going to merge it shortly.
Closing this one as it will be easier to start it from scratch rather than fixing the merge conflicts.
|
Changes proposed in this pull request:
experimental.surface
atlas
,func
, andstruct
fetch_destrieux
renamedload_sample_atlas_surf_destrieux
fetch_nki
renamedload_sample_surf_nki_enhanced
load_fsaverage
renamedload_surf_fsaverage
mesh_name
parameter ofload_surf_fsaverage
renamedmesh
for consistency withfetch_surf_fsaverage
Mesh
base class renamed_Mesh
Mesh
already exists as namedtuple which we will probably deprecateTODO:
experimental.surface._io
tosurface._io
The following PRs will depend on merging this one:
#4126
#4205
#4120 - already merged, relevant imports are updated in this PR