-
Notifications
You must be signed in to change notification settings - Fork 100
ENH: Add kwargs in Brain.add_* and pass it to mayavi modules #276
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
4399524
Feat: add kwargs in Brain.add_* and pass it to mayavi modules, so tha…
DingkunLiu d86b19f
Fix: Fix code styles which failed in the flake test.
DingkunLiu 8cd93f3
Modify test_viz to pass the kwargs to the mayavi module.
DingkunLiu 9d077da
fix flake test.
DingkunLiu c7a5912
Specifying `kwargs` as `mlab_kws` and make the documentation more clear.
DingkunLiu c3c8602
Revert "Specifying `kwargs` as `mlab_kws` and make the documentation …
DingkunLiu 2c86a04
Link mayavi documents.
DingkunLiu 7264ec5
Give detailed explanations about the kwargs passed to the functions.
DingkunLiu b746e0f
Revert "Link mayavi documents."
DingkunLiu 0a6e0fa
Change the position of line breaking.
DingkunLiu 9f95d24
Fix the typo and unavailable links.
DingkunLiu ac0b7b8
Fix render errors.
DingkunLiu 0d5cdbf
Revert "Fix render errors."
DingkunLiu bbf7631
Fix render error.
DingkunLiu 35654e8
Improve code rendering.
DingkunLiu e3c6ee7
Revert "Fix render error."
DingkunLiu 6efccac
Fix line breaking error.
DingkunLiu 533bab5
Revert "Fix line breaking error."
DingkunLiu a7abf61
Fix line breaking error.
DingkunLiu 6bfe4b6
Revert "Fix line breaking error."
DingkunLiu 6a9cdf1
Force line breaking to fix the rendering error on long code.
DingkunLiu 97e6d55
Revert "Force line breaking to fix the rendering error on long code."
DingkunLiu c7f6a9f
Force line breaking to fix the rendering error on long code.
DingkunLiu 81c8c09
Revert "Force line breaking to fix the rendering error on long code."
DingkunLiu de31e5f
Force line breaking to fix the rendering error on long code.
DingkunLiu 32bbc7d
Revert "Force line breaking to fix the rendering error on long code."
DingkunLiu 859b993
Fix render error
DingkunLiu 4f99dd4
Render undocumented function as plain code.
DingkunLiu 3843885
Fix sectioning.
DingkunLiu 6453dd8
FIX: Formatting
larsoner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
*.swp | ||
*.orig | ||
build | ||
.idea/ | ||
|
||
dist/ | ||
doc/_build/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
This should follow the NumPy docstring format, like:
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.
But it is not necessarily to be a dict here. How about changing it to "All additional keyword arguments are passed to the
mlab.pipeline.surface
call." and specifying the namekwargs
tomlab_kws
?Or I could just remove the
**
symbols to make it a real dict?Uh oh!
There was an error while loading. Please reload this page.
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.
Let's do what nibabel does (except we don't need to escape the star characters)
https://github.com/nipy/nibabel/pull/827/files#diff-a1d0ba69368622536897ef9fe4aee05eR766
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.
This link is better (sorry on mobile)
https://github.com/nipy/nibabel/blob/ddab5468b12535b044b11837ee2776bb989bc341/nibabel/arraywriters.py#L266
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 are a lot of detailed arguments for each mayavi function, so I think it is hard to list all the possible arguments. Could we just list some useful examples?
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.
And one more thing, I think we should use the same name for the same argument in different functions. For example, the
alpha
inadd_data()
in mayavi is calledopacity
, so I think we should also specify this name in other functions and avoid it to appear inmlab_kws
.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 don't think we need to list all mayavi keywords, but it would be great if you could enable intersphinx so that the docs produce a link to the relevant mayavi api doc.
Nor do I think that we should have
mlab_kws
; the convention is to collect extra keyword arguments with**kwargs
, and "mlab" isn't particularly informative about where the kwargs are actually going.I'd also like to minimize changes unrelated to this specific enhancement. There is some inconsistency between pysurfer parameter names and mayavi ones, but aiming to fully streamline that would be a rabbit hole that is best to avoid.
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.
Agreed, I would just do:
To figure out the links you can dump the
intersphinx
inventory with something like:Then browse for relevant entries in
mayavi.txt
. Unfortunately they might not have entries for each function you actually want to use.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 have updated the documents, but unfortunately, those for the functions in
mlab.pipeline
are missing.